2 lines
60 KiB
JavaScript
2 lines
60 KiB
JavaScript
function reloadCharts(){return-1===navigator.userAgent.toLowerCase().indexOf("firefox")?!1:void $('.ui-widget-content [aria-expanded="false"]').find("iframe").each(function(){var e=$(this).attr("src");-1!==e.indexOf("charts")&&($(this).hide(),$(this).attr("src",e),$(this).show())})}function openDialogCenter(e){e.dialog("open");var t=getDimensions(e.parent());e.dialog({position:[t[0],t[1]]})}function getDimensions(e){var t=new Array(2);return t[0]=$(window).width()/2-e.width()/2,t[1]=$(window).height()/2-e.height()/2,t}function updateChart(e,t,n,r,i,a){var n=n,r=r,o=$("#iframe"+e).attr("default_src");o||(o=$("#iframe"+e).attr("src")),src=o.split("?")[0],("bar"===$("#type_"+e).val()||"column"===$("#type_"+e).val())&&0==$("#timescale_"+e).val().length&&0==$("#average_"+e).val().length&&0==$("#median_"+e).val().length&&0==$("#sum_"+e).val().length&&$("#timescale_"+e).val(30);var s=[];$(".chart_options"+e).each(function(){var e=$(this).val(),t=$(this).attr("id"),n=t.split("_")[0];e.length>0&&s.push([n,e])});for(var l="";s.length>0;){var u=s.pop();"width"==u[0]&&(n=parseInt(u[1])),"height"==u[0]&&(r=parseInt(u[1])),("type"!=u[0]||"line"!=u[1])&&(l+="&"+u[0]+"="+encodeURIComponent(u[1]))}l.length>0&&(src+="?"+l.substring(1)),t&&e>0&&a?$.update("/channels/"+i+"/charts/"+e,{newOptions:{options:l}}):t&&e>0&&$.update("/channels/"+i+"/charts/"+e,{options:l}),$("#embed"+e).val('<iframe width="'+n+'" height="'+r+'" style="border: 1px solid #cccccc;" src="'+src+'"></iframe>'),$("#iframe"+e).attr("src",src),$("#iframe"+e).attr("width",n),$("#iframe"+e).attr("height",r)}function updateSelectValues(){selectedValue=$(this).val(),$(".mutuallyexclusive"+index).each(function(){$(this).val("")}),$(this).val(selectedValue)}function setupChartForm(e){return function(t,n){n.length>0&&$("#"+n.split("=")[0]+"_"+e).val(decodeURIComponent(n.split("=")[1]))}}function setupColumns(e,t){$(sortColumnSetup(e,t)),$(".column").disableSelection()}function createWindowsWithData(e,t,n,r){for(var i in e){var a=e[i].window,o=a.window_type;colId=a.col,title=a.title;var s=a.html;"chart"===a.window_type&&$("body").append("<div id='chartConfig"+a.id+"'></div>");var l=addWindow(r,colId,a.id,o,title,s);l.each(decoratePortlet(t)),l.find(".ui-toggle").click(uiToggleClick),l.find(".ui-view").click(uiViewClick(n)),l.find(".ui-edit").click(uiEditClick(n)),l.find(".ui-close").click(uiCloseClick(n))}}function addWindow(e,t,n,r,i,a){if($("#"+e+"_dialog"+t).append('<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" id="portlet_'+n+'"><div class="portlet-header window_type window_type-'+r+' ui-widget-header ui-corner-all">'+i+'</div><div class="portlet-content">'+a+"</div>"),$("#portlet_"+n).length>1)throw"Portlet count doesn't match what's expected";return $("#portlet_"+n)}function sortColumnSetup(e,t){$(".column").sortable({opacity:.6,helper:function(){return $("<div class='ui-widget-header'>Drop to re-position</div>")},connectWith:".column",update:updatePortletPositions(e,t)})}function getPortletArray(e){var t=new Array,n=e.split("&");for(i in n)val=n[i].split("=")[1],t.push(val);return t}function uiToggleClick(){$(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick"),$(this).parents(".portlet:first").find(".portlet-content").toggle()}!function(e,t){e.rails!==t&&e.error("jquery-ujs has already been loaded!");var n,r=e(document);e.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",buttonClickSelector:"button[data-remote]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var n=e('meta[name="csrf-token"]').attr("content");n&&t.setRequestHeader("X-CSRF-Token",n)},fire:function(t,n,r){var i=e.Event(n);return t.trigger(i,r),i.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(r){var i,a,o,s,l,u,c,d;if(n.fire(r,"ajax:before")){if(s=r.data("cross-domain"),l=s===t?null:s,u=r.data("with-credentials")||null,c=r.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,r.is("form")){i=r.attr("method"),a=r.attr("action"),o=r.serializeArray();var h=r.data("ujs:submit-button");h&&(o.push(h),r.data("ujs:submit-button",null))}else r.is(n.inputChangeSelector)?(i=r.data("method"),a=r.data("url"),o=r.serialize(),r.data("params")&&(o=o+"&"+r.data("params"))):r.is(n.buttonClickSelector)?(i=r.data("method")||"get",a=r.data("url"),o=r.serialize(),r.data("params")&&(o=o+"&"+r.data("params"))):(i=r.data("method"),a=n.href(r),o=r.data("params")||null);d={type:i||"GET",data:o,dataType:c,beforeSend:function(e,i){return i.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),n.fire(r,"ajax:beforeSend",[e,i])},success:function(e,t,n){r.trigger("ajax:success",[e,t,n])},complete:function(e,t){r.trigger("ajax:complete",[e,t])},error:function(e,t,n){r.trigger("ajax:error",[e,t,n])},crossDomain:l},u&&(d.xhrFields={withCredentials:u}),a&&(d.url=a);var f=n.ajax(d);return r.trigger("ajax:send",f),f}return!1},handleMethod:function(r){var i=n.href(r),a=r.data("method"),o=r.attr("target"),s=e("meta[name=csrf-token]").attr("content"),l=e("meta[name=csrf-param]").attr("content"),u=e('<form method="post" action="'+i+'"></form>'),c='<input name="_method" value="'+a+'" type="hidden" />';l!==t&&s!==t&&(c+='<input name="'+l+'" value="'+s+'" type="hidden" />'),o&&u.attr("target",o),u.hide().append(c).appendTo("body"),u.submit()},disableFormElements:function(t){t.find(n.disableSelector).each(function(){var t=e(this),n=t.is("button")?"html":"val";t.data("ujs:enable-with",t[n]()),t[n](t.data("disable-with")),t.prop("disabled",!0)})},enableFormElements:function(t){t.find(n.enableSelector).each(function(){var t=e(this),n=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[n](t.data("ujs:enable-with")),t.prop("disabled",!1)})},allowAction:function(e){var t,r=e.data("confirm"),i=!1;return r?(n.fire(e,"confirm")&&(i=n.confirm(r),t=n.fire(e,"confirm:complete",[i])),i&&t):!0},blankInputs:function(t,n,r){var i,a,o=e(),s=n||"input,textarea",l=t.find(s);return l.each(function(){if(i=e(this),a=i.is("input[type=checkbox],input[type=radio]")?i.is(":checked"):i.val(),!a==!r){if(i.is("input[type=radio]")&&l.filter('input[type=radio]:checked[name="'+i.attr("name")+'"]').length)return!0;o=o.add(i)}}),o.length?o:!1},nonBlankInputs:function(e,t){return n.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){e.data("ujs:enable-with",e.html()),e.html(e.data("disable-with")),e.bind("click.railsDisable",function(e){return n.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.unbind("click.railsDisable")}},n.fire(r,"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,r){e.crossDomain||n.CSRFProtection(r)}),r.delegate(n.linkDisableSelector,"ajax:complete",function(){n.enableElement(e(this))}),r.delegate(n.linkClickSelector,"click.rails",function(r){var i=e(this),a=i.data("method"),o=i.data("params");if(!n.allowAction(i))return n.stopEverything(r);if(i.is(n.linkDisableSelector)&&n.disableElement(i),i.data("remote")!==t){if(!(!r.metaKey&&!r.ctrlKey||a&&"GET"!==a||o))return!0;var s=n.handleRemote(i);return s===!1?n.enableElement(i):s.error(function(){n.enableElement(i)}),!1}return i.data("method")?(n.handleMethod(i),!1):void 0}),r.delegate(n.buttonClickSelector,"click.rails",function(t){var r=e(this);return n.allowAction(r)?(n.handleRemote(r),!1):n.stopEverything(t)}),r.delegate(n.inputChangeSelector,"change.rails",function(t){var r=e(this);return n.allowAction(r)?(n.handleRemote(r),!1):n.stopEverything(t)}),r.delegate(n.formSubmitSelector,"submit.rails",function(r){var i=e(this),a=i.data("remote")!==t,o=n.blankInputs(i,n.requiredInputSelector),s=n.nonBlankInputs(i,n.fileInputSelector);if(!n.allowAction(i))return n.stopEverything(r);if(o&&i.attr("novalidate")==t&&n.fire(i,"ajax:aborted:required",[o]))return n.stopEverything(r);if(a){if(s){setTimeout(function(){n.disableFormElements(i)},13);var l=n.fire(i,"ajax:aborted:file",[s]);return l||setTimeout(function(){n.enableFormElements(i)},13),l}return n.handleRemote(i),!1}setTimeout(function(){n.disableFormElements(i)},13)}),r.delegate(n.formInputClickSelector,"click.rails",function(t){var r=e(this);if(!n.allowAction(r))return n.stopEverything(t);var i=r.attr("name"),a=i?{name:i,value:r.val()}:null;r.closest("form").data("ujs:submit-button",a)}),r.delegate(n.formSubmitSelector,"ajax:beforeSend.rails",function(t){this==t.target&&n.disableFormElements(e(this))}),r.delegate(n.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&n.enableFormElements(e(this))}),e(function(){var t=e("meta[name=csrf-token]").attr("content"),n=e("meta[name=csrf-param]").attr("content");e('form input[name="'+n+'"]').val(t)}))}(jQuery),function(){var e,t,n,r,i,a,o,s,l,u,c,d,h,f,p,m,g,v,b,y,w,x,$,S,C,k,E,T,_,N,I,A,L,F,O,P,R,D,j,H,q,M,B,z,U,V,W,G,Q,X,Y,K,Z,J=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},et={}.hasOwnProperty,tt=function(e,t){function n(){this.constructor=e}for(var r in t)et.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},nt=[].slice;A={},h=10,G=!1,v=null,N=null,D=null,g=null,K=null,r={BEFORE_CHANGE:"page:before-change",FETCH:"page:fetch",RECEIVE:"page:receive",CHANGE:"page:change",UPDATE:"page:update",LOAD:"page:load",RESTORE:"page:restore",BEFORE_UNLOAD:"page:before-unload",EXPIRE:"page:expire"},x=function(e){var t;return e=new n(e),B(),d(),G&&(t=Q(e.absolute))?($(t),S(e)):S(e,V)},Q=function(e){var t;return t=A[e],t&&!t.transitionCacheDisabled?t:void 0},b=function(e){return null==e&&(e=!0),G=e},S=function(e,t){return null==t&&(t=function(){return function(){}}(this)),X(r.FETCH,{url:e.absolute}),null!=K&&K.abort(),K=new XMLHttpRequest,K.open("GET",e.withoutHashForIE10compatibility(),!0),K.setRequestHeader("Accept","text/html, application/xhtml+xml, application/xml"),K.setRequestHeader("X-XHR-Referer",D),K.onload=function(){var n;return X(r.RECEIVE,{url:e.absolute}),(n=P())?(j(e),f.apply(null,w(n)),I(),H(),t(),X(r.LOAD)):document.location.href=e.absolute},K.onloadend=function(){return K=null},K.onerror=function(){return document.location.href=e.absolute},K.send()},$=function(e){return null!=K&&K.abort(),f(e.title,e.body),R(e),X(r.RESTORE)},d=function(){var e;return e=new n(v.url),A[e.absolute]={url:e.relative,body:document.body,title:document.title,positionY:window.pageYOffset,positionX:window.pageXOffset,cachedAt:(new Date).getTime(),transitionCacheDisabled:null!=document.querySelector("[data-no-transition-cache]")},m(h)},F=function(e){return null==e&&(e=h),/^[\d]+$/.test(e)?h=parseInt(e):void 0},m=function(e){var t,n,i,a,o,s;for(i=Object.keys(A),t=i.map(function(e){return A[e].cachedAt}).sort(function(e,t){return t-e}),s=[],a=0,o=i.length;o>a;a++)n=i[a],A[n].cachedAt<=t[e]&&(X(r.EXPIRE,A[n]),s.push(delete A[n]));return s},f=function(t,n,i,a){return X(r.BEFORE_UNLOAD),document.title=t,document.documentElement.replaceChild(n,document.body),null!=i&&e.update(i),W(),a&&y(),v=window.history.state,X(r.CHANGE),X(r.UPDATE)},y=function(){var e,t,n,r,i,a,o,s,l,u,c,d;for(a=Array.prototype.slice.call(document.body.querySelectorAll('script:not([data-turbolinks-eval="false"])')),o=0,l=a.length;l>o;o++)if(i=a[o],""===(c=i.type)||"text/javascript"===c){for(t=document.createElement("script"),d=i.attributes,s=0,u=d.length;u>s;s++)e=d[s],t.setAttribute(e.name,e.value);i.hasAttribute("async")||(t.async=!1),t.appendChild(document.createTextNode(i.innerHTML)),r=i.parentNode,n=i.nextSibling,r.removeChild(i),r.insertBefore(t,n)}},z=function(e){return e.innerHTML=e.innerHTML.replace(/<noscript[\S\s]*?<\/noscript>/gi,""),e},W=function(){var e,t;return e=(t=document.querySelectorAll("input[autofocus], textarea[autofocus]"))[t.length-1],e&&document.activeElement!==e?e.focus():void 0},j=function(e){return(e=new n(e)).absolute!==D?window.history.pushState({turbolinks:!0,url:e.absolute},"",e.absolute):void 0},H=function(){var e,t;return(e=K.getResponseHeader("X-XHR-Redirected-To"))?(e=new n(e),t=e.hasNoHash()?document.location.hash:"",window.history.replaceState(v,"",e.href+t)):void 0},B=function(){return D=document.location.href},M=function(){return window.history.replaceState({turbolinks:!0,url:document.location.href},"",document.location.href)},q=function(){return v=window.history.state},I=function(){var e;return navigator.userAgent.match(/Firefox/)&&!(e=new n).hasNoHash()?(window.history.replaceState(v,"",e.withoutHash()),document.location.hash=e.hash):void 0},R=function(e){return window.scrollTo(e.positionX,e.positionY)},V=function(){return document.location.hash?document.location.href=document.location.href:window.scrollTo(0,0)},p=function(e){var t,n,r;if(null==e||"object"!=typeof e)return e;t=new e.constructor;for(n in e)r=e[n],t[n]=p(r);return t},O=function(e){var t,n;return t=(null!=(n=document.cookie.match(new RegExp(e+"=(\\w+)")))?n[1].toUpperCase():void 0)||"",document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/",t},X=function(e,t){var n;return"undefined"!=typeof Prototype&&Event.fire(document,e,t,!0),n=document.createEvent("Events"),t&&(n.data=t),n.initEvent(e,!0,!0),document.dispatchEvent(n)},L=function(e){return!X(r.BEFORE_CHANGE,{url:e})},P=function(){var e,t,n,r,i,a;return t=function(){var e;return 400<=(e=K.status)&&600>e},a=function(){var e;return null!=(e=K.getResponseHeader("Content-Type"))&&e.match(/^(?:text\/html|application\/xhtml\+xml|application\/xml)(?:;|$)/)},r=function(e){var t,n,r,i,a;for(i=e.querySelector("head").childNodes,a=[],n=0,r=i.length;r>n;n++)t=i[n],null!=("function"==typeof t.getAttribute?t.getAttribute("data-turbolinks-track"):void 0)&&a.push(t.getAttribute("src")||t.getAttribute("href"));return a},e=function(e){var t;return N||(N=r(document)),t=r(e),t.length!==N.length||i(t,N).length!==N.length},i=function(e,t){var n,r,i,a,o;for(e.length>t.length&&(a=[t,e],e=a[0],t=a[1]),o=[],r=0,i=e.length;i>r;r++)n=e[r],J.call(t,n)>=0&&o.push(n);return o},!t()&&a()&&(n=g(K.responseText),n&&!e(n))?n:void 0},w=function(t){var n;return n=t.querySelector("title"),[null!=n?n.textContent:void 0,z(t.querySelector("body")),e.get(t).token,"runScripts"]},e={get:function(e){var t;return null==e&&(e=document),{node:t=e.querySelector('meta[name="csrf-token"]'),token:null!=t&&"function"==typeof t.getAttribute?t.getAttribute("content"):void 0}},update:function(e){var t;return t=this.get(),null!=t.token&&null!=e&&t.token!==e?t.node.setAttribute("content",e):void 0}},a=function(){var e,t,n,r,i,a,o,s,l,u;r=function(e){return(new DOMParser).parseFromString(e,"text/html")},t=function(e){var t;return t=document.implementation.createHTMLDocument(""),t.documentElement.innerHTML=e,t},i=function(e){var t;return t=document.implementation.createHTMLDocument(""),t.open("replace"),t.write(e),t.close(),t},n=function(e){var t,n,r,i,a,o;return r=(null!=(a=e.match(/<head[^>]*>([\s\S.]*)<\/head>/i))?a[0]:void 0)||"<head></head>",t=(null!=(o=e.match(/<body[^>]*>([\s\S.]*)<\/body>/i))?o[0]:void 0)||"<body></body>",i=document.createElement("html"),i.innerHTML=r+t,n=document.createDocumentFragment(),n.appendChild(i),n},e=function(e){var t,r,a;return t=function(e,t){return{passes:t(),fallback:e}},a=t(i,function(){return function(){var t,n;return 1===(null!=(t=e("<html><body><p>test"))&&null!=(n=t.body)?n.childNodes.length:void 0)}}(this)),r=t(n,function(){return function(){var t,n;return 2===(null!=(t=e("<html><body><form></form><div></div></body></html>"))&&null!=(n=t.body)?n.childNodes.length:void 0)}}(this)),[a,r]};try{if(window.DOMParser)return o=e(r),r}catch(c){return s=c,o=e(t),t}finally{for(l=0,u=o.length;u>l;l++)if(a=o[l],!a.passes)return a.fallback}},n=function(){function e(t){return this.original=null!=t?t:document.location.href,this.original.constructor===e?this.original:void this._parse()}return e.prototype.withoutHash=function(){return this.href.replace(this.hash,"").replace("#","")},e.prototype.withoutHashForIE10compatibility=function(){return this.withoutHash()},e.prototype.hasNoHash=function(){return 0===this.hash.length},e.prototype._parse=function(){var e;return(null!=this.link?this.link:this.link=document.createElement("a")).href=this.original,e=this.link,this.href=e.href,this.protocol=e.protocol,this.host=e.host,this.hostname=e.hostname,this.port=e.port,this.pathname=e.pathname,this.search=e.search,this.hash=e.hash,this.origin=[this.protocol,"//",this.hostname].join(""),0!==this.port.length&&(this.origin+=":"+this.port),this.relative=[this.pathname,this.search,this.hash].join(""),this.absolute=this.href},e}(),i=function(e){function t(e){return this.link=e,this.link.constructor===t?this.link:(this.original=this.link.href,this.originalElement=this.link,this.link=this.link.cloneNode(!1),void t.__super__.constructor.apply(this,arguments))}return tt(t,e),t.HTML_EXTENSIONS=["html"],t.allowExtensions=function(){var e,n,r,i;for(n=1<=arguments.length?nt.call(arguments,0):[],r=0,i=n.length;i>r;r++)e=n[r],t.HTML_EXTENSIONS.push(e);return t.HTML_EXTENSIONS},t.prototype.shouldIgnore=function(){return this._crossOrigin()||this._anchored()||this._nonHtml()||this._optOut()||this._target()},t.prototype._crossOrigin=function(){return this.origin!==(new n).origin},t.prototype._anchored=function(){return(this.hash.length>0||"#"===this.href.charAt(this.href.length-1))&&this.withoutHash()===(new n).withoutHash()},t.prototype._nonHtml=function(){return this.pathname.match(/\.[a-z]+$/g)&&!this.pathname.match(new RegExp("\\.(?:"+t.HTML_EXTENSIONS.join("|")+")?$","g"))},t.prototype._optOut=function(){var e,t;for(t=this.originalElement;!e&&t!==document;)e=null!=t.getAttribute("data-no-turbolink"),t=t.parentNode;return e},t.prototype._target=function(){return 0!==this.link.target.length},t}(n),t=function(){function e(e){this.event=e,this.event.defaultPrevented||(this._extractLink(),this._validForTurbolinks()&&(L(this.link.absolute)||Y(this.link.href),this.event.preventDefault()))}return e.installHandlerLast=function(t){return t.defaultPrevented?void 0:(document.removeEventListener("click",e.handle,!1),document.addEventListener("click",e.handle,!1))},e.handle=function(t){return new e(t)},e.prototype._extractLink=function(){var e;for(e=this.event.target;e.parentNode&&"A"!==e.nodeName;)e=e.parentNode;return"A"===e.nodeName&&0!==e.href.length?this.link=new i(e):void 0},e.prototype._validForTurbolinks=function(){return null!=this.link&&!(this.link.shouldIgnore()||this._nonStandardClick())},e.prototype._nonStandardClick=function(){return this.event.which>1||this.event.metaKey||this.event.ctrlKey||this.event.shiftKey||this.event.altKey},e}(),c=function(e){return setTimeout(e,500)},E=function(){return document.addEventListener("DOMContentLoaded",function(){return X(r.CHANGE),X(r.UPDATE)},!0)},_=function(){return"undefined"!=typeof jQuery?jQuery(document).on("ajaxSuccess",function(e,t){return jQuery.trim(t.responseText)?X(r.UPDATE):void 0}):void 0},T=function(e){var t,r;return(null!=(r=e.state)?r.turbolinks:void 0)?(t=A[new n(e.state.url).absolute])?(d(),$(t)):Y(e.target.location.href):void 0},k=function(){return M(),q(),g=a(),document.addEventListener("click",t.installHandlerLast,!0),window.addEventListener("hashchange",function(){return M(),q()},!1),c(function(){return window.addEventListener("popstate",T,!1)})},C=void 0!==window.history.state||navigator.userAgent.match(/Firefox\/2[6|7]/),l=window.history&&window.history.pushState&&window.history.replaceState&&C,o=!navigator.userAgent.match(/CriOS\//),U="GET"===(Z=O("request_method"))||""===Z,u=l&&o&&U,s=document.addEventListener&&document.createEvent,s&&(E(),_()),u?(Y=x,k()):Y=function(e){return document.location.href=e},this.Turbolinks={visit:Y,pagesCached:F,enableTransitionCache:b,allowLinkExtensions:i.allowExtensions,supported:u,EVENTS:p(r)}}.call(this),function(e){e.cookie=function(t,n,r){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(n))||null===n||void 0===n)){if(r=e.extend({},r),(null===n||void 0===n)&&(r.expires=-1),"number"==typeof r.expires){var i=r.expires,a=r.expires=new Date;a.setDate(a.getDate()+i)}return n=String(n),document.cookie=[encodeURIComponent(t),"=",r.raw?n:encodeURIComponent(n),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}r=n||{};for(var o,s=r.raw?function(e){return e}:decodeURIComponent,l=document.cookie.split("; "),u=0;o=l[u]&&l[u].split("=");u++)if(s(o[0])===t)return s(o[1]||"");return null}}(jQuery);var createWindows=function(e,t,n){return function(r){createWindowsWithData(r,e,t,n)}},updatePortletPositions=function(e,t){return function(){if(e){var n=$(this).sortable("serialize");colId=$(this).attr("id").charAt($(this).attr("id").length-1),portletArray=getPortletArray(n),jsonResult={col:colId,positions:portletArray},portletArray.length>0&&$.ajax({type:"PUT",url:"../channels/"+t+"/windows",data:{_method:"PUT",page:JSON.stringify(jsonResult)},dataType:"json"})}}},decoratePortlet=function(e){return function(){var t=$(this).find(".portlet-header");return t.append("<span id='commentBtn' class='ui-view ui-icon ui-icon-comment'></span>"),thisObject=$(this),"true"==e?(thisObject.find(".window_type").prepend("<span id='minusBtn' class='ui-toggle ui-icon ui-icon-minusthick'></span>"),thisObject.find(".window_type-chart").append("<span id='pencilBtn' class='ui-edit ui-icon ui-icon-pencil'></span>"),thisObject.find(".window_type").append("<span id='closeBtn' class='ui-close ui-icon ui-icon-close'></span>"),thisObject.find(".portlet-header").css("cursor","move")):$(".column").sortable({disabled:!0}),$(this).attr("id")}},uiEditClick=function(e){return function(){var t=$(this).parents(".portlet:first").attr("id").substring(8),n="";$("#chartConfig"+t).load("/channels/"+e+"/charts/"+t+"/edit",function(){n=$("#chartOptions"+t).html(),"undefined"!=n&&n.length>2&&$.each(n.split("&"),setupChartForm(t)),$("#button"+t).click(function(){updateChart(t,!0,450,250,e,!0),$("#chartConfig"+t).dialog("close")})}).dialog({title:"Chart Options",modal:!0,resizable:!1,width:500,dialogClass:"dev-info-dialog"})}},uiViewClick=function(e){return function(){var t=$(this).parents(".portlet:first").offset().left,n=$(this).parents(".portlet:first").offset().top,r=$(this).parents(".portlet:first").attr("id").substring(8);$("body").append('<div id="iframepopup'+r+'" style="display:none"><div id="iframeinner'+r+'"style="font-size:1.2em;overflow:auto;height:115px;background-color:white"></div></div>'),$.get("/channels/"+e+"/windows/"+r+"/iframe",function(e){var t=e.replace(/id=\"iframe[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\"/,"");$("#iframeinner"+r).text(t)}),$("#iframepopup"+r).dialog({resizable:!1,width:"300px",position:[t+200,n-200],title:"Chart Iframe",dialogClass:"dev-info-dialog"})}},uiCloseClick=function(e){return function(){var t=$(this).parents(".portlet:first").attr("id").substring(8),n=$(this).parents(".portlet:first");$.update("/channels/"+e+"/windows/"+t+"/hide",function(){n.hide("drop",function(){n.remove()})})}};!function(e){function t(){var t=n(this);return isNaN(t.datetime)||e(this).text(r(t.datetime)),this}function n(t){if(t=e(t),!t.data("timeago")){t.data("timeago",{datetime:a.datetime(t)});var n=e.trim(t.text());n.length>0&&t.attr("title",n)}return t.data("timeago")}function r(e){return a.inWords(i(e))}function i(e){return(new Date).getTime()-e.getTime()}e.timeago=function(t){return r(t instanceof Date?t:"string"==typeof t?e.timeago.parse(t):e.timeago.datetime(t))};var a=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowFuture:!1,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",numbers:[]}},inWords:function(t){function n(n,i){var a=e.isFunction(n)?n(i,t):n,o=r.numbers&&r.numbers[i]||i;return a.replace(/%d/i,o)}var r=this.settings.strings,i=r.prefixAgo,a=r.suffixAgo;this.settings.allowFuture&&(0>t&&(i=r.prefixFromNow,a=r.suffixFromNow),t=Math.abs(t));var o=t/1e3,s=o/60,l=s/60,u=l/24,c=u/365,d=45>o&&n(r.seconds,Math.round(o))||90>o&&n(r.minute,1)||45>s&&n(r.minutes,Math.round(s))||90>s&&n(r.hour,1)||24>l&&n(r.hours,Math.round(l))||48>l&&n(r.day,1)||30>u&&n(r.days,Math.floor(u))||60>u&&n(r.month,1)||365>u&&n(r.months,Math.floor(u/30))||2>c&&n(r.year,1)||n(r.years,Math.floor(c));return e.trim([i,d,a].join(" "))},parse:function(t){var n=e.trim(t);return n=n.replace(/\.\d\d\d+/,""),n=n.replace(/-/,"/").replace(/-/,"/"),n=n.replace(/T/," ").replace(/Z/," UTC"),n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),new Date(n)},datetime:function(t){var n="time"===e(t).get(0).tagName.toLowerCase(),r=e(t).attr(n?"datetime":"title");return a.parse(r)}}),e.fn.timeago=function(){var e=this;e.each(t);var n=a.settings;return n.refreshMillis>0&&setInterval(function(){e.each(t)},n.refreshMillis),e},document.createElement("abbr"),document.createElement("time")}(jQuery),function($){$.extend({tablesorter:new function(){function benchmark(e,t){log(e+","+((new Date).getTime()-t.getTime())+"ms")}function log(e){"undefined"!=typeof console&&"undefined"!=typeof console.debug?console.log(e):alert(e)}function buildParserCache(e,t){if(e.config.debug)var n="";if(0!=e.tBodies.length){var r=e.tBodies[0].rows;if(r[0])for(var i=[],a=r[0].cells,o=a.length,s=0;o>s;s++){var l=!1;$.metadata&&$(t[s]).metadata()&&$(t[s]).metadata().sorter?l=getParserById($(t[s]).metadata().sorter):e.config.headers[s]&&e.config.headers[s].sorter&&(l=getParserById(e.config.headers[s].sorter)),l||(l=detectParserForColumn(e,r,-1,s)),e.config.debug&&(n+="column:"+s+" parser:"+l.id+"\n"),i.push(l)}return e.config.debug&&log(n),i}}function detectParserForColumn(e,t,n,r){for(var i=parsers.length,a=!1,o=!1,s=!0;""==o&&s;)n++,t[n]?(a=getNodeFromRowAndCellIndex(t,n,r),o=trimAndGetNodeText(e.config,a),e.config.debug&&log("Checking if value was empty on row:"+n)):s=!1;for(var l=1;i>l;l++)if(parsers[l].is(o,e,a))return parsers[l];return parsers[0]}function getNodeFromRowAndCellIndex(e,t,n){return e[t].cells[n]}function trimAndGetNodeText(e,t){return $.trim(getElementText(e,t))}function getParserById(e){for(var t=parsers.length,n=0;t>n;n++)if(parsers[n].id.toLowerCase()==e.toLowerCase())return parsers[n];return!1}function buildCache(e){if(e.config.debug)var t=new Date;for(var n=e.tBodies[0]&&e.tBodies[0].rows.length||0,r=e.tBodies[0].rows[0]&&e.tBodies[0].rows[0].cells.length||0,i=e.config.parsers,a={row:[],normalized:[]},o=0;n>o;++o){var s=$(e.tBodies[0].rows[o]),l=[];if(s.hasClass(e.config.cssChildRow))a.row[a.row.length-1]=a.row[a.row.length-1].add(s);else{a.row.push(s);for(var u=0;r>u;++u)l.push(i[u].format(getElementText(e.config,s[0].cells[u]),e,s[0].cells[u]));l.push(a.normalized.length),a.normalized.push(l),l=null}}return e.config.debug&&benchmark("Building cache for "+n+" rows:",t),a}function getElementText(e,t){var n="";return t?(e.supportsTextContent||(e.supportsTextContent=t.textContent||!1),n="simple"==e.textExtraction?e.supportsTextContent?t.textContent:t.childNodes[0]&&t.childNodes[0].hasChildNodes()?t.childNodes[0].innerHTML:t.innerHTML:"function"==typeof e.textExtraction?e.textExtraction(t):$(t).text()):""}function appendToTable(e,t){if(e.config.debug)var n=new Date;for(var r=t,i=r.row,a=r.normalized,o=a.length,s=a[0].length-1,l=$(e.tBodies[0]),u=[],c=0;o>c;c++){var d=a[c][s];if(u.push(i[d]),!e.config.appender)for(var h=i[d].length,f=0;h>f;f++)l[0].appendChild(i[d][f])}e.config.appender&&e.config.appender(e,u),u=null,e.config.debug&&benchmark("Rebuilt table:",n),applyWidget(e),setTimeout(function(){$(e).trigger("sortEnd")},0)}function buildHeaders(e){if(e.config.debug)var t=new Date;var n=($.metadata?!0:!1,computeTableHeaderCellIndexes(e));return $tableHeaders=$(e.config.selectorHeaders,e).each(function(t){if(this.column=n[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=formatSortingOrder(e.config.sortInitialOrder),this.count=this.order,(checkHeaderMetadata(this)||checkHeaderOptions(e,t))&&(this.sortDisabled=!0),checkHeaderOptionsSortingLocked(e,t)&&(this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(e,t)),!this.sortDisabled){var r=$(this).addClass(e.config.cssHeader);e.config.onRenderHeader&&e.config.onRenderHeader.apply(r)}e.config.headerList[t]=this}),e.config.debug&&(benchmark("Built headers:",t),log($tableHeaders)),$tableHeaders}function computeTableHeaderCellIndexes(e){for(var t=[],n={},r=e.getElementsByTagName("THEAD")[0],i=r.getElementsByTagName("TR"),a=0;a<i.length;a++)for(var o=i[a].cells,s=0;s<o.length;s++){var l,u=o[s],c=u.parentNode.rowIndex,d=c+"-"+u.cellIndex,h=u.rowSpan||1,f=u.colSpan||1;"undefined"==typeof t[c]&&(t[c]=[]);for(var p=0;p<t[c].length+1;p++)if("undefined"==typeof t[c][p]){l=p;break}n[d]=l;for(var p=c;c+h>p;p++){"undefined"==typeof t[p]&&(t[p]=[]);for(var m=t[p],g=l;l+f>g;g++)m[g]="x"}}return n}function checkCellColSpan(e,t,n){for(var r=[],i=e.tHead.rows,a=i[n].cells,o=0;o<a.length;o++){var s=a[o];s.colSpan>1?r=r.concat(checkCellColSpan(e,headerArr,n++)):(1==e.tHead.length||s.rowSpan>1||!i[n+1])&&r.push(s)}return r}function checkHeaderMetadata(e){return $.metadata&&$(e).metadata().sorter===!1?!0:!1}function checkHeaderOptions(e,t){return e.config.headers[t]&&e.config.headers[t].sorter===!1?!0:!1}function checkHeaderOptionsSortingLocked(e,t){return e.config.headers[t]&&e.config.headers[t].lockedOrder?e.config.headers[t].lockedOrder:!1}function applyWidget(e){for(var t=e.config.widgets,n=t.length,r=0;n>r;r++)getWidgetById(t[r]).format(e)}function getWidgetById(e){for(var t=widgets.length,n=0;t>n;n++)if(widgets[n].id.toLowerCase()==e.toLowerCase())return widgets[n]}function formatSortingOrder(e){return"Number"!=typeof e?"desc"==e.toLowerCase()?1:0:1==e?1:0}function isValueInArray(e,t){for(var n=t.length,r=0;n>r;r++)if(t[r][0]==e)return!0;return!1}function setHeadersCss(e,t,n,r){t.removeClass(r[0]).removeClass(r[1]);var i=[];t.each(function(){this.sortDisabled||(i[this.column]=$(this))});for(var a=n.length,o=0;a>o;o++)i[n[o][0]].addClass(r[n[o][1]])}function fixColumnWidth(e){var t=e.config;if(t.widthFixed){var n=$("<colgroup>");$("tr:first td",e.tBodies[0]).each(function(){n.append($("<col>").css("width",$(this).width()))}),$(e).prepend(n)}}function updateHeaderSortCount(e,t){for(var n=e.config,r=t.length,i=0;r>i;i++){var a=t[i],o=n.headerList[a[0]];o.count=a[1],o.count++}}function multisort(table,sortList,cache){if(table.config.debug)var sortTime=new Date;for(var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length,i=0;l>i;i++){var c=sortList[i][0],order=sortList[i][1],s="text"==table.config.parsers[c].type?0==order?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c):0==order?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c),e="e"+i;dynamicExp+="var "+e+" = "+s,dynamicExp+="if("+e+") { return "+e+"; } ",dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;l>i;i++)dynamicExp+="}; ";return dynamicExp+="return 0; ",dynamicExp+="}; ",table.config.debug&&benchmark("Evaling expression:"+dynamicExp,new Date),eval(dynamicExp),cache.normalized.sort(sortWrapper),table.config.debug&&benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime),cache}function makeSortFunction(e,t,n){var r="a["+n+"]",i="b["+n+"]";return"text"==e&&"asc"==t?"("+r+" == "+i+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+i+" === null ? Number.NEGATIVE_INFINITY : ("+r+" < "+i+") ? -1 : 1 )));":"text"==e&&"desc"==t?"("+r+" == "+i+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+i+" === null ? Number.NEGATIVE_INFINITY : ("+i+" < "+r+") ? -1 : 1 )));":"numeric"==e&&"asc"==t?"("+r+" === null && "+i+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+i+" === null ? Number.NEGATIVE_INFINITY : "+r+" - "+i+"));":"numeric"==e&&"desc"==t?"("+r+" === null && "+i+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+i+" === null ? Number.NEGATIVE_INFINITY : "+i+" - "+r+"));":void 0
|
|
}function makeSortText(e){return"((a["+e+"] < b["+e+"]) ? -1 : ((a["+e+"] > b["+e+"]) ? 1 : 0));"}function makeSortTextDesc(e){return"((b["+e+"] < a["+e+"]) ? -1 : ((b["+e+"] > a["+e+"]) ? 1 : 0));"}function makeSortNumeric(e){return"a["+e+"]-b["+e+"];"}function makeSortNumericDesc(e){return"b["+e+"]-a["+e+"];"}function sortText(e,t){return table.config.sortLocaleCompare?e.localeCompare(t):t>e?-1:e>t?1:0}function sortTextDesc(e,t){return table.config.sortLocaleCompare?t.localeCompare(e):e>t?-1:t>e?1:0}function sortNumeric(e,t){return e-t}function sortNumericDesc(e,t){return t-e}function getCachedSortType(e,t){return e[t].type}var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:!0,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:!1,cancelSelection:!0,sortList:[],headerList:[],dateFormat:"us",decimal:"/.|,/g",onRenderHeader:null,selectorHeaders:"thead th",debug:!1},this.benchmark=benchmark,this.construct=function(e){return this.each(function(){if(this.tHead&&this.tBodies){var t,n,r,i;this.config={},i=$.extend(this.config,$.tablesorter.defaults,e),t=$(this),$.data(this,"tablesorter",i),n=buildHeaders(this),this.config.parsers=buildParserCache(this,n),r=buildCache(this);var a=[i.cssDesc,i.cssAsc];fixColumnWidth(this),n.click(function(e){var o=t[0].tBodies[0]&&t[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&o>0){t.trigger("sortStart");var s=($(this),this.column);if(this.order=this.count++%2,this.lockedOrder&&(this.order=this.lockedOrder),e[i.sortMultiSortKey])if(isValueInArray(s,i.sortList))for(var l=0;l<i.sortList.length;l++){var u=i.sortList[l],c=i.headerList[u[0]];u[0]==s&&(c.count=u[1],c.count++,u[1]=c.count%2)}else i.sortList.push([s,this.order]);else{if(i.sortList=[],null!=i.sortForce)for(var d=i.sortForce,l=0;l<d.length;l++)d[l][0]!=s&&i.sortList.push(d[l]);i.sortList.push([s,this.order])}return setTimeout(function(){setHeadersCss(t[0],n,i.sortList,a),appendToTable(t[0],multisort(t[0],i.sortList,r))},1),!1}}).mousedown(function(){return i.cancelSelection?(this.onselectstart=function(){return!1},!1):void 0}),t.bind("update",function(){var e=this;setTimeout(function(){e.config.parsers=buildParserCache(e,n),r=buildCache(e)},1)}).bind("updateCell",function(e,t){var n=this.config,i=[t.parentNode.rowIndex-1,t.cellIndex];r.normalized[i[0]][i[1]]=n.parsers[i[1]].format(getElementText(n,t),t)}).bind("sorton",function(e,t){$(this).trigger("sortStart"),i.sortList=t;var o=i.sortList;updateHeaderSortCount(this,o),setHeadersCss(this,n,o,a),appendToTable(this,multisort(this,o,r))}).bind("appendCache",function(){appendToTable(this,r)}).bind("applyWidgetId",function(e,t){getWidgetById(t).format(this)}).bind("applyWidgets",function(){applyWidget(this)}),$.metadata&&$(this).metadata()&&$(this).metadata().sortlist&&(i.sortList=$(this).metadata().sortlist),i.sortList.length>0&&t.trigger("sorton",[i.sortList]),applyWidget(this)}})},this.addParser=function(e){for(var t=parsers.length,n=!0,r=0;t>r;r++)parsers[r].id.toLowerCase()==e.id.toLowerCase()&&(n=!1);n&&parsers.push(e)},this.addWidget=function(e){widgets.push(e)},this.formatFloat=function(e){var t=parseFloat(e);return isNaN(t)?0:t},this.formatInt=function(e){var t=parseInt(e);return isNaN(t)?0:t},this.isDigit=function(e){return/^[-+]?\d*$/.test($.trim(e.replace(/[,.']/g,"")))},this.clearTableBody=function(e){function t(){for(;this.firstChild;)this.removeChild(this.firstChild)}$.browser.msie?t.apply(e.tBodies[0]):e.tBodies[0].innerHTML=""}}}),$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(){return!0},format:function(e){return $.trim(e.toLocaleLowerCase())},type:"text"}),ts.addParser({id:"digit",is:function(e,t){var n=t.config;return $.tablesorter.isDigit(e,n)},format:function(e){return $.tablesorter.formatFloat(e)},type:"numeric"}),ts.addParser({id:"currency",is:function(e){return/^[\xc2\xa3$\xe2\u201a\xac?.]/.test(e)},format:function(e){return $.tablesorter.formatFloat(e.replace(new RegExp(/[\xc2\xa3$\xe2\u201a\xac]/g),""))},type:"numeric"}),ts.addParser({id:"ipAddress",is:function(e){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(e)},format:function(e){for(var t=e.split("."),n="",r=t.length,i=0;r>i;i++){var a=t[i];n+=2==a.length?"0"+a:a}return $.tablesorter.formatFloat(n)},type:"numeric"}),ts.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\/$/.test(e)},format:function(e){return jQuery.trim(e.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"}),ts.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(e)},format:function(e){return $.tablesorter.formatFloat(""!=e?new Date(e.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"}),ts.addParser({id:"percent",is:function(e){return/\%$/.test($.trim(e))},format:function(e){return $.tablesorter.formatFloat(e.replace(new RegExp(/%/g),""))},type:"numeric"}),ts.addParser({id:"usLongDate",is:function(e){return e.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(e){return $.tablesorter.formatFloat(new Date(e).getTime())},type:"numeric"}),ts.addParser({id:"shortDate",is:function(e){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(e)},format:function(e,t){var n=t.config;return e=e.replace(/\-/g,"/"),"us"==n.dateFormat?e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2"):"uk"==n.dateFormat?e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1"):("dd/mm/yy"==n.dateFormat||"dd-mm-yy"==n.dateFormat)&&(e=e.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")),$.tablesorter.formatFloat(new Date(e).getTime())},type:"numeric"}),ts.addParser({id:"time",is:function(e){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(e)},format:function(e){return $.tablesorter.formatFloat(new Date("2000/01/01 "+e).getTime())},type:"numeric"}),ts.addParser({id:"metadata",is:function(){return!1},format:function(e,t,n){var r=t.config,i=r.parserMetadataName?r.parserMetadataName:"sortValue";return $(n).metadata()[i]},type:"numeric"}),ts.addWidget({id:"zebra",format:function(e){if(e.config.debug)var t=new Date;var n,r,i=-1;$("tr:visible",e.tBodies[0]).each(function(){n=$(this),n.hasClass(e.config.cssChildRow)||i++,r=i%2==0,n.removeClass(e.config.widgetZebra.css[r?0:1]).addClass(e.config.widgetZebra.css[r?1:0])}),e.config.debug&&$.tablesorter.benchmark("Applying Zebra widget",t)}})}(jQuery),function(e){window.NestedFormEvents=function(){this.addFields=e.proxy(this.addFields,this),this.removeFields=e.proxy(this.removeFields,this)},NestedFormEvents.prototype={addFields:function(t){var n=t.currentTarget,r=e(n).data("association"),i=e("#"+e(n).data("blueprint-id")),a=i.data("blueprint"),o=(e(n).closest(".fields").closestChild("input, textarea, select").eq(0).attr("name")||"").replace(new RegExp("[[a-z_]+]$"),"");if(o)for(var s=o.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g)||[],l=o.match(/[0-9]+/g)||[],u=0;u<s.length;u++)l[u]&&(a=a.replace(new RegExp("(_"+s[u]+")_.+?_","g"),"$1_"+l[u]+"_"),a=a.replace(new RegExp("(\\["+s[u]+"\\])\\[.+?\\]","g"),"$1["+l[u]+"]"));var c=new RegExp("new_"+r,"g"),d=this.newId();a=e.trim(a.replace(c,d));var h=this.insertFields(a,r,n);return h.trigger({type:"nested:fieldAdded",field:h}).trigger({type:"nested:fieldAdded:"+r,field:h}),!1},newId:function(){return(new Date).getTime()},insertFields:function(t,n,r){var i=e(r).data("target");return i?e(t).appendTo(e(i)):e(t).insertBefore(r)},removeFields:function(t){var n=e(t.currentTarget),r=n.data("association"),i=n.prev("input[type=hidden]");i.val("1");var a=n.closest(".fields");return a.hide(),a.trigger({type:"nested:fieldRemoved",field:a}).trigger({type:"nested:fieldRemoved:"+r,field:a}),!1}},window.nestedFormEvents=new NestedFormEvents,e(document).delegate("form a.add_nested_fields","click",nestedFormEvents.addFields).delegate("form a.remove_nested_fields","click",nestedFormEvents.removeFields)}(jQuery),function(e){e.fn.closestChild=function(t){if(t&&""!=t){var n=[];for(n.push(this);n.length>0;)for(var r=n.shift(),i=r.children(),a=0;a<i.length;++a){var o=e(i[a]);if(o.is(t))return o;n.push(o)}}return e()}}(jQuery);var wloc=window.location.toString();-1!==wloc.indexOf("api")&&wloc.indexOf("api")<10&&-1===wloc.indexOf("charts")&&-1===wloc.indexOf("plugins")&&(window.location=wloc.replace("api","www")),function(e){function t(t,r,i,a){l={dataType:"json"},1===arguments.length&&"string"!=typeof arguments[0]?(l=e.extend(l,t),"url"in l&&"data"in l&&n(l.url,l.data)):(e.isFunction(r)&&(a=i,i=r,r=null),t=n(t,r),l=e.extend(l,{url:t,data:r,success:i,error:a}))}function n(e,t){var n,r,i;for(n in t)i=t[n],r=e.replace("{"+n+"}",i),r!=e&&(e=r,delete t[n]);return e}function r(t){return t.type=t.type||"GET","string"!=typeof t.data&&null!=t.data&&(t.data=e.param(t.data)),t.data=t.data||"",e.restSetup.csrf&&!e.isEmptyObject(e.restSetup.csrf)&&(/^(get)$/i.test(t.type)||/(authenticity_token=)/i.test(t.data)||(t.data+=(t.data?"&":"")+e.restSetup.csrfParam+"="+$restSetup.csrfToken)),/^(get|post)$/i.test(t.type)||(t.data+=(t.data?"&":"")+e.restSetup.methodParam+"="+t.type.toLowerCase(),t.type="POST"),u.call(this,t)}function i(){return t.apply(this,arguments),e.extend(l,{type:"GET"}),e.ajax(l)}function a(){return t.apply(this,arguments),e.extend(l,{type:"POST"}),e.ajax(l)}function o(){return t.apply(this,arguments),e.extend(l,{type:"PUT"}),e.ajax(l)}function s(){return t.apply(this,arguments),e.extend(l,{type:"DELETE"}),e.ajax(l)}e.restSetup={methodParam:"_method"},e(document).on("page:load ready",function(){e.extend(e.restSetup,{csrfParam:e("meta[name=csrf-param]").attr("content"),csrfToken:e("meta[name=csrf-token]").attr("content")})});var l,u=e.ajax;e.extend({ajax:r,read:i,create:a,update:o,destroy:s})}(jQuery),function(e,t,n){var r={required:"The %s field is required.",matches:"The %s field does not match the %s field.",valid_email:"The %s field must contain a valid email address.",min_length:"The %s field must be at least %s characters in length.",max_length:"The %s field must not exceed %s characters in length.",exact_length:"The %s field must be exactly %s characters in length.",greater_than:"The %s field must contain a number greater than %s.",less_than:"The %s field must contain a number less than %s.",alpha:"The %s field must only contain alphabetical characters.",alpha_numeric:"The %s field must only contain alpha-numeric characters.",alpha_dash:"The %s field must only contain alpha-numeric characters, underscores, and dashes.",numeric:"The %s field must contain only numbers.",integer:"The %s field must contain an integer."},i=function(){},a=/^(.+)\[(.+)\]$/,o=/^[0-9]+$/,s=/^\-?[0-9]+$/,l=/^\-?[0-9]*\.?[0-9]+$/,u=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,6}$/i,c=/^[a-z]+$/i,d=/^[a-z0-9]+$/i,h=/^[a-z0-9_-]+$/i,f=function(e,n,r){for(this.callback=r||i,this.errors=[],this.fields={},this.form=t.forms[e]||{},this.messages={},this.handlers={},e=0,r=n.length;r>e;e++){var a=n[e];a.name&&a.rules&&(this.fields[a.name]={name:a.name,display:a.display||a.name,rules:a.rules,type:null,value:null,checked:null})}this.form.onsubmit=function(e){return function(t){try{return e._validateForm(t)}catch(n){}}}(this)};f.prototype.setMessage=function(e,t){return this.messages[e]=t,this},f.prototype.registerCallback=function(e,t){return e&&"string"==typeof e&&t&&"function"==typeof t&&(this.handlers[e]=t),this},f.prototype._validateForm=function(e){this.errors=[];for(var t in this.fields)if(this.fields.hasOwnProperty(t)){var r=this.fields[t]||{},i=this.form[r.name];i&&i!==n&&(r.type=i.type,r.value=i.value,r.checked=i.checked),this._validateField(r)}if("function"==typeof this.callback&&this.callback(this.errors,e),this.errors.length>0){if(!e||!e.preventDefault)return!1;e.preventDefault()}return!0},f.prototype._validateField=function(e){var t=e.rules.split("|");if(-1!==e.rules.indexOf("required")||e.value&&""!==e.value&&e.value!==n)for(var i=0,o=t.length;o>i;i++){var s=t[i],l=null,u=!1;if((parts=a.exec(s))&&(s=parts[1],l=parts[2]),"function"==typeof this._hooks[s]?this._hooks[s].apply(this,[e,l])||(u=!0):"callback_"===s.substring(0,9)&&(s=s.substring(9,s.length),"function"==typeof this.handlers[s]&&this.handlers[s].apply(this,[e.value])===!1&&(u=!0)),u){(t=this.messages[s]||r[s])?(e=t.replace("%s",e.display),l&&(e=e.replace("%s",this.fields[l]?this.fields[l].display:l)),this.errors.push(e)):this.errors.push("An error has occurred with the "+e.display+" field.");break}}},f.prototype._hooks={required:function(e){var t=e.value;return"checkbox"===e.type?e.checked===!0:null!==t&&""!==t},matches:function(e,t){return(el=this.form[t])?e.value===el.value:!1},valid_email:function(e){return u.test(e.value)},min_length:function(e,t){return o.test(t)?e.value.length>=t:!1},max_length:function(e,t){return o.test(t)?e.value.length<=t:!1},exact_length:function(e,t){return o.test(t)?e.value.length==t:!1},greater_than:function(e,t){return l.test(e.value)?parseFloat(e.value)>parseFloat(t):!1},less_than:function(e,t){return l.test(e.value)?parseFloat(e.value)<parseFloat(t):!1},alpha:function(e){return c.test(e.value)},alpha_numeric:function(e){return d.test(e.value)},alpha_dash:function(e){return h.test(e.value)},numeric:function(e){return l.test(e.value)},integer:function(e){return s.test(e.value)}},e.FormValidator=f}(window,document),$(document).on("page:load ready",function(){$("div.progressbar").each(function(){var e=this;$(e).progressbar({value:parseInt($(e).attr("rel"))})})}),$(window).on("page:load load",function(){$.fn.affix&&(setTimeout(function(){$("#bootstrap-sidebar").affix()},100),$(document.body).scrollspy({target:"#leftcol",offset:300}),$("#bootstrap-sidebar li a[href^='#']").on("click",function(e){e.preventDefault();var t=this.hash;$("html, body").animate({scrollTop:$(this.hash).offset().top-90},300,function(){window.location.hash=t})}))});var q=null;window.PR_SHOULD_USE_CONTINUATION=!0,function(){function e(e){function t(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=d[n])?t:n>="0"&&"7">=n?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1)}function n(e){return 32>e?(16>e?"\\x0":"\\x")+e.toString(16):(e=String.fromCharCode(e),("\\"===e||"-"===e||"["===e||"]"===e)&&(e="\\"+e),e)}function r(e){for(var r=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],i=[],a="^"===r[0],o=a?1:0,s=r.length;s>o;++o){var l=r[o];if(/\\[bdsw]/i.test(l))e.push(l);else{var u,l=t(l);s>o+2&&"-"===r[o+1]?(u=t(r[o+2]),o+=2):u=l,i.push([l,u]),65>u||l>122||(65>u||l>90||i.push([32|Math.max(65,l),32|Math.min(u,90)]),97>u||l>122||i.push([-33&Math.max(97,l),-33&Math.min(u,122)]))}}for(i.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]}),r=[],l=[0/0,0/0],o=0;o<i.length;++o)s=i[o],s[0]<=l[1]+1?l[1]=Math.max(l[1],s[1]):r.push(l=s);for(i=["["],a&&i.push("^"),i.push.apply(i,e),o=0;o<r.length;++o)s=r[o],i.push(n(s[0])),s[1]>s[0]&&(s[1]+1>s[0]&&i.push("-"),i.push(n(s[1])));return i.push("]"),i.join("")}function i(e){for(var t=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),n=t.length,i=[],s=0,l=0;n>s;++s){var u=t[s];"("===u?++l:"\\"===u.charAt(0)&&(u=+u.substring(1))&&l>=u&&(i[u]=-1)}for(s=1;s<i.length;++s)-1===i[s]&&(i[s]=++a);for(l=s=0;n>s;++s)u=t[s],"("===u?(++l,void 0===i[l]&&(t[s]="(?:")):"\\"===u.charAt(0)&&(u=+u.substring(1))&&l>=u&&(t[s]="\\"+i[l]);for(l=s=0;n>s;++s)"^"===t[s]&&"^"!==t[s+1]&&(t[s]="");if(e.ignoreCase&&o)for(s=0;n>s;++s)u=t[s],e=u.charAt(0),u.length>=2&&"["===e?t[s]=r(u):"\\"!==e&&(t[s]=u.replace(/[A-Za-z]/g,function(e){return e=e.charCodeAt(0),"["+String.fromCharCode(-33&e,32|e)+"]"}));return t.join("")}for(var a=0,o=!1,s=!1,l=0,u=e.length;u>l;++l){var c=e[l];if(c.ignoreCase)s=!0;else if(/[a-z]/i.test(c.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){o=!0,s=!1;break}}for(var d={b:8,t:9,n:10,v:11,f:12,r:13},h=[],l=0,u=e.length;u>l;++l){if(c=e[l],c.global||c.multiline)throw Error(""+c);h.push("(?:"+i(c)+")")}return RegExp(h.join("|"),s?"gi":"g")}function t(e){function t(e){switch(e.nodeType){case 1:if(r.test(e.className))break;for(var n=e.firstChild;n;n=n.nextSibling)t(n);n=e.nodeName,("BR"===n||"LI"===n)&&(i[s]="\n",o[s<<1]=a++,o[s++<<1|1]=e);break;case 3:case 4:n=e.nodeValue,n.length&&(n=l?n.replace(/\r\n?/g,"\n"):n.replace(/[\t\n\r ]+/g," "),i[s]=n,o[s<<1]=a,a+=n.length,o[s++<<1|1]=e)}}var n,r=/(?:^|\s)nocode(?:\s|$)/,i=[],a=0,o=[],s=0;e.currentStyle?n=e.currentStyle.whiteSpace:window.getComputedStyle&&(n=document.defaultView.getComputedStyle(e,q).getPropertyValue("white-space"));var l=n&&"pre"===n.substring(0,3);return t(e),{a:i.join("").replace(/\n$/,""),c:o}}function n(e,t,n,r){t&&(e={a:t,d:e},n(e),r.push.apply(r,e.e))}function r(t,r){function i(e){for(var t=e.d,u=[t,"pln"],c=0,d=e.a.match(a)||[],h={},f=0,p=d.length;p>f;++f){var m,g=d[f],v=h[g],b=void 0;if("string"==typeof v)m=!1;else{var y=o[g.charAt(0)];if(y)b=g.match(y[1]),v=y[0];else{for(m=0;l>m;++m)if(y=r[m],b=g.match(y[1])){v=y[0];break}b||(v="pln")}!(m=v.length>=5&&"lang-"===v.substring(0,5))||b&&"string"==typeof b[1]||(m=!1,v="src"),m||(h[g]=v)}if(y=c,c+=g.length,m){m=b[1];var w=g.indexOf(m),x=w+m.length;b[2]&&(x=g.length-b[2].length,w=x-m.length),v=v.substring(5),n(t+y,g.substring(0,w),i,u),n(t+y+w,m,s(v,m),u),n(t+y+x,g.substring(x),i,u)}else u.push(t+y,v)}e.e=u}var a,o={};!function(){for(var n=t.concat(r),i=[],s={},l=0,u=n.length;u>l;++l){var c=n[l],d=c[3];if(d)for(var h=d.length;--h>=0;)o[d.charAt(h)]=c;c=c[1],d=""+c,s.hasOwnProperty(d)||(i.push(c),s[d]=q)}i.push(/[\S\s]/),a=e(i)}();var l=r.length;return i}function i(e){var t=[],n=[];t.push(e.tripleQuotedStrings?["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]:e.multiLineStrings?["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,q,"'\"`"]:["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]),e.verbatimStrings&&n.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var i=e.hashComments;return i&&(e.cStyleComments?(t.push(i>1?["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]:["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):t.push(["com",/^#[^\n\r]*/,q,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\n\r]*/,q]),n.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q])),e.regexLiterals&&n.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]),(i=e.types)&&n.push(["typ",i]),e=(""+e.keywords).replace(/^ | $/g,""),e.length&&n.push(["kwd",RegExp("^(?:"+e.replace(/[\s,]+/g,"|")+")\\b"),q]),t.push(["pln",/^\s+/,q," \r\n \xa0"]),n.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]),r(t,n)}function a(e,t){function n(e){switch(e.nodeType){case 1:if(a.test(e.className))break;if("BR"===e.nodeName)r(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)n(e);break;case 3:case 4:if(l){var t=e.nodeValue,i=t.match(o);if(i){var u=t.substring(0,i.index);e.nodeValue=u,(t=t.substring(i.index+i[0].length))&&e.parentNode.insertBefore(s.createTextNode(t),e.nextSibling),r(e),u||e.parentNode.removeChild(e)}}}}function r(e){function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var i=t(i,1),a=e.nextSibling;i.appendChild(r);for(var o=a;o;o=a)a=o.nextSibling,i.appendChild(o)}return r}for(;!e.nextSibling;)if(e=e.parentNode,!e)return;for(var n,e=t(e.nextSibling,0);(n=e.parentNode)&&1===n.nodeType;)e=n;u.push(e)}var i,a=/(?:^|\s)nocode(?:\s|$)/,o=/\r\n?|\n/,s=e.ownerDocument;e.currentStyle?i=e.currentStyle.whiteSpace:window.getComputedStyle&&(i=s.defaultView.getComputedStyle(e,q).getPropertyValue("white-space"));var l=i&&"pre"===i.substring(0,3);for(i=s.createElement("LI");e.firstChild;)i.appendChild(e.firstChild);for(var u=[i],c=0;c<u.length;++c)n(u[c]);t===(0|t)&&u[0].setAttribute("value",t);var d=s.createElement("OL");d.className="linenums";for(var h=Math.max(0,t-1|0)||0,c=0,f=u.length;f>c;++c)i=u[c],i.className="L"+(c+h)%10,i.firstChild||i.appendChild(s.createTextNode("\xa0")),d.appendChild(i);e.appendChild(d)}function o(e,t){for(var n=t.length;--n>=0;){var r=t[n];y.hasOwnProperty(r)?window.console&&console.warn("cannot override language handler %s",r):y[r]=e}}function s(e,t){return e&&y.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),y[e]}function l(e){var n=e.g;try{var r=t(e.h),i=r.a;e.a=i,e.c=r.c,e.d=0,s(n,i)(e);var a=/\bMSIE\b/.test(navigator.userAgent),n=/\n/g,o=e.a,l=o.length,r=0,u=e.c,c=u.length,i=0,d=e.e,h=d.length,e=0;d[h]=l;var f,p;for(p=f=0;h>p;)d[p]!==d[p+2]?(d[f++]=d[p++],d[f++]=d[p++]):p+=2;for(h=f,p=f=0;h>p;){for(var m=d[p],g=d[p+1],v=p+2;h>=v+2&&d[v+1]===g;)v+=2;d[f++]=m,d[f++]=g,p=v}for(d.length=f;c>i;){var b,y=u[i+2]||l,w=d[e+2]||l,v=Math.min(y,w),x=u[i+1];if(1!==x.nodeType&&(b=o.substring(r,v))){a&&(b=b.replace(n,"\r")),x.nodeValue=b;var $=x.ownerDocument,S=$.createElement("SPAN");S.className=d[e+1];var C=x.parentNode;C.replaceChild(S,x),S.appendChild(x),y>r&&(u[i+1]=x=$.createTextNode(o.substring(v,y)),C.insertBefore(x,S.nextSibling))}r=v,r>=y&&(i+=2),r>=w&&(e+=2)}}catch(k){"console"in window&&console.log(k&&k.stack?k.stack:k)}}var u=["break,continue,do,else,for,if,return,while"],c=[[u,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[c,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],h=[c,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],f=[h,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],c=[c,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],p=[u,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],m=[u,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[u,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],g=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,v=/\S/,b=i({keywords:[d,f,c,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+p,m,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),y={};o(b,["default-code"]),o(r([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),o(r([["pln",/^\s+/,q," \r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]),o(r([],[["atv",/^[\S\s]+/]]),["uq.val"]),o(i({keywords:d,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),o(i({keywords:"null,true,false"}),["json"]),o(i({keywords:f,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),o(i({keywords:h,cStyleComments:!0}),["java"]),o(i({keywords:u,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]),o(i({keywords:p,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]),o(i({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]),o(i({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]),o(i({keywords:c,cStyleComments:!0,regexLiterals:!0}),["js"]),o(i({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),o(r([],[["str",/^[\S\s]+/]]),["regex"]),window.prettyPrintOne=function(e,t,n){var r=document.createElement("PRE");return r.innerHTML=e,n&&a(r,n),l({g:t,i:n,h:r}),r.innerHTML},window.prettyPrint=function(e){function t(){for(var n=window.PR_SHOULD_USE_CONTINUATION?u.now()+250:1/0;d<r.length&&u.now()<n;d++){var i=r[d],o=i.className;if(o.indexOf("prettyprint")>=0){var s,f,o=o.match(h);if(f=!o){f=i;for(var p=void 0,m=f.firstChild;m;m=m.nextSibling)var g=m.nodeType,p=1===g?p?f:m:3===g&&v.test(m.nodeValue)?f:p;f=(s=p===f?void 0:p)&&"CODE"===s.tagName}for(f&&(o=s.className.match(h)),o&&(o=o[1]),f=!1,p=i.parentNode;p;p=p.parentNode)if(("pre"===p.tagName||"code"===p.tagName||"xmp"===p.tagName)&&p.className&&p.className.indexOf("prettyprint")>=0){f=!0;break}f||((f=(f=i.className.match(/\blinenums\b(?::(\d+))?/))?f[1]&&f[1].length?+f[1]:!0:!1)&&a(i,f),c={g:o,h:i,i:f},l(c))}}d<r.length?setTimeout(t,250):e&&e()}for(var n=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],r=[],i=0;i<n.length;++i)for(var o=0,s=n[i].length;s>o;++o)r.push(n[i][o]);var n=q,u=Date;u.now||(u={now:function(){return+new Date}});var c,d=0,h=/\blang(?:uage)?-([\w.]+)(?!\S)/;t()},window.PR={createSimpleLexer:r,registerLangHandler:o,sourceDecorator:i,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}}(),!function(e){e(function(){window.prettyPrint&&prettyPrint()})}(window.jQuery),$(document).on("page:load ready",function(){$(".response").click(function(){var e=$(this).data("response_type");$(".response").removeClass("active"),$(".response-"+e).addClass("active"),$(".format").hide(),$(".format-"+e).show()})}),$(document).on("page:load ready",function(){$(".flash").length>0&&($(".flash").on("click",function(){$(this).hide("slow")}),setTimeout(function(){$(".flash").length>0&&$(".flash").hide("slow")},15e3)),$("#talkback_command_add").click(function(){$(this).hide(),$("#talkback_command_add_form").removeClass("hide")}),$("#contact_link").click(function(){$("#contact_form").toggle()}),$(".tablesorter").tablesorter(),$("#userlogin_js").val("6H2W6QYUAJT1Q8EB")}); |