1var BrowserDetect = { 2 init: function () { 3 this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; 4 this.version = this.searchVersion(navigator.userAgent) 5 || this.searchVersion(navigator.appVersion) 6 || "an unknown version"; 7 this.OS = this.searchString(this.dataOS) || "an unknown OS"; 8 }, 9 searchString: function (data) { 10 for (var i = 0; i < data.length; i++) { 11 var dataString = data[i].string; 12 var dataProp = data[i].prop; 13 this.versionSearchString = data[i].versionSearch || data[i].identity; 14 if (dataString) { 15 if (dataString.indexOf(data[i].subString) != -1) 16 return data[i].identity; 17 } 18 else if (dataProp) 19 return data[i].identity; 20 } 21 }, 22 searchVersion: function (dataString) { 23 var index = dataString.indexOf(this.versionSearchString); 24 if (index == -1) return; 25 return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); 26 }, 27 dataBrowser: [ 28 { 29 string: navigator.userAgent, 30 subString: "Chrome", 31 identity: "Chrome" 32 }, 33 { 34 string: navigator.userAgent, 35 subString: "OmniWeb", 36 versionSearch: "OmniWeb/", 37 identity: "OmniWeb" 38 }, 39 { 40 string: navigator.vendor, 41 subString: "Apple", 42 identity: "Safari", 43 versionSearch: "Version" 44 }, 45 { 46 prop: window.opera, 47 identity: "Opera", 48 versionSearch: "Version" 49 }, 50 { 51 string: navigator.vendor, 52 subString: "iCab", 53 identity: "iCab" 54 }, 55 { 56 string: navigator.vendor, 57 subString: "KDE", 58 identity: "Konqueror" 59 }, 60 { 61 string: navigator.userAgent, 62 subString: "Firefox", 63 identity: "Firefox" 64 }, 65 { 66 string: navigator.vendor, 67 subString: "Camino", 68 identity: "Camino" 69 }, 70 { // for newer Netscapes (6+) 71 string: navigator.userAgent, 72 subString: "Netscape", 73 identity: "Netscape" 74 }, 75 { 76 string: navigator.userAgent, 77 subString: "MSIE", 78 identity: "Explorer", 79 versionSearch: "MSIE" 80 }, 81 { 82 string: navigator.userAgent, 83 subString: "Gecko", 84 identity: "Mozilla", 85 versionSearch: "rv" 86 }, 87 { // for older Netscapes (4-) 88 string: navigator.userAgent, 89 subString: "Mozilla", 90 identity: "Netscape", 91 versionSearch: "Mozilla" 92 } 93 ], 94 dataOS: [ 95 { 96 string: navigator.platform, 97 subString: "Win", 98 identity: "Windows" 99 }, 100 { 101 string: navigator.platform, 102 subString: "Mac", 103 identity: "Mac" 104 }, 105 { 106 string: navigator.userAgent, 107 subString: "iPhone", 108 identity: "iPhone/iPod" 109 }, 110 { 111 string: navigator.platform, 112 subString: "Linux", 113 identity: "Linux" 114 } 115 ] 116 117}; 118BrowserDetect.init(); 119 120jQuery.browser = {}; 121jQuery.browser.mozilla = (BrowserDetect.browser == 'Firefox' || BrowserDetect.browser == 'Mozilla' || BrowserDetect.browser == 'Netscape'); 122jQuery.browser.webkit = (BrowserDetect.browser == 'Chrome'); 123jQuery.browser.opera = (BrowserDetect.browser == 'Opera'); 124jQuery.browser.msie = (BrowserDetect.browser == 'Explorer'); 125 126jQuery.browser.version = BrowserDetect.version; 127 128if (!window.console) { 129 window.console = { 130 log: function (obj) { /* define own logging function here, or leave empty */ } 131 }; 132} 133if (!window.console.debug) { 134 window.console.debug = function(obj) {}; 135}; 136 137if (!String.prototype.trim) { 138 String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }; 139} 140if (typeof String.prototype.startsWith != 'function') { 141 // see below for better implementation! 142 String.prototype.startsWith = function (str){ 143 return this.indexOf(str) == 0; 144 }; 145} 146 147if (!Date.prototype.toISOString) { 148 (function() { 149 150 function pad(number) { 151 if (number < 10) { 152 return '0' + number; 153 } 154 return number; 155 } 156 157 Date.prototype.toISOString = function() { 158 return this.getUTCFullYear() +
159 '-' + pad(this.getUTCMonth() + 1) + 160 '-' + pad(this.getUTCDate()) + 161 'T' + pad(this.getUTCHours()) + 162 ':' + pad(this.getUTCMinutes()) + 163 ':' + pad(this.getUTCSeconds()) + 164 '.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 165 'Z'; 166 }; 167 168 }()); 169} 170 171function useTimezone(dateStr,format) { 172 if (format==undefined || format==null) { 173 format = 'dd.MM.yyyy HH:mm:ss'; 174 } 175 var dd = kendo.parseDate(dateStr,'dd.MM.yyyy HH:mm:ss'); 176 if (dd==null) 177 return null; 178 var newDD = kendo.parseDate(dd.toISOString().split('.')[0]); 179 if (newDD==null) 180 return null; 181 // var cd = kendo.parseDate(dd,'dd.MM.yyyy HH:mm:ss'); 182 return kendo.toString(newDD,format); 183} 184 185 186var tryParseJson = function (str){ 187 try { 188 var jsonData = JSON && JSON.parse(str) || $.parseJSON(str); 189 return jsonData; 190 } catch (e) { 191 return null; 192 } 193}; 194 195var tryParseDate = function (strDate){ 196 var dl = null; 197 try{ 198 var dateParts = strDate.split("."); 199 dl = new Date(dateParts[2], (parseInt(dateParts[1]) - 1), dateParts[0]); 200 if ( Object.prototype.toString.call(dl) === "[object Date]" ) { 201 if ( isNaN( dl.getTime() ) ) { // d.valueOf() could also work 202 dl=null; 203 } 204 } else { 205 dl = null; 206 } 207 } catch (e) { 208 dl = null; 209 } 210 return dl; 211}; 212 213function isEqual(a, b) { 214 // Create arrays of property names 215 var aProps = Object.getOwnPropertyNames(a); 216 var bProps = Object.getOwnPropertyNames(b); 217 218 // If number of properties is different, 219 // objects are not equivalent 220 if (aProps.length != bProps.length) { 221 return false; 222 } 223 224 for (var i = 0; i < aProps.length; i++) { 225 var propName = aProps[i]; 226 227 // If values of same property are not equal, 228 // objects are not equivalent 229 if (a[propName] !== b[propName]) { 230 return false; 231 } 232 } 233 234 // If we made it this far, objects 235 // are considered equivalent 236 return true; 237} 238 239 240var setHref=function(data) { 241 var frm = $('<form method="get" action="' + data.reload + '" />'); 242 if (data.reloaditems) { 243 $.each(data.reloaditems, function(i, val) { 244 frm.append('<input type="hidden" name="'+ val.key +'" value="'+ val.value +'" />') 245 }); 246 } 247 $('#container').append(frm); 248 frm.submit(); 249} 250 251 252function imposeMaxLength(comp, MaxLen) { 253 var left = parseInt(MaxLen) - comp.value.length; 254 $(comp).parent().find('.addit').html(_translate("REMAINING") + ': <strong><b>' + left + '<\/strong>'); 255 return (comp.value.length <= MaxLen); 256} 257 258function readableFileSize(size) { 259 var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; 260 var i = 0; 261 while(size >= 1024) { 262 size /= 1024; 263 ++i; 264 } 265 return size.toFixed(1) + ' ' + units[i]; 266} 267 268function TimerFormat(secs) { 269 var sec_num = parseInt(secs, 10); 270 if (sec_num<=0) 271 return '00:00:00'; 272 var hours = Math.floor(sec_num / 3600); 273 var minutes = Math.floor((sec_num - (hours * 3600)) / 60); 274 var seconds = sec_num - (hours * 3600) - (minutes * 60); 275 276 if (hours < 10) {hours = "0"+hours;} 277 if (minutes < 10) {minutes = "0"+minutes;} 278 if (seconds < 10) {seconds = "0"+seconds;} 279 var time = hours+':'+minutes+':'+seconds; 280 return time; 281} 282 283 284 285// checkbox 286(function(e){e.fn.checkbox=function(){e(this).css({position:"absolute",left:"-9999px"}).each(function(){var t=e(this);if(t.next("span.checkbox").length<1){var n=e('<span class="checkbox" style="display:inline-block"></span>');t.after(n);if(t.is(":checked"))n.addClass("checked");if(t.is(":disabled"))n.addClass("disabled");n.click(function(){if(!n.is(".disabled")){if(t.is(":checked")){t.removeAttr("checked");n.removeClass("checked")}else{t.prop("checked",true);n.addClass("checked")}t.change();return false}});t.parent("label").add('label[for="'+t.attr("id")+'"]').click(function(){n.click();return false});t.change(function(){if(t.is(":checked"))n.addClass("checked");else n.removeClass("checked")}).keydown(function(e){if(t.parent("label").length&&(e.which==13||e.which==32))n.click()}).focus(function(){if(!n.is(".disabled"))n.addClass("focused")}).blur(function(){n.removeClass("focused")});t.on("refresh",function(){if(t.is(":checked"))n.addClass("checked");else n.removeClass("checked");if(t.is(":disabled"))n.addClass("disabled");else n.removeClass("disabled")})}})}})(jQuery);
287// bxslider 288!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).is("img")&&t(this).attr("src",t(this).attr("src")+"?timestamp="+(new Date).getTime()),t(this).load(function(){setTimeout(function(){++n==s&&i()},0)})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(
288),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.delegate("a","click",q)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});
288var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){t(this).css("zIndex",50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
vendor: 2,088 bytes, lines 289-290
289// dotdotdot 290!function(t,e){function n(t,e,n){var r=t.children(),o=!1;t.empty();for(var i=0,d=r.length;d>i;i++){var l=r.eq(i);if(t.append(l),n&&t.append(n),a(t,e)){l.remove(),o=!0;break}n&&n.detach()}return o}function r(e,n,i,d,l){var s=!1,c="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",u="script";return e.contents().detach().each(function(){var f=this,h=t(f);if("undefined"==typeof f||3==f.nodeType&&0==t.trim(f.data).length)return!0;if(h.is(u))e.append(h);else{if(s)return!0;e.append(h),l&&e[e.is(c)?"after":"append"](l),a(i,d)&&(s=3==f.nodeType?o(h,n,i,d,l):r(h,n,i,d,l),s||(h.detach(),s=!0)),s||l&&l.detach()}}),s}function o(e,n,r,o,d){var c=e[0];if(!c)return!1;var f=s(c),h=-1!==f.indexOf(" ")?" ":"ã",p="letter"==o.wrap?"":h,g=f.split(p),v=-1,w=-1,b=0,y=g.length-1;for(o.fallbackToLetter&&0==b&&0==y&&(p="",g=f.split(p),y=g.length-1);y>=b&&(0!=b||0!=y);){var m=Math.floor((b+y)/2);if(m==w)break;w=m,l(c,g.slice(0,w+1).join(p)+o.ellipsis),a(r,o)?(y=w,o.fallbackToLetter&&0==b&&0==y&&(p="",g=g[0].split(p),v=-1,w=-1,b=0,y=g.length-1)):(v=w,b=w)}if(-1==v||1==g.length&&0==g[0].length){var x=e.parent();e.detach();var T=d&&d.closest(x).length?d.length:0;x.contents().length>T?c=u(x.contents().eq(-1-T),n):(c=u(x,n,!0),T||x.detach()),c&&(f=i(s(c),o),l(c,f),T&&d&&t(c).parent().append(d))}else f=i(g.slice(0,v+1).join(p),o),l(c,f);return!0}function a(t,e){return t.innerHeight()>e.maxHeight}function i(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;)e=e.slice(0,-1);return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e}function d(t){return{width:t.innerWidth(),height:t.innerHeight()}}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e)}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:""}function c(t){do t=t.previousSibling;while(t&&1!==t.nodeType&&3!==t.nodeType);return t}function u(e,n,r){var o,a=e&&e[0];if(a){if(!r){if(3===a.nodeType)return a;
290if(t.trim(e.text()))return u(e.contents().last(),n)}for(o=c(a);!o;){if(e=e.parent(),e.is(n)||!e.length)return!1;o=c(e[0])}if(o)return u(t(o),n)}return!1}function f(e,n){return e?"string"==typeof e?(e=t(e,n),e.length?e:!1):e.jquery?e:!1:!1}function h(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,o=n.length;o>r;r++){var a=parseInt(t.css(n[r]),10);isNaN(a)&&(a=0),e-=a}return e}if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0==this.length)return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){t(this).dotdotdot(e)});var o=this;o.data("dotdotdot")&&o.trigger("destroy.dot"),o.data("dotdotdot-style",o.attr("style")||""),o.css("word-wrap","break-word"),"nowrap"===o.css("white-space")&&o.css("white-space","normal"),o.bind_events=function(){return o.bind("update.dot",function(e,d){e.preventDefault(),e.stopPropagation(),l.maxHeight="number"==typeof l.height?l.height:h(o),l.maxHeight+=l.tolerance,"undefined"!=typeof d&&(("string"==typeof d||d instanceof HTMLElement)&&(d=t("<div />").append(d).contents()),d instanceof t&&(i=d)),g=o.wrapInner('<div class="dotdotdot" />').children(),g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith(" <br /> ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,u=!1;return s.afterElement&&(c=s.afterElement.clone(!0),c.show(),s.afterElement.detach()),a(g,l)&&(u="children"==l.wrap?n(g,l,c):r(g,o,g,l,c)),g.replaceWith(g.contents()),g=null,t.isFunction(l.callback)&&l.callback.call(o[0],u,i),s.isTruncated=u,u}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],s.isTruncated),s.isTruncated}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],i),i}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),o.unwatch().unbind_events().contents().detach().end().append(i).attr("style",o.data("dotdotdot-style")||"").data("dotdotdot",!1)}),o},o.unbind_events=function(){return o.unbind(".dot"),o},o.watch=function(){if(o.unwatch(),"window"==l.watch){var e=t(window),n=e.width(),r=e.height();e.bind("resize.dot"+s.dotId,function(){n==e.width()&&r==e.height()&&l.windowResizeFix||(n=e.width(),r=e.height(),u&&clearInterval(u),u=setTimeout(function(){o.trigger("update.dot")},100))})}else c=d(o),u=setInterval(function(){if(o.is(":visible")){var t=d(o);(c.width!=t.width||c.height!=t.height)&&(o.trigger("update.dot"),c=t)}},500);return o},o.unwatch=function(){return t(window).unbind("resize.dot"+s.dotId),u&&clearInterval(u),o};var i=o.contents(),l=t.extend(!0,{},t.fn.dotdotdot.defaults,e),s={},c={},u=null,g=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),s.afterElement=f(l.after,o),s.isTruncated=!1,s.dotId=p++,o.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&o.watch(),o},t.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","ã",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(){};var p=1,g=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):g.apply(this,arguments)};var v=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("<div />").text(n).html(),this.trigger("update",[n])):v.apply(this,arguments)}}}(jQuery); 291// form 292;!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(a){"use strict";function b(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(b.target).ajaxSubmit(c))}function c(b){var c=b.target,d=a(c);if(!d.is("[type=submit],[type=image]")){var e=d.closest("[type=submit]");if(0===e.length)return;c=e[0]}var f=this;if(f.clk=c,"image"==c.type)if(void 0!==b.offsetX)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if("function"==typeof a.fn.offset){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}var e={};e.fileapi=void 0!==a("<input type='file'/>").get(0).files,e.formdata=void 0!==window.FormData;var f=!!a.fn.prop;a.fn.attr2=function(){if(!f)return this.attr.apply(this,arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"==typeof a?a:this.attr.apply(this,arguments)},a.fn.ajaxSubmit=function(b){function c(c){var d,e,f=a.param(c,b.traditional).split("&"),g=f.length,h=[];for(d=0;g>d;
292d++)f[d]=f[d].replace(/\+/g," "),e=f[d].split("="),h.push([decodeURIComponent(e[0]),decodeURIComponent(e[1])]);return h}function g(d){for(var e=new FormData,f=0;f<d.length;f++)e.append(d[f].name,d[f].value);if(b.extraData){var g=c(b.extraData);for(f=0;f<g.length;f++)g[f]&&e.append(g[f][0],g[f][1])}b.data=null;var h=a.extend(!0,{},a.ajaxSettings,b,{contentType:!1,processData:!1,cache:!1,type:i||"POST"});b.uploadProgress&&(h.xhr=function(){var c=a.ajaxSettings.xhr();return c.upload&&c.upload.addEventListener("progress",function(a){var c=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(c=Math.ceil(d/e*100)),b.uploadProgress(a,d,e,c)},!1),c}),h.data=null;var j=h.beforeSend;return h.beforeSend=function(a,c){c.data=b.formData?b.formData:e,j&&j.call(this,a,c)},a.ajax(h)}function h(c){function e(a){var b=null;try{a.contentWindow&&(b=a.contentWindow.document)}catch(c){d("cannot get iframe.contentWindow document: "+c)}if(b)return b;try{b=a.contentDocument?a.contentDocument:a.document}catch(c){d("cannot get iframe.contentDocument: "+c),b=a.document}return b}function g(){function b(){try{var a=e(r).readyState;d("state = "+a),a&&"uninitialized"==a.toLowerCase()&&setTimeout(b,50)}catch(c){d("Server abort: ",c," (",c.name,")"),h(A),w&&clearTimeout(w),w=void 0}}var c=l.attr2("target"),f=l.attr2("action"),g="multipart/form-data",j=l.attr("enctype")||l.attr("encoding")||g;x.setAttribute("target",o),(!i||/post/i.test(i))&&x.setAttribute("method","POST"),f!=m.url&&x.setAttribute("action",m.url),m.skipEncodingOverride||i&&!/post/i.test(i)||l.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(w=setTimeout(function(){v=!0,h(z)},m.timeout));var k=[];try{if(m.extraData)for(var n in m.extraData)m.extraData.hasOwnProperty(n)&&(a.isPlainObject(m.extraData[n])&&m.extraData[n].hasOwnProperty("name")&&m.extraData[n].hasOwnProperty("value")?k.push(a('<input type="hidden" name="'+m.extraData[n].name+'">').val(m.extraData[n].value).appendTo(x)[0]):k.push(a('<input type="hidden" name="'+n+'">').val(m.extraData[n]).appendTo(x)[0]));m.iframeTarget||q.appendTo("body"),r.attachEvent?r.attachEvent("onload",h):r.addEventListener("load",h,!1),setTimeout(b,15);try{x.submit()}catch(p){var s=document.createElement("form").submit;s.apply(x)}}finally{x.setAttribute("action",f),x.setAttribute("enctype",j),c?x.setAttribute("target",c):l.removeAttr("target"),a(k).remove()}}function h(b){if(!s.aborted&&!F){if(E=e(r),E||(d("cannot access response document"),b=A),b===z&&s)return s.abort("timeout"),y.reject(s,"timeout"),void 0;if(b==A&&s)return s.abort("server abort"),y.reject(s,"error","server abort"),void 0;if(E&&E.location.href!=m.iframeSrc||v){r.detachEvent?r.detachEvent("onload",h):r.removeEventListener("load",h,!1);var c,f="success";try{if(v)throw"timeout";var g="xml"==m.dataType||E.XMLDocument||a.isXMLDoc(E);if(d("isXml="+g),!g&&window.opera&&(null===E.body||!E.body.innerHTML)&&--G)return d("requeing onLoad callback, DOM not available"),setTimeout(h,250),void 0;var i=E.body?E.body:E.documentElement;s.responseText=i?i.innerHTML:null,s.responseXML=E.XMLDocument?E.XMLDocument:E,g&&(m.dataType="xml"),s.getResponseHeader=function(a){var b={"content-type":m.dataType};return b[a.toLowerCase()]},i&&(s.status=Number(i.getAttribute("status"))||s.status,s.statusText=i.getAttribute("statusText")||s.statusText);var j=(m.dataType||"").toLowerCase(),k=/(json|script|text)/.test(j);if(k||m.textarea){var l=E.getElementsByTagName("textarea")[0];if(l)s.responseText=l.value,s.status=Number(l.getAttribute("status"))||s.status,s.statusText=l.getAttribute("statusText")||s.statusText;else if(k){var o=E.getElementsByTagName("pre")[0],p=E.getElementsByTagName("body")[0];o?s.responseText=o.textContent?o.textContent:o.innerText:p&&(s.responseText=p.textContent?p.textContent:p.innerText)}}else"xml"==j&&!s.responseXML&&s.responseText&&(s.responseXML=H(s.responseText));try{D=J(s,j,m)}catch(t){f="parsererror",s.error=c=t||f}}catch(t){d("error caught: ",t),f="error",s.error=c=t||f}s.aborted&&(d("upload aborted"),f=null),s.status&&(f=s.status>=200&&s.status<300||304===s.status?"success":"error"),"success"===f?(m.success&&m.success.call(m.context,D,"success",s),y.resolve(s.responseText,"success",s),n&&a.event.trigger("ajaxSuccess",[s,m])):f&&(void 0===c&&(c=s.statusText),m.error&&m.error.call(m.context,s,f,c),y.reject(s,"error",c),n&&a.event.trigger("ajaxError",[s,m,c])),n&&a.event.trigger("ajaxComplete",[s,m]),n&&!--a.active&&a.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,s,f),F=!0,m.timeout&&clearTimeout(w),setTimeout(function(){m.iframeTarget?q.attr("src",m.iframeSrc):q.remove(),s.responseXML=null},100)}}}var j,k,m,n,o,q,r,s,t,u,v,w,x=l[0],y=a.Deferred();if(y.abort=function(a){s.abort(a)},c)for(k=0;k<p.length;k++)j=a(p[k]),f?j.prop("disabled",!1):j.removeAttr("disabled");if(m=a.extend(!0,{},a.ajaxSettings,b),m.context=m.context||m,o="jqFormIO"+(new Date).getTime(),m.iframeTarget?(q=a(m.iframeTarget),u=q.attr2("name"),u?o=u:q.attr2("name",o)):(q=a('<iframe name="'+o+'" src="'+m.iframeSrc+'" />'),q.css({position:"absolute",top:"-1000px",left:"-1000px"})),r=q[0],s={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c),this.aborted=1;try{r.contentWindow.document.execCommand&&r.contentWindow.document.execCommand("Stop")}catch(e){}q.attr("src",m.iframeSrc),s.error=c,m.error&&m.error.call(m.context,s,c,b),n&&a.event.trigger("ajaxError",[s,m,c]),m.complete&&m.complete.call(m.context,s,c)}},n=m.global,n&&0===a.active++&&a.event.trigger("ajaxStart"),n&&a.event.trigger("ajaxSend",[s,m]),m.beforeSend&&m.beforeSend.c
292all(m.context,s,m)===!1)return m.global&&a.active--,y.reject(),y;if(s.aborted)return y.reject(),y;t=x.clk,t&&(u=t.name,u&&!t.disabled&&(m.extraData=m.extraData||{},m.extraData[u]=t.value,"image"==t.type&&(m.extraData[u+".x"]=x.clk_x,m.extraData[u+".y"]=x.clk_y)));var z=1,A=2,B=a("meta[name=csrf-token]").attr("content"),C=a("meta[name=csrf-param]").attr("content");C&&B&&(m.extraData=m.extraData||{},m.extraData[C]=B),m.forceSync?g():setTimeout(g,10);var D,E,F,G=50,H=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!=b.documentElement.nodeName?b:null},I=a.parseJSON||function(a){return window.eval("("+a+")")},J=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f="xml"===c||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&("json"===c||!c&&e.indexOf("json")>=0?g=I(g):("script"===c||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g};return y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var i,j,k,l=this;"function"==typeof b?b={success:b}:void 0===b&&(b={}),i=b.type||this.attr2("method"),j=b.url||this.attr2("action"),k="string"==typeof j?a.trim(j):"",k=k||window.location.href||"",k&&(k=(k.match(/^([^#]+)/)||[])[1]),b=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:i||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);var m={};if(this.trigger("form-pre-serialize",[this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&b.beforeSerialize(this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n=b.traditional;void 0===n&&(n=a.ajaxSettings.traditional);var o,p=[],q=this.formToArray(b.semantic,p);if(b.data&&(b.extraData=b.data,o=a.param(b.data,n)),b.beforeSubmit&&b.beforeSubmit(q,this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[q,this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var r=a.param(q,n);o&&(r=r?r+"&"+o:o),"GET"==b.type.toUpperCase()?(b.url+=(b.url.indexOf("?")>=0?"&":"?")+r,b.data=null):b.data=r;var s=[];if(b.resetForm&&s.push(function(){l.resetForm()}),b.clearForm&&s.push(function(){l.clearForm(b.includeHidden)}),!b.dataType&&b.target){var t=b.success||function(){};s.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(t,arguments)})}else b.success&&s.push(b.success);if(b.success=function(a,c,d){for(var e=b.context||this,f=0,g=s.length;g>f;f++)s[f].apply(e,[a,c,d||l,l])},b.error){var u=b.error;b.error=function(a,c,d){var e=b.context||this;u.apply(e,[a,c,d,l])}}if(b.complete){var v=b.complete;b.complete=function(a,c){var d=b.context||this;v.apply(d,[a,c,l])}}var w=a("input[type=file]:enabled",this).filter(function(){return""!==a(this).val()}),x=w.length>0,y="multipart/form-data",z=l.attr("enctype")==y||l.attr("encoding")==y,A=e.fileapi&&e.formdata;d("fileAPI :"+A);var B,C=(x||z)&&!A;b.iframe!==!1&&(b.iframe||C)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){B=h(q)}):B=h(q):B=(x||z)&&A?g(q):a.ajax(b),l.removeData("jqxhr").data("jqxhr",B);for(var D=0;D<p.length;D++)p[D]=null;return this.trigger("form-submit-notify",[this,b]),this},a.fn.ajaxForm=function(e){if(e=e||{},e.delegation=e.delegation&&a.isFunction(a.fn.on),!e.delegation&&0===this.length){var f={s:this.selector,c:this.context};return!a.isReady&&f.s?(d("DOM not ready, queuing ajaxForm"),a(function(){a(f.s,f.c).ajaxForm(e)}),this):(d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return e.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,e,b).on("click.form-plugin",this.selector,e,c),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,b).bind("click.form-plugin",e,c)},a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(b,c){var d=[];if(0===this.length)return d;var f,g=this[0],h=this.attr("id"),i=b?g.getElementsByTagName("*"):g.elements;if(i&&!/MSIE 8/.test(navigator.userAgent)&&(i=a(i).get()),h&&(f=a(":input[form="+h+"]").get(),f.length&&(i=(i||[]).concat(f))),!i||!i.length)return d;var j,k,l,m,n,o,p;for(j=0,o=i.length;o>j;j++)if(n=i[j],l=n.name,l&&!n.disabled)if(b&&g.clk&&"image"==n.type)g.clk==n&&(d.push({name:l,value:a(n).val(),type:n.type}),d.push({name:l+".x",value:g.clk_x},{name:l+".y",value:g.clk_y}));else if(m=a.fieldValue(n,!0),m&&m.constructor==Array)for(c&&c.push(n),k=0,p=m.length;p>k;k++)d.push({name:l,value:m[k]});else if(e.fileapi&&"file"==n.type){c&&c.push(n);var q=n.files;if(q.length)for(k=0;k<q.length;k++)d.push({name:l,value:q[k],type:n.type});else d.push({name:l,value:"",type:n.type})}else null!==m&&"undefined"!=typeof m&&(c&&c.push(n),d.push({name:l,value:m,type:n.type,required:n.required}));if(!b&&g.clk){var r=a(g.clk),s=r[0];l=s.name,l&&!s.disabled&&"image"==s.type&&(d.push({name:l,value:r.val()}),d.push({name:l+".x",value:g.clk_x},{name:l+".y",value:g.clk_y}))}return d}
292,a.fn.formSerialize=function(b){return a.param(this.formToArray(b))},a.fn.fieldSerialize=function(b){var c=[];return this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var f=0,g=e.length;g>f;f++)c.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;e>d;d++){var f=this[d],g=a.fieldValue(f,b);null===g||"undefined"==typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(void 0===c&&(c=!0),c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var g=b.selectedIndex;if(0>g)return null;for(var h=[],i=b.options,j="select-one"==e,k=j?g+1:i.length,l=j?g:0;k>l;l++){var m=i[l];if(m.selected){var n=m.value;if(n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||"textarea"==e?this.value="":"checkbox"==d||"radio"==d?this.checked=!1:"select"==e?this.selectedIndex=-1:"file"==d?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val(""):b&&(b===!0&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b))&&(this.value="")})},a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return void 0===a&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return void 0===b&&(b=!0),this.each(function(){var c=this.type;if("checkbox"==c||"radio"==c)this.checked=b;else if("option"==this.tagName.toLowerCase()){var d=a(this).parent("select");b&&d[0]&&"select-one"==d[0].type&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1}); 293// tz 294// /*! jstz - v1.0.4 - 2012-12-18 */ 295(function(e){var t=function(){"use strict";var e="s",n=function(e){var t=-e.getTimezoneOffset();return t!==null?t:0},r=function(e,t,n){var r=new Date;return e!==undefined&&r.setFullYear(e),r.setDate(n),r.setMonth(t),r},i=function(e){return n(r(e,0,2))},s=function(e){return n(r(e,5,2))},o=function(e){var t=e.getMonth()>7?s(e.getFullYear()):i(e.getFullYear()),r=n(e);return t-r!==0},u=function(){var t=i(),n=s(),r=i()-s();return r<0?t+",1":r>0?n+",1,"+e:t+",0"},a=function(){var e=u();return new t.TimeZone(t.olson.timezones[e])},f=function(e){var t=new Date(2010,6,15,1,0,0,0),n={"America/Denver":new Date(2011,2,13,3,0,0,0),"America/Mazatlan":new Date(2011,3,3,3,0,0,0),"America/Chicago":new Date(2011,2,13,3,0,0,0),"America/Mexico_City":new Date(2011,3,3,3,0,0,0),"America/Asuncion":new Date(2012,9,7,3,0,0,0),"America/Santiago":new Date(2012,9,3,3,0,0,0),"America/Campo_Grande":new Date(2012,9,21,5,0,0,0),"America/Montevideo":new Date(2011,9,2,3,0,0,0),"America/Sao_Paulo":new Date(2011,9,16,5,0,0,0),"America/Los_Angeles":new Date(2011,2,13,8,0,0,0),"America/Santa_Isabel":new Date(2011,3,5,8,0,0,0),"America/Havana":new Date(2012,2,10,2,0,0,0),"America/New_York":new Date(2012,2,10,7,0,0,0),"Asia/Beirut":new Date(2011,2,27,1,0,0,0),"Europe/Helsinki":new Date(2011,2,27,4,0,0,0),"Europe/Istanbul":new Date(2011,2,28,5,0,0,0),"Asia/Damascus":new Date(2011,3,1,2,0,0,0),"Asia/Jerusalem":new Date(2011,3,1,6,0,0,0),"Asia/Gaza":new Date(2009,2,28,0,30,0,0),"Africa/Cairo":new Date(2009,3,25,0,30,0,0),"Pacific/Auckland":new Date(2011,8,26,7,0,0,0),"Pacific/Fiji":new Date(2010,11,29,23,0,0,0),"America/Halifax":new Date(2011,2,13,6,0,0,0),"America/Goose_Bay":new Date(2011,2,13,2,1,0,0),"America/Miquelon":new Date(2011,2,13,5,0,0,0),"America/Godthab":new Date(2011,2,27,1,0,0,0),"Europe/Moscow":t,"Asia/Yekaterinburg":t,"Asia/Omsk":t,"Asia/Krasnoyarsk":t,"Asia/Irkutsk":t,"Asia/Yakutsk":t,"Asia/Vladivostok":t,"Asia/Kamchatka":t,"Europe/Minsk":t,"Australia/Perth":new Date(2008,10,1,1,0,0,0)};return n[e]};return{determine:a,date_is_dst:o,dst_start_for:f}}();t.TimeZone=function(e){"use strict";var n={"America/Denver":["America/Denver","America/Mazatlan"],"America/Chicago":["America/Chicago","America/Mexico_City"],"America/Santiago":["America/Santiago","America/Asuncion","America/Campo_Grande"],"America/Montevideo":["America/Montevideo","America/Sao_Paulo"],"Asia/Beirut":["Asia/Beirut","Europe/Helsinki","Europe/Istanbul","Asia/Damascus","Asia/Jerusalem","Asia/Gaza"],"Pacific/Auckland":["Pacific/Auckland","Pacific/Fiji"],"America/Los_Angeles":["America/Los_Angeles","America/Santa_Isabel"],"America/Ne
295w_York":["America/Havana","America/New_York"],"America/Halifax":["America/Goose_Bay","America/Halifax"],"America/Godthab":["America/Miquelon","America/Godthab"],"Asia/Dubai":["Europe/Moscow"],"Asia/Dhaka":["Asia/Yekaterinburg"],"Asia/Jakarta":["Asia/Omsk"],"Asia/Shanghai":["Asia/Krasnoyarsk","Australia/Perth"],"Asia/Tokyo":["Asia/Irkutsk"],"Australia/Brisbane":["Asia/Yakutsk"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Tarawa":["Asia/Kamchatka"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"],"Asia/Baghdad":["Europe/Minsk"]},r=e,i=function(){var e=n[r],i=e.length,s=0,o=e[0];for(;s<i;s+=1){o=e[s];if(t.date_is_dst(t.dst_start_for(o))){r=o;return}}},s=function(){return typeof n[r]!="undefined"};return s()&&i(),{name:function(){return r}}},t.olson={},t.olson.timezones={"-720,0":"Etc/GMT+12","-660,0":"Pacific/Pago_Pago","-600,1":"America/Adak","-600,0":"Pacific/Honolulu","-570,0":"Pacific/Marquesas","-540,0":"Pacific/Gambier","-540,1":"America/Anchorage","-480,1":"America/Los_Angeles","-480,0":"Pacific/Pitcairn","-420,0":"America/Phoenix","-420,1":"America/Denver","-360,0":"America/Guatemala","-360,1":"America/Chicago","-360,1,s":"Pacific/Easter","-300,0":"America/Bogota","-300,1":"America/New_York","-270,0":"America/Caracas","-240,1":"America/Halifax","-240,0":"America/Santo_Domingo","-240,1,s":"America/Santiago","-210,1":"America/St_Johns","-180,1":"America/Godthab","-180,0":"America/Argentina/Buenos_Aires","-180,1,s":"America/Montevideo","-120,0":"Etc/GMT+2","-120,1":"Etc/GMT+2","-60,1":"Atlantic/Azores","-60,0":"Atlantic/Cape_Verde","0,0":"Etc/UTC","0,1":"Europe/London","60,1":"Europe/Berlin","60,0":"Africa/Lagos","60,1,s":"Africa/Windhoek","120,1":"Asia/Beirut","120,0":"Africa/Johannesburg","180,0":"Asia/Baghdad","180,1":"Europe/Moscow","210,1":"Asia/Tehran","240,0":"Asia/Dubai","240,1":"Asia/Baku","270,0":"Asia/Kabul","300,1":"Asia/Yekaterinburg","300,0":"Asia/Karachi","330,0":"Asia/Kolkata","345,0":"Asia/Kathmandu","360,0":"Asia/Dhaka","360,1":"Asia/Omsk","390,0":"Asia/Rangoon","420,1":"Asia/Krasnoyarsk","420,0":"Asia/Jakarta","480,0":"Asia/Shanghai","480,1":"Asia/Irkutsk","525,0":"Australia/Eucla","525,1,s":"Australia/Eucla","540,1":"Asia/Yakutsk","540,0":"Asia/Tokyo","570,0":"Australia/Darwin","570,1,s":"Australia/Adelaide","600,0":"Australia/Brisbane","600,1":"Asia/Vladivostok","600,1,s":"Australia/Sydney","630,1,s":"Australia/Lord_Howe","660,1":"Asia/Kamchatka","660,0":"Pacific/Noumea","690,0":"Pacific/Norfolk","720,1,s":"Pacific/Auckland","720,0":"Pacific/Tarawa","765,1,s":"Pacific/Chatham","780,0":"Pacific/Tongatapu","780,1,s":"Pacific/Apia","840,0":"Pacific/Kiritimati"},typeof exports!="undefined"?exports.jstz=t:e.jstz=t})(this); 296 297/*! 298 * clipboard.js v1.5.12 299 * https://zenorocha.github.io/clipboard.js 300 * 301 * Licensed MIT © Zeno Rocha 302 */ 303!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var o=t("matches-selector");e.exports=function(t,e,n){for(var i=n?t:t.parentNode;i&&i!==document;){if(o(i,e))return i;i=i.parentNode}}},{"matches-selector":5}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e,!0),n.delegateTarget&&o.call(t,n)}}var r=t("closest");e.exports=o},{closest:1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return s(document.body,t,e,n)}var c=t("./is"),s=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t,e){if(r)return r.call(t,e);for(var n=t.parentNode.querySelectorAll(e),o=0;o<n.length;++o)if(n[o]==t)return!0;return!1}var i=Element.prototype,r=i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;e.exports=o},{}],6:[function(t,e,n){function o(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.focus(),t.setSelectionRange(0,t.value.length),e=t.value;
303else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}e.exports=o},{}],7:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;i>o;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;a>r;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if("undefined"!=typeof o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=e.action,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""},t.prototype.initSelection=function t(){this.text?this.selectFake():this.target&&this.selectTarget()},t.prototype.selectFake=function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()},t.prototype.removeFake=function t(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function t(){this.selectedText=(0,i.default)(this.target),this.copyText()},t.prototype.copyText=function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(n){e=!1}this.handleResult(e)},t.prototype.handleResult=function t(e){e?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function t(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function t(){this.removeFake()},a(t,[{key:"action",set:function t(){var e=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==("undefined"==typeof e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:6}],9:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),u=i(n),f=i(o),d=function(t){function e(n,o){r(this,e);var i=a(this,t.call(this));return i.resolveOptions(o),i.listenClick(n),i}return c(e,t),e.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText},e.prototype.listenClick=function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})},e.prototype.onClick=function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})},e.prototype.defaultAction=function t(e){return s("action",e)},e.prototype.defaultTarget=function t(e){var n=s("target",e);return n?document.querySelector(n):void 0},e.prototype.defaultText=function t(e){return s("text",e)},e.prototype.destroy=function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(u.default);t.exports=d})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)}); 304 305// blockUI 306;(function() { 307/*jshint eqeqeq:false curly:false latedef:false */ 308"use strict"; 309 310 function setup($) { 311 $.fn._fadeIn = $.fn.fadeIn; 312 313 var noOp = $.noop || function() {}; 314 315 // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle 316 // confusing userAgent strings on Vista) 317 var msie = /MSIE/.test(navigator.userAgent); 318 var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); 319 var mode = document.documentMode || 0; 320 var setExpr = $.isFunction( document.createElement('div').style.setExpression ); 321 322 // global $ methods for blocking/unblocking the entire page 323 $.blockUI = function(opts) { install(window, opts); }; 324 $.unblockUI = function(opts) { remove(window, opts); }; 325 326 // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) 327 $.growlUI = function(title, message, timeout, onClose) { 328 var $m = $('<div class="growlUI"></div>'); 329 if (title) $m.append('<h1>'+title+'</h1>'); 330 if (message) $m.append('<h2>'+message+'</h2>'); 331 if (timeout === undefined) timeout = 3000; 332
vendor: 13,945 bytes, lines 333-724
333 // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications 334 var callBlock = function(opts) { 335 opts = opts || {}; 336 337 $.blockUI({ 338 message: $m, 339 fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700, 340 fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000, 341 timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout, 342 centerY: false, 343 showOverlay: false, 344 onUnblock: onClose, 345 css: $.blockUI.defaults.growlCSS 346 }); 347 }; 348 349 callBlock(); 350 var nonmousedOpacity = $m.css('opacity'); 351 $m.mouseover(function() { 352 callBlock({ 353 fadeIn: 0, 354 timeout: 30000 355 }); 356 357 var displayBlock = $('.blockMsg'); 358 displayBlock.stop(); // cancel fadeout if it has started 359 displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency 360 }).mouseout(function() { 361 $('.blockMsg').fadeOut(1000); 362 }); 363 // End konapun additions 364 }; 365 366 // plugin method for blocking element content 367 $.fn.block = function(opts) { 368 if ( this[0] === window ) { 369 $.blockUI( opts ); 370 return this; 371 } 372 var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); 373 this.each(function() { 374 var $el = $(this); 375 if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) 376 return; 377 $el.unblock({ fadeOut: 0 }); 378 }); 379 380 return this.each(function() { 381 if ($.css(this,'position') == 'static') { 382 this.style.position = 'relative'; 383 $(this).data('blockUI.static', true); 384 } 385 this.style.zoom = 1; // force 'hasLayout' in ie 386 install(this, opts); 387 }); 388 }; 389 390 // plugin method for unblocking element content 391 $.fn.unblock = function(opts) { 392 if ( this[0] === window ) { 393 $.unblockUI( opts ); 394 return this; 395 } 396 return this.each(function() { 397 remove(this, opts); 398 }); 399 }; 400 401 $.blockUI.version = 2.66; // 2nd generation blocking at no extra cost! 402 403 // override these in your code to change the default behavior and style 404 $.blockUI.defaults = { 405 // message displayed when blocking (use null for no message) 406 message: '<img src="imgs/loading.gif" />', 407 408 title: null, // title string; only used when theme == true 409 draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) 410 411 theme: false, // set to true to use with jQuery UI themes 412 413 // styles for the message when blocking; if you wish to disable 414 // these and use an external stylesheet then do this in your code: 415 // $.blockUI.defaults.css = {}; 416 css: { 417 padding: 0, 418 margin: 0, 419 left: '50%', 420 textAlign: 'center', 421 color: '#fff', 422 backgroundColor:'transparent', 423 cursor: 'wait', 424 marginLeft: '-16px', 425 marginTop: '-16px' 426 }, 427 428 // minimal style set used when themes are used 429 themedCSS: { 430 width: '30%', 431 top: '40%', 432 left: '35%' 433 }, 434 435 // styles for the overlay 436 overlayCSS: { 437 backgroundColor: '#000', 438 opacity: 0.3, 439 cursor: 'wait' 440 }, 441 442 // style to replace wait cursor before unblocking to correct issue 443 // of lingering wait cursor 444 cursorReset: 'default', 445 446 447 448 // styles applied when using $.growlUI 449 growlCSS: { 450 width: '350px', 451 top: '70px', 452 left: '', 453 right: '10px', 454 border: '1px solid #a5ce39', 455 padding: '5px', 456 opacity: 1, 457 cursor: 'default', 458 color: '#fff', 459 backgroundColor: '#a5ce39', 460 background :'rgba(128, 176, 1, 0.7)', 461 '-webkit-border-radius':'10px', 462 '-moz-border-radius': '10px', 463 'border-radius': '10px' 464 }, 465 466 // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w 467 // (hat tip to Jorge H. N. de Vasconcelos) 468 /*jshint scripturl:true */ 469 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', 470 471 // force usage of iframe in non-IE browsers (handy for blocking applets) 472 forceIframe: false, 473 474 // z-index for the blocking overlay 475 baseZ: 1000, 476 477 // set these to true to have the message automatically centered 478 centerX: true, // <-- only effects element blocking (page block controlled via css above) 479 centerY: true, 480 481 // allow body element to be stetched in ie6; this makes blocking look better 482 // on "short" pages. disable if you wish to prevent changes to the body height 483 allowBodyStretch: true, 484 485 // enable if you want key and mouse events to be disabled for content that is blocked 486 bindEvents: true, 487 488 // be default blockUI will supress tab navigation from leaving blocking content 489 // (if bindEvents is true) 490 constrainTabKey: true, 491 492 // fadeIn time in millis; set to 0 to disable fadeIn on block 493 fadeIn: 200, 494 495 // fadeOut time in millis; set to 0 to disable fadeOut on unblock 496 fadeOut: 400, 497 498 // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock 499 timeout: 0, 500 501 // disable if you don't want to show the overlay 502 showOverlay: true, 503 504 // if true, focus will be placed in the first available input field when 505 // page blocking 506 focusInput: true, 507 508 // elements that can receive focus 509 focusableElements: ':input:enabled:visible', 510 511 // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) 512 // no longer needed in 2012 513 // applyPlatformOpacityRules: true, 514 515 // callback method invoked when fadeIn has completed and blocking message is visible 516 onBlock: null, 517 518 // callback method invoked when unblocking has completed; the callback is 519 // passed the element that has been unblocked (which is the window object for page 520 // blocks) and the options that were passed to the unblock call: 521 // onUnblock(element, options) 522 onUnblock: null, 523 524 // callback method invoked when the overlay area is clicked. 525 // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used. 526 onOverlayClick: null, 527 528 // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 529 quirksmodeOffsetHack: 4, 530 531 // class name of the message block 532 blockMsgClass: 'blockMsg', 533 534 // if it is already blocked, then ignore it (don't unblock and reblock) 535 ignoreIfBlocked: false 536 }; 537 538 // private data and functions follow... 539 540 var pageBlock = null; 541 var pageBlockEls = []; 542 543 function install(el, opts) { 544 var css, themedCSS; 545 var full = (el == window); 546 var msg = (opts && opts.message !== undefined ? opts.message : undefined); 547 opts = $.extend({}, $.blockUI.defaults, opts || {}); 548 549 if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) 550 return; 551 552 opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); 553 css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); 554 if (opts.onOverlayClick) 555 opts.overlayCSS.cursor = 'pointer'; 556 557 themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); 558 msg = msg === undefined ? opts.message : msg; 559 560 // remove the current block (if there is one) 561 if (full && pageBlock) 562 remove(window, {fadeOut:0}); 563 564 // if an existing element is being used as the blocking content then we capture 565 // its current place in the DOM (and current display style) so we can restore 566 // it when we unblock 567 if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { 568 var node = msg.jquery ? msg[0] : msg; 569 var data = {}; 570 $(el).data('blockUI.history', data); 571 data.el = node; 572 data.parent = node.parentNode; 573 data.display = node.style.display; 574 data.position = node.style.position; 575 if (data.parent) 576 data.parent.removeChild(node); 577 } 578 579 $(el).data('blockUI.onUnblock', opts.onUnblock); 580 var z = opts.baseZ; 581 582 // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; 583 // layer1 is the iframe layer which is used to supress bleed through of underlying content 584 // layer2 is the overlay layer which has opacity and a wait cursor (by default) 585 // layer3 is the message content that is displayed while blocking 586 var lyr1, lyr2, lyr3, s; 587 if (msie || opts.forceIframe) 588 lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'); 589 else 590 lyr1 = $('<div class="blockUI" style="display:none"></div>'); 591 592 if (opts.theme) 593 lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>'); 594 else 595 lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); 596 597 if (opts.theme && full) { 598 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">'; 599 if ( opts.title ) { 600 s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>'; 601 } 602 s += '<div class="ui-widget-content ui-dialog-content"></div>'; 603 s += '</div>'; 604 } 605 else if (opts.theme) { 606 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">'; 607 if ( opts.title ) { 608 s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>'; 609 } 610 s += '<div class="ui-widget-content ui-dialog-content"></div>'; 611 s += '</div>'; 612 } 613 else if (full) { 614 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>'; 615 } 616 else { 617 s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>'; 618 } 619 lyr3 = $(s); 620 621 // if we have a message, style it 622 if (msg) { 623 if (opts.theme) { 624 lyr3.css(themedCSS); 625 lyr3.addClass('ui-widget-content'); 626 } 627 else 628 lyr3.css(css); 629 } 630 631 // style the overlay 632 if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/) 633 lyr2.css(opts.overlayCSS); 634 lyr2.css('position', full ? 'fixed' : 'absolute'); 635 636 // make iframe layer transparent in IE 637 if (msie || opts.forceIframe) 638 lyr1.css('opacity',0.0); 639 640 //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); 641 var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); 642 $.each(layers, function() { 643 this.appendTo($par); 644 }); 645 646 if (opts.theme && opts.draggable && $.fn.draggable) { 647 lyr3.draggable({ 648 handle: '.ui-dialog-titlebar', 649 cancel: 'li' 650 }); 651 } 652 653 // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) 654 var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); 655 if (ie6 || expr) { 656 // give body 100% height 657 if (full && opts.allowBodyStretch && $.support.boxModel) 658 $('html,body').css('height','100%'); 659 660 // fix ie6 issue when blocked element has a border width 661 if ((ie6 || !$.support.boxModel) && !full) { 662 var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); 663 var fixT = t ? '(0 - '+t+')' : 0; 664 var fixL = l ? '(0 - '+l+')' : 0; 665 } 666 667 // simulate fixed position 668 $.each(layers, function(i,o) { 669 var s = o[0].style; 670 s.position = 'absolute'; 671 if (i < 2) { 672 if (full) 673 s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); 674 else 675 s.setExpression('height','this.parentNode.offsetHeight + "px"'); 676 if (full) 677 s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'); 678 else 679 s.setExpression('width','this.parentNode.offsetWidth + "px"'); 680 if (fixL) s.setExpression('left', fixL); 681 if (fixT) s.setExpression('top', fixT); 682 } 683 else if (opts.centerY) { 684 if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); 685 s.marginTop = 0; 686 } 687 else if (!opts.centerY && full) { 688 var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0; 689 var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; 690 s.setExpression('top',expression); 691 } 692 }); 693 } 694 695 // show the message 696 if (msg) { 697 if (opts.theme) 698 lyr3.find('.ui-widget-content').append(msg); 699 else 700 lyr3.append(msg); 701 if (msg.jquery || msg.nodeType) 702 $(msg).show(); 703 } 704 705 if ((msie || opts.forceIframe) && opts.showOverlay) 706 lyr1.show(); // opacity is zero 707 if (opts.fadeIn) { 708 var cb = opts.onBlock ? opts.onBlock : noOp; 709 var cb1 = (opts.showOverlay && !msg) ? cb : noOp; 710 var cb2 = msg ? cb : noOp; 711 if (opts.showOverlay) 712 lyr2._fadeIn(opts.fadeIn, cb1); 713 if (msg) 714 lyr3._fadeIn(opts.fadeIn, cb2); 715 } 716 else { 717 if (opts.showOverlay) 718 lyr2.show(); 719 if (msg) 720 lyr3.show(); 721 if (opts.onBlock) 722 opts.onBlock(); 723 } 724
vendor: 5,142 bytes, lines 725-907
725 // bind key and mouse events 726 bind(1, el, opts); 727 728 if (full) { 729 pageBlock = lyr3[0]; 730 pageBlockEls = $(opts.focusableElements,pageBlock); 731 if (opts.focusInput) 732 setTimeout(focus, 20); 733 } 734 else 735 center(lyr3[0], opts.centerX, opts.centerY); 736 737 if (opts.timeout) { 738 // auto-unblock 739 var to = setTimeout(function() { 740 if (full) 741 $.unblockUI(opts); 742 else 743 $(el).unblock(opts); 744 }, opts.timeout); 745 $(el).data('blockUI.timeout', to); 746 } 747 } 748 749 // remove the block 750 function remove(el, opts) { 751 var count; 752 var full = (el == window); 753 var $el = $(el); 754 var data = $el.data('blockUI.history'); 755 var to = $el.data('blockUI.timeout'); 756 if (to) { 757 clearTimeout(to); 758 $el.removeData('blockUI.timeout'); 759 } 760 opts = $.extend({}, $.blockUI.defaults, opts || {}); 761 bind(0, el, opts); // unbind events 762 763 if (opts.onUnblock === null) { 764 opts.onUnblock = $el.data('blockUI.onUnblock'); 765 $el.removeData('blockUI.onUnblock'); 766 } 767 768 var els; 769 if (full) // crazy selector to handle odd field errors in ie6/7 770 els = $('body').children().filter('.blockUI').add('body > .blockUI'); 771 else 772 els = $el.find('>.blockUI'); 773 774 // fix cursor issue 775 if ( opts.cursorReset ) { 776 if ( els.length > 1 ) 777 els[1].style.cursor = opts.cursorReset; 778 if ( els.length > 2 ) 779 els[2].style.cursor = opts.cursorReset; 780 } 781 782 if (full) 783 pageBlock = pageBlockEls = null; 784 785 if (opts.fadeOut) { 786 count = els.length; 787 els.stop().fadeOut(opts.fadeOut, function() { 788 if ( --count === 0) 789 reset(els,data,opts,el); 790 }); 791 } 792 else 793 reset(els, data, opts, el); 794 } 795 796 // move blocking element back into the DOM where it started 797 function reset(els,data,opts,el) { 798 var $el = $(el); 799 if ( $el.data('blockUI.isBlocked') ) 800 return; 801 802 els.each(function(i,o) { 803 // remove via DOM calls so we don't lose event handlers 804 if (this.parentNode) 805 this.parentNode.removeChild(this); 806 }); 807 808 if (data && data.el) { 809 data.el.style.display = data.display; 810 data.el.style.position = data.position; 811 if (data.parent) 812 data.parent.appendChild(data.el); 813 $el.removeData('blockUI.history'); 814 } 815 816 if ($el.data('blockUI.static')) { 817 $el.css('position', ''); // #22 818 } 819 820 if (typeof opts.onUnblock == 'function') 821 opts.onUnblock(el,opts); 822 823 // fix issue in Safari 6 where block artifacts remain until reflow 824 var body = $(document.body), w = body.width(), cssW = body[0].style.width; 825 body.width(w-1).width(w); 826 body[0].style.width = cssW; 827 } 828 829 // bind/unbind the handler 830 function bind(b, el, opts) { 831 var full = el == window, $el = $(el); 832 833 // don't bother unbinding if there is nothing to unbind 834 if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) 835 return; 836 837 $el.data('blockUI.isBlocked', b); 838 839 // don't bind events when overlay is not in use or if bindEvents is false 840 if (!full || !opts.bindEvents || (b && !opts.showOverlay)) 841 return; 842 843 // bind anchors and inputs for mouse and key events 844 var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; 845 if (b) 846 $(document).bind(events, opts, handler); 847 else 848 $(document).unbind(events, handler); 849 850 // former impl... 851 // var $e = $('a,:input'); 852 // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); 853 } 854 855 // event handler to suppress keyboard/mouse events when blocking 856 function handler(e) { 857 // allow tab navigation (conditionally) 858 if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { 859 if (pageBlock && e.data.constrainTabKey) { 860 var els = pageBlockEls; 861 var fwd = !e.shiftKey && e.target === els[els.length-1]; 862 var back = e.shiftKey && e.target === els[0]; 863 if (fwd || back) { 864 setTimeout(function(){focus(back);},10); 865 return false; 866 } 867 } 868 } 869 var opts = e.data; 870 var target = $(e.target); 871 if (target.hasClass('blockOverlay') && opts.onOverlayClick) 872 opts.onOverlayClick(e); 873 874 // allow events within the message content 875 if (target.parents('div.' + opts.blockMsgClass).length > 0) 876 return true; 877 878 // allow events for content that is not being blocked 879 return target.parents().children().filter('div.blockUI').length === 0; 880 } 881 882 function focus(back) { 883 if (!pageBlockEls) 884 return; 885 var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; 886 if (e) 887 e.focus(); 888 } 889 890 function center(el, x, y) { 891 var p = el.parentNode, s = el.style; 892 var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); 893 var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); 894 if (x) s.left = l > 0 ? (l+'px') : '0'; 895 if (y) s.top = t > 0 ? (t+'px') : '0'; 896 } 897 898 function sz(el, p) { 899 return parseInt($.css(el,p),10)||0; 900 } 901 902 } 903 904 905 /*global define:true */ 906 if (typeof define === 'function' && define.amd && define.amd.jQuery) { 907 define(['jquery'], setup);
908 } else { 909 setup(jQuery); 910 } 911 912})(); 913//watermark 914(function(n,t,i){var g="TEXTAREA",d="function",nt="password",c="maxLength",v="type",r="",u=!0,rt="placeholder",h=!1,tt="watermark",s=tt,o="watermarkClass",w="watermarkFocus",a="watermarkSubmit",b="watermarkMaxLength",e="watermarkPassword",f="watermarkText",l=/\r/g,ft=/^(button|checkbox|hidden|image|radio|range|reset|submit)$/i,it="input:data("+s+"),textarea:data("+s+")",p=":watermarkable",k=["Page_ClientValidate"],y=h,ut=rt in document.createElement("input");n.watermark=n.watermark||{version:"3.1.4",runOnce:u,options:{className:tt,useNative:u,hideBeforeUnload:u},hide:function(t){n(t).filter(it).each(function(){n.watermark._hide(n(this))})},_hide:function(n,i){var a=n[0],w=(a.value||r).replace(l,r),h=n.data(f)||r,p=n.data(b)||0,y=n.data(o),s,u;h.length&&w==h&&(a.value=r,n.data(e)&&(n.attr(v)||r)==="text"&&(s=n.data(e)||[],u=n.parent()||[],s.length&&u.length&&(u[0].removeChild(n[0]),u[0].appendChild(s[0]),n=s)),p&&(n.attr(c,p),n.removeData(b)),i&&(n.attr("autocomplete","off"),t.setTimeout(function(){n.select()},1))),y&&n.removeClass(y)},show:function(t){n(t).filter(it).each(function(){n.watermark._show(n(this))})},_show:function(t){var p=t[0],g=(p.value||r).replace(l,r),i=t.data(f)||r,k=t.attr(v)||r,d=t.data(o),h,s,a;g.length!=0&&g!=i||t.data(w)?n.watermark._hide(t):(y=u,t.data(e)&&k===nt&&(h=t.data(e)||[],s=t.parent()||[],h.length&&s.length&&(s[0].removeChild(t[0]),s[0].appendChild(h[0]),t=h,t.attr(c,i.length),p=t[0])),(k==="text"||k==="search")&&(a=t.attr(c)||0,a>0&&i.length>a&&(t.data(b,a),t.attr(c,i.length))),d&&t.addClass(d),p.value=i)},hideAll:function(){y&&(n.watermark.hide(p),y=h)},showAll:function(){n.watermark.show(p)}},n.fn.watermark=n.fn.watermark||function(i,y){var tt="string";if(!this.length)return this;var k=h,b=typeof i==tt;return b&&(i=i.replace(l,r)),typeof y=="object"?(k=typeof y.className==tt,y=n.extend({},n.watermark.options,y)):typeof y==tt?(k=u,y=n.extend({},n.watermark.options,{className:y})):y=n.watermark.options,typeof y.useNative!=d&&(y.useNative=y.useNative?function(){return u}:function(){return h}),this.each(function(){var et="dragleave",ot="dragenter",ft=this,h=n(ft),st,d,tt,it;if(h.is(p)){if(h.data(s))(b||k)&&(n.watermark._hide(h),b&&h.data(f,i),k&&h.data(o,y.className));else{if(ut&&y.useNative.call(ft,h)&&(h.attr("tagName")||r)!==g){b&&h.attr(rt,i);return}h.data(f,b?i:r),h.data(o,y.className),h.data(s,1),(h.attr(v)||r)===nt?(st=h.wrap("<span>").parent(),d=n(st.html().replace(/type=["']?password["']?/i,'type="text"')),d.data(f,h.data(f)),d.data(o,h.data(o)),d.data(s,1),d.attr(c,i.length),d.focus(function(){n.watermark._hide(d,u)}).bind(ot,function(){n.watermark._hide(d)}).bind("dragend",function(){t.setTimeout(function(){d.blur()},1)}),h.blur(function(){n.watermark._show(h)}).bind(et,function(){n.watermark._show(h)}),d.data(e,h),h.data(e,d)):h.focus(function(){h.data(w,1),n.watermark._hide(h,u)}).blur(function(){h.data(w,0),n.watermark._show(h)}).bind(ot,function(){n.watermark._hide(h)}).bind(et,function(){n.watermark._show(h)}).bind("dragend",function(){t.setTimeout(function(){n.watermark._show(h)},1)}).bind("drop",function(n){var i=h[0],t=n.originalEvent.dataTransfer.getData("Text");(i.value||r).replace(l,r).replace(t,r)===h.data(f)&&(i.value=t),h.focus()}),ft.form&&(tt=ft.form,it=n(tt),it.data(a)||(it.submit(n.watermark.hideAll),tt.submit?(it.data(a,tt.submit),tt.submit=function(t,i){return function(){var r=i.data(a);n.watermark.hideAll(),r.apply?r.apply(t,Array.prototype.slice.call(arguments)):r()}}(tt,it)):(it.data(a,1),tt.submit=function(t){return function(){n.watermark.hideAll(),delete t.submit,t.submit()}}(tt))))}n.watermark._show(h)}})},n.watermark.runOnce&&(n.watermark.runOnce=h,n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])},watermarkable:function(n){var t,i=n.nodeName;return i===g?u:i!=="INPUT"?h:(t=n.getAttribute(v),!t||!ft.test(t))}}),function(t){n.fn.val=function(){var u=this,e=Array.prototype.slice.call(arguments),o;return u.length?e.length?(t.apply(u,e),n.watermark.show(u),u):u.data(s)?(o=(u[0].value||r).replace(l,r),o===(u.data(f)||r)?r:o):t.apply(u):e.length?u:i}}(n.fn.val),k.length&&n(function(){for(var u,r,i=k.length-1;i>=0;i--)u=k[i],r=t[u],typeof r==d&&(t[u]=function(t){return function(){return n.watermark.hideAll(),t.apply(null,Array.prototype.slice.call(arguments))}}(r))}),n(t).bind("beforeunload",function(){n.watermark.options.hideBeforeUnload&&n.watermark.hideAll()}))})(jQuery,window); 915 916// regexMask (float-ptbr,float-enus,float,int 917(function(e){e.fn.regexMask=function(t){if(!t){throw"mandatory mask argument missing"}else if(t=="float-ptbr"){t=/^((\d{1,3}(\.\d{3})*(((\.\d{0,2}))|((\,\d*)?)))|(\d+(\,\d*)?))$/}else if(t=="float-enus"){t=/^((\d{1,3}(\,\d{3})*(((\,\d{0,2}))|((\.\d*)?)))|(\d+(\.\d*)?))$/}else if(t=="float"){t=/^((\d+(\.\d*)?))$/}
917else if(t=="int"){t=/^(\d+)$/}else{try{t.test("")}catch(n){throw"mask regex need to support test method"}}e(this).keypress(function(e){if(!e.charCode)return true;var n=this.value.substring(0,this.selectionStart);var r=this.value.substring(this.selectionEnd,this.value.length);if(!t.test(n+String.fromCharCode(e.charCode)+r))return false})}})(jQuery); 918 919// scrollIntoView 920 921(function ($) { 922 var converter = { 923 vertical: { x: false, y: true }, 924 horizontal: { x: true, y: false }, 925 both: { x: true, y: true }, 926 x: { x: true, y: false }, 927 y: { x: false, y: true } 928 }; 929 930 var settings = { 931 duration: "fast", 932 direction: "both" 933 }; 934 935 var rootrx = /^(?:html)$/i; 936 937 // gets border dimensions 938 var borders = function (domElement, styles) { 939 styles = styles || (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(domElement, null) : domElement.currentStyle); 940 var px = document.defaultView && document.defaultView.getComputedStyle ? true : false; 941 var b = { 942 top: (parseFloat(px ? styles.borderTopWidth : $.css(domElement, "borderTopWidth")) || 0), 943 left: (parseFloat(px ? styles.borderLeftWidth : $.css(domElement, "borderLeftWidth")) || 0), 944 bottom: (parseFloat(px ? styles.borderBottomWidth : $.css(domElement, "borderBottomWidth")) || 0), 945 right: (parseFloat(px ? styles.borderRightWidth : $.css(domElement, "borderRightWidth")) || 0) 946 }; 947 return { 948 top: b.top, 949 left: b.left, 950 bottom: b.bottom, 951 right: b.right, 952 vertical: b.top + b.bottom, 953 horizontal: b.left + b.right 954 }; 955 }; 956 957 var dimensions = function ($element) { 958 var win = $(window); 959 var isRoot = rootrx.test($element[0].nodeName); 960 return { 961 border: isRoot ? { top: 0, left: 0, bottom: 0, right: 0} : borders($element[0]), 962 scroll: { 963 top: (isRoot ? win : $element).scrollTop(), 964 left: (isRoot ? win : $element).scrollLeft() 965 }, 966 scrollbar: { 967 right: isRoot ? 0 : $element.innerWidth() - $element[0].clientWidth, 968 bottom: isRoot ? 0 : $element.innerHeight() - $element[0].clientHeight 969 }, 970 rect: (function () { 971 var r = $element[0].getBoundingClientRect(); 972 return { 973 top: isRoot ? 0 : r.top, 974 left: isRoot ? 0 : r.left, 975 bottom: isRoot ? $element[0].clientHeight : r.bottom, 976 right: isRoot ? $element[0].clientWidth : r.right 977 }; 978 })() 979 }; 980 }; 981 982 $.fn.extend({ 983 scrollintoview: function (options) { 984 /// <summary>Scrolls the first element in the set into view by scrolling its closest scrollable parent.</summary> 985 /// <param name="options" type="Object">Additional options that can configure scrolling: 986 /// duration (default: "fast") - jQuery animation speed (can be a duration string or number of milliseconds) 987 /// direction (default: "both") - select possible scrollings ("vertical" or "y", "horizontal" or "x", "both") 988 /// complete (default: none) - a function to call when scrolling completes (called in context of the DOM element being scrolled) 989 /// </param> 990 /// <return type="jQuery">Returns the same jQuery set that this function was run on.</return> 991 992 options = $.extend({}, settings, options); 993 options.direction = converter[typeof (options.direction) === "string" && options.direction.toLowerCase()] || converter.both; 994 995 var dirStr = ""; 996 if (options.direction.x === true) dirStr = "horizontal"; 997 if (options.direction.y === true) dirStr = dirStr ? "both" : "vertical"; 998 999 var el = this.eq(0); 1000 var scroller = el.closest(":scrollable(" + dirStr + ")"); 1001 1002 // check if there's anything to scroll in the first place 1003 if (scroller.length > 0) 1004 { 1005 scroller = scroller.eq(0); 1006 1007 var dim = { 1008 e: dimensions(el), 1009 s: dimensions(scroller) 1010 }; 1011 1012 var rel = { 1013 top: dim.e.rect.top - (dim.s.rect.top + dim.s.border.top), 1014 bottom: dim.s.rect.bottom - dim.s.border.bottom - dim.s.scrollbar.bottom - dim.e.re
1014ct.bottom, 1015 left: dim.e.rect.left - (dim.s.rect.left + dim.s.border.left), 1016 right: dim.s.rect.right - dim.s.border.right - dim.s.scrollbar.right - dim.e.rect.right 1017 }; 1018 1019 var animOptions = {}; 1020 1021 // vertical scroll 1022 if (options.direction.y === true) 1023 { 1024 if (rel.top < 0) 1025 { 1026 animOptions.scrollTop = dim.s.scroll.top + rel.top; 1027 } 1028 else if (rel.top > 0 && rel.bottom < 0) 1029 { 1030 animOptions.scrollTop = dim.s.scroll.top + Math.min(rel.top, -rel.bottom); 1031 } 1032 } 1033 1034 // horizontal scroll 1035 if (options.direction.x === true) 1036 { 1037 if (rel.left < 0) 1038 { 1039 animOptions.scrollLeft = dim.s.scroll.left + rel.left; 1040 } 1041 else if (rel.left > 0 && rel.right < 0) 1042 { 1043 animOptions.scrollLeft = dim.s.scroll.left + Math.min(rel.left, -rel.right); 1044 } 1045 } 1046 1047 // scroll if needed 1048 if (!$.isEmptyObject(animOptions)) 1049 { 1050 if (rootrx.test(scroller[0].nodeName)) 1051 { 1052 scroller = $("html,body"); 1053 } 1054 scroller 1055 .animate(animOptions, options.duration) 1056 .eq(0) // we want function to be called just once (ref. "html,body") 1057 .queue(function (next) { 1058 $.isFunction(options.complete) && options.complete.call(scroller[0]); 1059 next(); 1060 }); 1061 } 1062 else 1063 { 1064 // when there's nothing to scroll, just call the "complete" function 1065 $.isFunction(options.complete) && options.complete.call(scroller[0]); 1066 } 1067 } else { 1068 $.isFunction(options.complete) && options.complete.call(null); 1069 } 1070 1071 // return set back 1072 return this; 1073 } 1074 }); 1075 1076 var scrollValue = { 1077 auto: true, 1078 scroll: true, 1079 visible: false, 1080 hidden: false 1081 }; 1082 1083 $.extend($.expr[":"], { 1084 scrollable: function (element, index, meta, stack) { 1085 var direction = converter[typeof (meta[3]) === "string" && meta[3].toLowerCase()] || converter.both; 1086 var styles = (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(element, null) : element.currentStyle); 1087 var overflow = { 1088 x: scrollValue[styles.overflowX.toLowerCase()] || false, 1089 y: scrollValue[styles.overflowY.toLowerCase()] || false, 1090 isRoot: rootrx.test(element.nodeName) 1091 }; 1092 1093 // check if completely unscrollable (exclude HTML element because it's special) 1094 if (!overflow.x && !overflow.y && !overflow.isRoot) 1095 { 1096 return false; 1097 } 1098 1099 var size = { 1100 height: { 1101 scroll: element.scrollHeight, 1102 client: element.clientHeight 1103 }, 1104 width: { 1105 scroll: element.scrollWidth, 1106 client: element.clientWidth 1107 }, 1108 // check overflow.x/y because iPad (and possibly other tablets) don't dislay scrollbars 1109 scrollableX: function () { 1110 return (overflow.x || overflow.isRoot) && this.width.scroll > this.width.client; 1111 }, 1112 scrollableY: function () { 1113 return (overflow.y || overflow.isRoot) && this.height.scroll > this.height.client; 1114 } 1115 }; 1116 return direction.y && size.scrollableY() || direction.x && size.scrollableX(); 1117 } 1118 }); 1119})(jQuery); 1120 1121 1122function StartScrollToElement(element, offset, duration, complete) { 1123 if (!complete || complete===undefined) 1124 complete = function() {}; 1125 if (element.length<=0) 1126 complete(); 1127 $('html:not(:animated), body:not(:animated)').stop(true,false).animate({ 1128 scrollTop: element.offset().top - offset 1129 }, duration, "easeInOutCubic" , function() { 1130 if (this.nodeName==='BODY') 1131 complete(); 1132 }); 1133}; 1134 1135// invalid 1136(function ($){ 1137 $.fn.invalid = function () { 1138 1139 if (!this) return; 1140 var me = $(this); 1141 var element = me; 1142 if (me.data('role')=='dropdownlist') { 1143 element = me.closest('span').find('.k-dropdown-wrap'); 1144 } 1145 element.addClass('validation').scrollintoview({ 1146 duration: 500, 1147 direction: "both", 1148 complete: function() { 1149 element.focus(); 1150 element.css('background-color', '#FF0000'); 1151 element.css('border-color', '#FF0000'); 1152 setTimeout(function(){ 1153 element.css('background-color', ''); 1154 setTimeout(function(){ 1155 element.css('border-color', ''); 1156 }, 2500); 1157 }, 1500); 1158 } 1159 }); 1160 1161 1162 return this; 1163 }; 1164})(jQuery); 1165 1166function scrollTo(target) { 1167 $(target).scrollintoview({ 1168 duration: 500, 1169 direction: "both" 1170 });
1171} 1172 1173 1174function Message(type,title,message) { 1175 1176 var wrapper = $('.sirius-message'); 1177 $.blockUI(); 1178 if (wrapper.length===0) { 1179 wrapper = $('<div class="sirius-message" ><div><h2></h2><p></p></div><input type="button" value="OK" class="k-button message-backbutton" />'); 1180 $('body').append(wrapper); 1181 } 1182 wrapper.removeClass('error').removeClass('info'); 1183 var titleEl = wrapper.find('h2'); 1184 var messageEl = wrapper.find('p'); 1185 var messageWrap = $(wrapper.children()[0]); 1186 var ReturnButton = wrapper.find('.message-backbutton'); 1187 ReturnButton.unbind( "click" ); 1188 ReturnButton.click(function(e) { 1189 e.preventDefault(); 1190 close(); 1191 }); 1192 1193 var types = { 1194 error: { 1195 class: "err_none", 1196 wrapClass: "error" 1197 }, 1198 info: { 1199 class: "info_none", 1200 wrapClass: "info" 1201 }, 1202 security: { 1203 class: "err_security", 1204 wrapClass: "error" 1205 } 1206 } 1207 1208 var currentType = types[type]; 1209 messageWrap.attr('class',currentType.class); 1210 wrapper.addClass(currentType.wrapClass); 1211 titleEl.html(title); 1212 messageEl.html(message); 1213 1214 var topMargin = -1 * wrapper.height()/2; 1215 1216 1217 wrapper.css({'top':'-500px','opacity':'0'}); 1218 1219 var open = function() { 1220 wrapper.stop(true,false).animate({ 1221 opacity: 1, 1222 top: '50%', 1223 marginTop: topMargin 1224 }, 500, 'easeOutExpo'); 1225 }; 1226 1227 var close = function() { 1228 wrapper.stop(true,false).animate({ 1229 opacity: 0, 1230 top: '-300px' 1231 }, 500, 'easeInExpo', function () { 1232 ReturnButton.unbind( "click" ); 1233 wrapper.remove(); 1234 $.unblockUI(); 1235 }); 1236 1237 }; 1238 1239 open(); 1240 return this; 1241} 1242 1243 1244function KendoErrorHandler(e) { 1245 var data = tryParseJson(e.xhr.responseText); 1246 var errType = (e.errorThrown==='Forbidden' || e.errorThrown==='Unauthorized')?'security':'error'; 1247 if (data===null) { 1248 Message(errType,e.errorThrown,e.xhr.responseText); 1249 } else { 1250 if (data.invalids) { 1251 $('#'+data.invalids[0]).invalid(); 1252 return; 1253 } 1254 Message(errType,data.title,data.error); 1255 } 1256} 1257 1258function KendoErrorParser(e) { 1259 var parsed = {}; 1260 var data = tryParseJson(e.xhr.responseText); 1261 var errType = (e.errorThrown==='Forbidden' || e.errorThrown==='Unauthorized')?'security':'error'; 1262 if (data===null) { 1263 parsed = { type: errType,title: e.errorThrown, error: e.xhr.responseText, invalids: [], exdata: null}; 1264 } else { 1265 parsed = { type: errType,title: data.title, error: data.error, invalids: data.invalids, exdata: data.exdata}; 1266 } 1267 return parsed; 1268} 1269 1270function AjaxErrorHandler(xhr, status, error) { 1271 1272 error = String(error); 1273 var data = { 1274 type: (error==='Forbidden' || error==='Unauthorized')?'security':'error', 1275 title: error, 1276 error: 'Unknown error', 1277 status: xhr.status, 1278 exdata: null 1279 }; 1280 1281 1282 if (status === 'parsererror') { 1283 data.error = 'Requested JSON parse failed.'; 1284 } else if (status === 'timeout') { 1285 data.error = 'Request timed out.'; 1286 } else if (status === 'abort') { 1287 data.error = 'Request aborted.'; 1288 } 1289 if (xhr.responseText!=='') { 1290 data.error = xhr.responseText; 1291 var jsonData = tryParseJson(xhr.responseText); 1292 if (jsonData!==null) { 1293 if (jsonData.invalids) { 1294 data.invalids = jsonData.invalids; 1295 } 1296 data.exdata = jsonData.exdata; 1297 data.error = jsonData.error; 1298 data.title = jsonData.title; 1299 } 1300 } 1301 return data; 1302} 1303Share = { 1304 vkontakte: function(purl, ptitle, pimg, text) { 1305 url = 'http://vkontakte.ru/share.php?'; 1306 url += 'url=' + encodeURIComponent(purl); 1307 url += '&title=' + encodeURIComponent(ptitle); 1308 url += '&description=' + encodeURIComponent(text); 1309 url += '&image=' + encodeURIComponent(pimg); 1310 url += '&noparse=true'; 1311 Share.popup(url); 1312 }, 1313 odnoklassniki: function(purl, text) { 1314 url = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1'; 1315 url += '&st.comments=' + encodeURIComponent(text); 1316 url += '&st._surl=' + encodeURIComponent(purl); 1317 Share.popup(url); 1318 }, 1319 odnoklassniki2: function(purl, text) { 1320 url = 'https://connect.ok.ru/dk?st.cmd=WidgetSharePreview'; 1321 url += '&st.comments=' + encodeURIComponent(text); 1322 url += '&st.shareUrl=' + encodeURIComponent(purl); 1323 Share.popup(url); 1324 }, 1325 facebook: function(purl, ptitle, pimg, text) { 1326 url = 'http://www.facebook.com/sharer.php?s=100'; 1327 url += '&p[title]=' + encodeURIComponent(ptitle); 1328 url += '&p[summary]=' + encodeURIComponent(text); 1329 url += '&p[url]=' + encodeURIComponent(purl); 1330 url += '&p[images][0]=' + encodeURIComponent(pimg); 1331 url = 'http://www.facebook.com/dialog/feed?' + 'app_id=771552319656390' + '&link=https://' + encodeURIComponent(purl) + '&caption=' + encodeURIComponent(purl) + '&description=' + encodeURIComponent(text) + '&redirect_uri=https://' + encodeURIComponent(purl); 1332 Share.popup(url); 1333 return; 1334 }, 1335 twitter: function(purl, ptitle) { 1336 url = 'http://twitter.com/share?'; 1337 url += 'text=' + encodeURIComponent(ptitle); 1338 url += '&url=' + encodeURIComponent(purl); 1339 url += '&counturl=' + encodeURIComponent(purl); 1340 Share.popup(url); 1341 }, 1342 mailru: function(purl, ptitle, pimg, text) { 1343 url = 'http://connect.mail.ru/share?'; 1344 url += 'url=' + encodeURIComponent(purl); 1345 url += '&title=' + encodeURIComponent(ptitle); 1346 url += '&description=' + encodeURIComponent(text); 1347 url += '&imageurl=' + encodeURIComponent(pimg); 1348 Share.popup(url) 1349 }, 1350 me: function(el) { 1351 console.log(el.href); 1352 Share.popup(el.href); 1353 return false; 1354 }, 1355 popup: function(url) { 1356 window.open(url, '', 'toolbar=0,status=0,width=626,height=436'); 1357 } 1358}; 1359 1360var makeRequest = function(options) { 1361 var settings = $.extend({ 1362 url: '', 1363 method: 'POST', 1364 dataType: 'json', 1365 data: { response: 'json' }, 1366 onSuccess: function(data,status) { }, 1367 onError: function(error,responseText) { return true; }, 1368 wrapper: '#main-content-wrapper', 1369 loading: 'imgs/loading.gif', 1370 showSuccess: false, 1371 SuccessMessage: '' 1372 }, options, true ); 1373 var PageWrapper = settings.wrapper!==''?$(settings.wrapper):null; 1374 1375 if (PageWrapper!==null) PageWrapper.block({message: '<img src="'+ settings.loading + '" />'});
1376 $.post(settings.url, settings.data, function(data) { 1377 if (PageWrapper!==null) PageWrapper.unblock(); 1378 if (settings.onSuccess(data,'OK')==false) 1379 return; 1380 if (data.reload) { 1381 var method = 'GET'; 1382 if (data.method) { 1383 method = 'POST'; 1384 } 1385 var frm = $('<form method="'+ method +'" action="'+ data.url +'" />'); 1386 $.each(data.reload, function(i, val) { 1387 frm.append('<input type="hidden" name="'+ val.key +'" value="'+ val.value +'" />') 1388 }); 1389 if (PageWrapper!==null) { 1390 PageWrapper.append(frm); 1391 } else { 1392 $('body').append(frm); 1393 } 1394 frm.submit(); 1395 } else { 1396 if (settings.showSuccess) 1397 Message('info','Ok',settings.SuccessMessage); 1398 } 1399 }, settings.dataType).error( 1400 function(xhr, status, error) { 1401 if (PageWrapper!==null) PageWrapper.unblock(); 1402 var data = AjaxErrorHandler(xhr,status,error); 1403 if (settings.onError(data,error)==false) 1404 return; 1405 if (data.invalids) { 1406 $('#'+data.invalids[0]).invalid(); 1407 return; 1408 } else { 1409 Message(data.type,data.title,data.error); 1410 } 1411 }); 1412 return true; 1413}; 1414 1415 1416// myform 1417(function ($){ 1418 $.fn.myForm = function (options) { 1419 1420 var settings = $.extend({ 1421 data: { response: 'json' }, 1422 onSuccess: function(data,status) { }, 1423 onError: function(error,responseText) { return true; }, 1424 beforeSubmit: function(arr, form, options) { return true; }, 1425 uploadProgress: function(event,position,total,percentComplete) { }, 1426 wrapper: '#main-content-wrapper', 1427 showSuccess: false, 1428 SuccessMessage: "Success" 1429 }, options ); 1430 1431 var me = $(this); 1432 1433 1434 var isWrapFunc = $.isFunction(settings.wrapper); 1435 1436 var wrapp = function() {
1437 return isWrapFunc?settings.wrapper():$(settings.wrapper); 1438 }; 1439 1440 1441 var PageWrapper = null; 1442 1443 1444 1445 var formOptions = { 1446 data: settings.data, 1447 dataType: 'json', 1448 clearForm: false, 1449 resetForm: false, 1450 beforeSubmit: function(arr, form, options) { 1451 if (settings.beforeSubmit(arr, form, options) === false) return false; 1452 PageWrapper = wrapp(); 1453 if (PageWrapper!==null) PageWrapper.block({message: '<img src="imgs/loading.gif'}); 1454 return true; 1455 }, 1456 success: function(data,status) { 1457 PageWrapper = wrapp(); 1458 if (PageWrapper!==null) PageWrapper.unblock(); 1459 if (settings.onSuccess(data,status)==false) 1460 return; 1461 if (data.reload) { 1462 var method = 'GET'; 1463 if (data.method) { 1464 method = 'POST'; 1465 } 1466 var target = ""; 1467 if (data.target) { 1468 target = 'target="_blank"'; 1469 } 1470 var frm = $('<form method="'+ method +'" action="'+ data.url +'" '+ target +' />'); 1471 $.each(data.reload, function(i, val) { 1472 frm.append('<input type="hidden" name="'+ val.key +'" value="'+ val.value +'" />') 1473 }); 1474 $('#document-wrapper').append(frm); 1475 frm.submit(); 1476 } else { 1477 if (settings.showSuccess) 1478 Message('info','Ok',settings.SuccessMessage); 1479 } 1480 }, 1481 error: function(xhr, status, error) { 1482 PageWrapper = wrapp(); 1483 if (PageWrapper!==null) PageWrapper.unblock(); 1484 var data = AjaxErrorHandler(xhr,status,error); 1485 if (settings.onError(data,error)==false) 1486 return; 1487 if (data.invalids) { 1488 $('#'+data.invalids[0]).invalid(); 1489 return; 1490 } else { 1491 Message(data.type,data.title,data.error); 1492 } 1493 }, 1494 uploadProgress: function(event,position,total,percentComplete) { } 1495 }; 1496 1497 $(this).ajaxForm(formOptions); 1498 1499 1500 return this; 1501 }; 1502})(jQuery); 1503 1504function pageValidator() { 1505 1506 var isTooltip = false; 1507 1508 this.bind = function() { 1509 1510 $('.validate').bind("change paste keyup", function(e) { 1511 if (e.keyCode===13) return; 1512 if (isTooltip) 1513 $('.tooltip').remove(); 1514 }); 1515 1516 $('form.validator').submit(function(e) { 1517 var frm = $(this); 1518 $('.tooltip').remove(); 1519 frm.find('input.validate').each(function() { 1520 var input = $(this); 1521 var required = input.data("required"); 1522 var vle = input.val().replace(/[\s-]/g, ""); 1523 if (required==true && vle=='') { 1524 e.preventDefault(); 1525 isTooltip = true; 1526 $('<span class="tooltip" style="display:none;">' + _translate('ERR_REQUIREDFIELD') + '</span>').appendTo($('#'+input.data('target'))).show(200); 1527 } else { 1528 var reg = new RegExp(input.data("pattern")); 1529 if(reg.test(vle)===false) { 1530 e.preventDefault(); 1531 isTooltip = true; 1532 $('<span class="tooltip" style="display:none;">' + input.data("message") + '</span>').appendTo($('#'+input.data('target'))).show(200); 1533 } 1534 } 1535 }); 1536 }); 1537 }; 1538 1539 1540 1541}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.