2 lines
62 KiB
JavaScript
2 lines
62 KiB
JavaScript
function reloadCharts(){return-1===navigator.userAgent.toLowerCase().indexOf("firefox")?!1:($('.ui-widget-content [aria-expanded="false"]').find("iframe").each(function(){var t=$(this).attr("src");-1!==t.indexOf("charts")&&($(this).hide(),$(this).attr("src",t),$(this).show())}),void 0)}function openDialogCenter(t){t.dialog("open");var e=getDimensions(t.parent());t.dialog({position:[e[0],e[1]]})}function getDimensions(t){var e=new Array(2);return e[0]=$(window).width()/2-t.width()/2,e[1]=$(window).height()/2-t.height()/2,e}function updateChart(t,e,n,r,a,i){var n=n,r=r,o=$("#iframe"+t).attr("default_src");o||(o=$("#iframe"+t).attr("src")),src=o.split("?")[0],("bar"===$("#type_"+t).val()||"column"===$("#type_"+t).val())&&0==$("#timescale_"+t).val().length&&0==$("#average_"+t).val().length&&0==$("#median_"+t).val().length&&0==$("#sum_"+t).val().length&&$("#timescale_"+t).val(30);var s=[];$(".chart_options"+t).each(function(){var t=$(this).val(),e=$(this).attr("id"),n=e.split("_")[0];t.length>0&&s.push([n,t])});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)),e&&t>0&&i?$.update("/channels/"+a+"/charts/"+t,{newOptions:{options:l}}):e&&t>0&&$.update("/channels/"+a+"/charts/"+t,{options:l}),$("#embed"+t).val('<iframe width="'+n+'" height="'+r+'" style="border: 1px solid #cccccc;" src="'+src+'"></iframe>'),$("#iframe"+t).attr("src",src),$("#iframe"+t).attr("width",n),$("#iframe"+t).attr("height",r)}function updateSelectValues(){selectedValue=$(this).val(),$(".mutuallyexclusive"+index).each(function(){$(this).val("")}),$(this).val(selectedValue)}function setupChartForm(t){return function(e,n){n.length>0&&$("#"+n.split("=")[0]+"_"+t).val(decodeURIComponent(n.split("=")[1]))}}function setupColumns(t,e){$(sortColumnSetup(t,e)),$(".column").disableSelection()}function createWindowsWithData(t,e,n,r){for(var a in t){var i=t[a].window,o=i.window_type;colId=i.col,title=i.title;var s=i.html;"chart"===i.window_type&&$("body").append("<div id='chartConfig"+i.id+"'></div>");var l=addWindow(r,colId,i.id,o,title,s);l.each(decoratePortlet(e)),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(t,e,n,r,a,i){if($("#"+t+"_dialog"+e).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">'+a+'</div><div class="portlet-content">'+i+"</div>"),$("#portlet_"+n).length>1)throw"Portlet count doesn't match what's expected";return $("#portlet_"+n)}function sortColumnSetup(t,e){$(".column").sortable({opacity:.6,helper:function(){return $("<div class='ui-widget-header'>Drop to re-position</div>")},connectWith:".column",update:updatePortletPositions(t,e)})}function getPortletArray(t){var e=new Array,n=t.split("&");for(i in n)val=n[i].split("=")[1],e.push(val);return e}function uiToggleClick(){$(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick"),$(this).parents(".portlet:first").find(".portlet-content").toggle()}!function(t,e){t.rails!==e&&t.error("jquery-ujs has already been loaded!");var n,r=t(document);t.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(e){var n=t('meta[name="csrf-token"]').attr("content");n&&e.setRequestHeader("X-CSRF-Token",n)},fire:function(e,n,r){var a=t.Event(n);return e.trigger(a,r),a.result!==!1},confirm:function(t){return confirm(t)},ajax:function(e){return t.ajax(e)},href:function(t){return t.attr("href")},handleRemote:function(r){var a,i,o,s,l,u,c,d;if(n.fire(r,"ajax:before")){if(s=r.data("cross-domain"),l=s===e?null:s,u=r.data("with-credentials")||null,c=r.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType,r.is("form")){a=r.attr("method"),i=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)?(a=r.data("method"),i=r.data("url"),o=r.serialize(),r.data("params")&&(o=o+"&"+r.data("params"))):r.is(n.buttonClickSelector)?(a=r.data("method")||"get",i=r.data("url"),o=r.serialize(),r.data("params")&&(o=o+"&"+r.data("params"))):(a=r.data("method"),i=n.href(r),o=r.data("params")||null);d={type:a||"GET",data:o,dataType:c,beforeSend:function(t,a){return a.dataType===e&&t.setRequestHeader("accept","*/*;q=0.5, "+a.accepts.script),n.fire(r,"ajax:beforeSend",[t,a])},success:function(t,e,n){r.trigger("ajax:success",[t,e,n])},complete:function(t,e){r.trigger("ajax:complete",[t,e])},error:function(t,e,n){r.trigger("ajax:error",[t,e,n])},crossDomain:l},u&&(d.xhrFields={withCredentials:u}),i&&(d.url=i);var f=n.ajax(d);return r.trigger("ajax:send",f),f}return!1},handleMethod:function(r){var a=n.href(r),i=r.data("method"),o=r.attr("target"),s=t("meta[name=csrf-token]").attr("content"),l=t("meta[name=csrf-param]").attr("content"),u=t('<form method="post" action="'+a+'"></form>'),c='<input name="_method" value="'+i+'" type="hidden" />';l!==e&&s!==e&&(c+='<input name="'+l+'" value="'+s+'" type="hidden" />'),o&&u.attr("target",o),u.hide().append(c).appendTo("body"),u.submit()},disableFormElements:function(e){e.find(n.disableSelector).each(function(){var e=t(this),n=e.is("button")?"html":"val";e.data("ujs:enable-with",e[n]()),e[n](e.data("disable-with")),e.prop("disabled",!0)})},enableFormElements:function(e){e.find(n.enableSelector).each(function(){var e=t(this),n=e.is("button")?"html":"val";e.data("ujs:enable-with")&&e[n](e.data("ujs:enable-with")),e.prop("disabled",!1)})},allowAction:function(t){var e,r=t.data("confirm"),a=!1;return r?(n.fire(t,"confirm")&&(a=n.confirm(r),e=n.fire(t,"confirm:complete",[a])),a&&e):!0},blankInputs:function(e,n,r){var a,i,o=t(),s=n||"input,textarea",l=e.find(s);return l.each(function(){if(a=t(this),i=a.is("input[type=checkbox],input[type=radio]")?a.is(":checked"):a.val(),!i==!r){if(a.is("input[type=radio]")&&l.filter('input[type=radio]:checked[name="'+a.attr("name")+'"]').length)return!0;o=o.add(a)}}),o.length?o:!1},nonBlankInputs:function(t,e){return n.blankInputs(t,e,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(t){t.data("ujs:enable-with",t.html()),t.html(t.data("disable-with")),t.bind("click.railsDisable",function(t){return n.stopEverything(t)})},enableElement:function(t){t.data("ujs:enable-with")!==e&&(t.html(t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.unbind("click.railsDisable")}},n.fire(r,"rails:attachBindings")&&(t.ajaxPrefilter(function(t,e,r){t.crossDomain||n.CSRFProtection(r)}),r.delegate(n.linkDisableSelector,"ajax:complete",function(){n.enableElement(t(this))}),r.delegate(n.linkClickSelector,"click.rails",function(r){var a=t(this),i=a.data("method"),o=a.data("params");if(!n.allowAction(a))return n.stopEverything(r);if(a.is(n.linkDisableSelector)&&n.disableElement(a),a.data("remote")!==e){if(!(!r.metaKey&&!r.ctrlKey||i&&"GET"!==i||o))return!0;var s=n.handleRemote(a);return s===!1?n.enableElement(a):s.error(function(){n.enableElement(a)}),!1}return a.data("method")?(n.handleMethod(a),!1):void 0}),r.delegate(n.buttonClickSelector,"click.rails",function(e){var r=t(this);return n.allowAction(r)?(n.handleRemote(r),!1):n.stopEverything(e)}),r.delegate(n.inputChangeSelector,"change.rails",function(e){var r=t(this);return n.allowAction(r)?(n.handleRemote(r),!1):n.stopEverything(e)}),r.delegate(n.formSubmitSelector,"submit.rails",function(r){var a=t(this),i=a.data("remote")!==e,o=n.blankInputs(a,n.requiredInputSelector),s=n.nonBlankInputs(a,n.fileInputSelector);if(!n.allowAction(a))return n.stopEverything(r);if(o&&a.attr("novalidate")==e&&n.fire(a,"ajax:aborted:required",[o]))return n.stopEverything(r);if(i){if(s){setTimeout(function(){n.disableFormElements(a)},13);var l=n.fire(a,"ajax:aborted:file",[s]);return l||setTimeout(function(){n.enableFormElements(a)},13),l}return n.handleRemote(a),!1}setTimeout(function(){n.disableFormElements(a)},13)}),r.delegate(n.formInputClickSelector,"click.rails",function(e){var r=t(this);if(!n.allowAction(r))return n.stopEverything(e);var a=r.attr("name"),i=a?{name:a,value:r.val()}:null;r.closest("form").data("ujs:submit-button",i)}),r.delegate(n.formSubmitSelector,"ajax:beforeSend.rails",function(e){this==e.target&&n.disableFormElements(t(this))}),r.delegate(n.formSubmitSelector,"ajax:complete.rails",function(e){this==e.target&&n.enableFormElements(t(this))}),t(function(){var e=t("meta[name=csrf-token]").attr("content"),n=t("meta[name=csrf-param]").attr("content");t('form input[name="'+n+'"]').val(e)}))}(jQuery),function(){var t,e,n,r,a,i,o,s,l,u,c,d,h,f,p,m,g,v,b,y,w,x,S,$,k,C,T,E,_,N,I,L,F,A,P,R,j,O,D,H,q,M,B,z,V,W,U,G,Q,X=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},Y={}.hasOwnProperty,K=function(t,e){function n(){this.constructor=t}for(var r in e)Y.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},Z=[].slice;_={},d=10,z=!1,m=null,E=null,P=null,p=null,G=null,y=function(t){var e;return t=new n(t),H(),c(),R(t),z&&(e=V(t.absolute))?(w(e),x(t)):x(t,B)},V=function(t){var e;return e=_[t],e&&!e.transitionCacheDisabled?e:void 0},g=function(t){return null==t&&(t=!0),z=t},x=function(t,e){return null==e&&(e=function(){}),W("page:fetch",{url:t.absolute}),null!=G&&G.abort(),G=new XMLHttpRequest,G.open("GET",t.withoutHashForIE10compatibility(),!0),G.setRequestHeader("Accept","text/html, application/xhtml+xml, application/xml"),G.setRequestHeader("X-XHR-Referer",P),G.onload=function(){var n;return W("page:receive"),(n=F())?(h.apply(null,b(n)),j(),e(),W("page:load")):document.location.href=t.absolute},G.onloadend=function(){return G=null},G.onerror=function(){return document.location.href=t.absolute},G.send()},w=function(t){return null!=G&&G.abort(),h(t.title,t.body),A(t),W("page:restore")},c=function(){var t;return t=new n(m.url),_[t.absolute]={url:t.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]")},f(d)},I=function(t){return null==t&&(t=d),/^[\d]+$/.test(t)?d=parseInt(t):void 0},f=function(t){var e,n,r,a,i,o;for(r=Object.keys(_),e=r.map(function(t){return _[t].cachedAt}).sort(function(t,e){return e-t}),o=[],a=0,i=r.length;i>a;a++)n=r[a],_[n].cachedAt<=e[t]&&(W("page:expire",_[n]),o.push(delete _[n]));return o},h=function(e,n,r,a){return document.title=e,document.documentElement.replaceChild(n,document.body),null!=r&&t.update(r),a&&v(),m=window.history.state,W("page:change"),W("page:update")},v=function(){var t,e,n,r,a,i,o,s,l,u,c,d;for(i=Array.prototype.slice.call(document.body.querySelectorAll('script:not([data-turbolinks-eval="false"])')),o=0,l=i.length;l>o;o++)if(a=i[o],""===(c=a.type)||"text/javascript"===c){for(e=document.createElement("script"),d=a.attributes,s=0,u=d.length;u>s;s++)t=d[s],e.setAttribute(t.name,t.value);e.appendChild(document.createTextNode(a.innerHTML)),r=a.parentNode,n=a.nextSibling,r.removeChild(a),r.insertBefore(e,n)}},q=function(t){return t.innerHTML=t.innerHTML.replace(/<noscript[\S\s]*?<\/noscript>/gi,""),t},R=function(t){return(t=new n(t)).absolute!==P?window.history.pushState({turbolinks:!0,url:t.absolute},"",t.absolute):void 0},j=function(){var t,e;return(t=G.getResponseHeader("X-XHR-Redirected-To"))?(t=new n(t),e=t.hasNoHash()?document.location.hash:"",window.history.replaceState(m,"",t.href+e)):void 0},H=function(){return P=document.location.href},D=function(){return window.history.replaceState({turbolinks:!0,url:document.location.href},"",document.location.href)},O=function(){return m=window.history.state},A=function(t){return window.scrollTo(t.positionX,t.positionY)},B=function(){return document.location.hash?document.location.href=document.location.href:window.scrollTo(0,0)},L=function(t){var e,n;return e=(null!=(n=document.cookie.match(new RegExp(t+"=(\\w+)")))?n[1].toUpperCase():void 0)||"",document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/",e},W=function(t,e){var n;return n=document.createEvent("Events"),e&&(n.data=e),n.initEvent(t,!0,!0),document.dispatchEvent(n)},N=function(){return!W("page:before-change")},F=function(){var t,e,n,r,a,i;return e=function(){var t;return 400<=(t=G.status)&&600>t},i=function(){return G.getResponseHeader("Content-Type").match(/^(?:text\/html|application\/xhtml\+xml|application\/xml)(?:;|$)/)},r=function(t){var e,n,r,a,i;for(a=t.head.childNodes,i=[],n=0,r=a.length;r>n;n++)e=a[n],null!=("function"==typeof e.getAttribute?e.getAttribute("data-turbolinks-track"):void 0)&&i.push(e.getAttribute("src")||e.getAttribute("href"));return i},t=function(t){var e;return E||(E=r(document)),e=r(t),e.length!==E.length||a(e,E).length!==E.length},a=function(t,e){var n,r,a,i,o;for(t.length>e.length&&(i=[e,t],t=i[0],e=i[1]),o=[],r=0,a=t.length;a>r;r++)n=t[r],X.call(e,n)>=0&&o.push(n);return o},!e()&&i()&&(n=p(G.responseText),n&&!t(n))?n:void 0},b=function(e){var n;return n=e.querySelector("title"),[null!=n?n.textContent:void 0,q(e.body),t.get(e).token,"runScripts"]},t={get:function(t){var e;return null==t&&(t=document),{node:e=t.querySelector('meta[name="csrf-token"]'),token:null!=e?"function"==typeof e.getAttribute?e.getAttribute("content"):void 0:void 0}},update:function(t){var e;return e=this.get(),null!=e.token&&null!=t&&e.token!==t?e.node.setAttribute("content",t):void 0}},a=function(){var t,e,n,r,a,i;e=function(t){return(new DOMParser).parseFromString(t,"text/html")},t=function(t){var e;return e=document.implementation.createHTMLDocument(""),e.documentElement.innerHTML=t,e},n=function(t){var e;return e=document.implementation.createHTMLDocument(""),e.open("replace"),e.write(t),e.close(),e};try{if(window.DOMParser)return a=e("<html><body><p>test"),e}catch(o){return r=o,a=t("<html><body><p>test"),t}finally{if(1!==(null!=a?null!=(i=a.body)?i.childNodes.length:void 0:void 0))return n}},n=function(){function t(e){return this.original=null!=e?e:document.location.href,this.original.constructor===t?this.original:(this._parse(),void 0)}return t.prototype.withoutHash=function(){return this.href.replace(this.hash,"")},t.prototype.withoutHashForIE10compatibility=function(){return this.withoutHash()},t.prototype.hasNoHash=function(){return 0===this.hash.length},t.prototype._parse=function(){var t;return(null!=this.link?this.link:this.link=document.createElement("a")).href=this.original,t=this.link,this.href=t.href,this.protocol=t.protocol,this.host=t.host,this.hostname=t.hostname,this.port=t.port,this.pathname=t.pathname,this.search=t.search,this.hash=t.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},t}(),r=function(t){function e(t){return this.link=t,this.link.constructor===e?this.link:(this.original=this.link.href,e.__super__.constructor.apply(this,arguments),void 0)}return K(e,t),e.HTML_EXTENSIONS=["html"],e.allowExtensions=function(){var t,n,r,a;for(n=1<=arguments.length?Z.call(arguments,0):[],r=0,a=n.length;a>r;r++)t=n[r],e.HTML_EXTENSIONS.push(t);return e.HTML_EXTENSIONS},e.prototype.shouldIgnore=function(){return this._crossOrigin()||this._anchored()||this._nonHtml()||this._optOut()||this._target()},e.prototype._crossOrigin=function(){return this.origin!==(new n).origin},e.prototype._anchored=function(){var t;return(this.hash&&this.withoutHash())===(t=new n).withoutHash()||this.href===t.href+"#"},e.prototype._nonHtml=function(){return this.pathname.match(/\.[a-z]+$/g)&&!this.pathname.match(new RegExp("\\.(?:"+e.HTML_EXTENSIONS.join("|")+")?$","g"))},e.prototype._optOut=function(){var t,e;for(e=this.link;!t&&e!==document;)t=null!=e.getAttribute("data-no-turbolink"),e=e.parentNode;return t},e.prototype._target=function(){return 0!==this.link.target.length},e}(n),e=function(){function t(t){this.event=t,this.event.defaultPrevented||(this._extractLink(),this._validForTurbolinks()&&(N()||U(this.link.href),this.event.preventDefault()))}return t.installHandlerLast=function(e){return e.defaultPrevented?void 0:(document.removeEventListener("click",t.handle,!1),document.addEventListener("click",t.handle,!1))},t.handle=function(e){return new t(e)},t.prototype._extractLink=function(){var t;for(t=this.event.target;t.parentNode&&"A"!==t.nodeName;)t=t.parentNode;return"A"===t.nodeName&&0!==t.href.length?this.link=new r(t):void 0},t.prototype._validForTurbolinks=function(){return null!=this.link&&!(this.link.shouldIgnore()||this._nonStandardClick())},t.prototype._nonStandardClick=function(){return this.event.which>1||this.event.metaKey||this.event.ctrlKey||this.event.shiftKey||this.event.altKey},t}(),u=function(t){return setTimeout(t,500)},k=function(){return document.addEventListener("DOMContentLoaded",function(){return W("page:change"),W("page:update")},!0)},T=function(){return"undefined"!=typeof jQuery?jQuery(document).on("ajaxSuccess",function(t,e){return jQuery.trim(e.responseText)?W("page:update"):void 0}):void 0},C=function(t){var e,r;return(null!=(r=t.state)?r.turbolinks:void 0)?(e=_[new n(t.state.url).absolute])?(c(),w(e)):U(t.target.location.href):void 0},$=function(){return D(),O(),p=a(),document.addEventListener("click",e.installHandlerLast,!0),u(function(){return window.addEventListener("popstate",C,!1)})},S=void 0!==window.history.state||navigator.userAgent.match(/Firefox\/2[6|7]/),s=window.history&&window.history.pushState&&window.history.replaceState&&S,i=!navigator.userAgent.match(/CriOS\//),M="GET"===(Q=L("request_method"))||""===Q,l=s&&i&&M,o=document.addEventListener&&document.createEvent,o&&(k(),T()),l?(U=y,$()):U=function(t){return document.location.href=t},this.Turbolinks={visit:U,pagesCached:I,enableTransitionCache:g,allowLinkExtensions:r.allowExtensions,supported:l}}.call(this),function(t){t.cookie=function(e,n,r){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(n))||null===n||void 0===n)){if(r=t.extend({},r),(null===n||void 0===n)&&(r.expires=-1),"number"==typeof r.expires){var a=r.expires,i=r.expires=new Date;i.setDate(i.getDate()+a)}return n=String(n),document.cookie=[encodeURIComponent(e),"=",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(t){return t}:decodeURIComponent,l=document.cookie.split("; "),u=0;o=l[u]&&l[u].split("=");u++)if(s(o[0])===e)return s(o[1]||"");return null}}(jQuery);var createWindows=function(t,e,n){return function(r){createWindowsWithData(r,t,e,n)}},updatePortletPositions=function(t,e){return function(){if(t){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/"+e+"/windows",data:{_method:"PUT",page:JSON.stringify(jsonResult)},dataType:"json"})}}},decoratePortlet=function(t){return function(){var e=$(this).find(".portlet-header");return e.append("<span id='commentBtn' class='ui-view ui-icon ui-icon-comment'></span>"),thisObject=$(this),"true"==t?(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(t){return function(){var e=$(this).parents(".portlet:first").attr("id").substring(8),n="";$("#chartConfig"+e).load("/channels/"+t+"/charts/"+e+"/edit",function(){n=$("#chartOptions"+e).html(),"undefined"!=n&&n.length>2&&$.each(n.split("&"),setupChartForm(e)),$("#button"+e).click(function(){updateChart(e,!0,450,250,t,!0),$("#chartConfig"+e).dialog("close")})}).dialog({title:"Chart Options",modal:!0,resizable:!1,width:500,dialogClass:"dev-info-dialog"})}},uiViewClick=function(t){return function(){var e=$(this).parents(".portlet:first").find(".portlet-content").offset().left,n=$(this).parents(".portlet:first").find(".portlet-content").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/"+t+"/windows/"+r+"/iframe",function(t){var e=t.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(e)}),$("#iframepopup"+r).dialog({resizable:!1,width:"300px",position:[e+200,n-200],title:"Chart Iframe",dialogClass:"dev-info-dialog"})}},uiCloseClick=function(t){return function(){var e=$(this).parents(".portlet:first").attr("id").substring(8),n=$(this).parents(".portlet:first");$.update("/channels/"+t+"/windows/"+e+"/hide",function(){n.hide("drop",function(){n.remove()})})}};!function(t){function e(){var e=n(this);return isNaN(e.datetime)||t(this).text(r(e.datetime)),this}function n(e){if(e=t(e),!e.data("timeago")){e.data("timeago",{datetime:i.datetime(e)});var n=t.trim(e.text());n.length>0&&e.attr("title",n)}return e.data("timeago")}function r(t){return i.inWords(a(t))}function a(t){return(new Date).getTime()-t.getTime()}t.timeago=function(e){return e instanceof Date?r(e):"string"==typeof e?r(t.timeago.parse(e)):r(t.timeago.datetime(e))};var i=t.timeago;t.extend(t.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(e){function n(n,a){var i=t.isFunction(n)?n(a,e):n,o=r.numbers&&r.numbers[a]||a;return i.replace(/%d/i,o)}var r=this.settings.strings,a=r.prefixAgo,i=r.suffixAgo;this.settings.allowFuture&&(0>e&&(a=r.prefixFromNow,i=r.suffixFromNow),e=Math.abs(e));var o=e/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 t.trim([a,d,i].join(" "))},parse:function(e){var n=t.trim(e);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(e){var n="time"===t(e).get(0).tagName.toLowerCase(),r=n?t(e).attr("datetime"):t(e).attr("title");return i.parse(r)}}),t.fn.timeago=function(){var t=this;t.each(e);var n=i.settings;return n.refreshMillis>0&&setInterval(function(){t.each(e)},n.refreshMillis),t},document.createElement("abbr"),document.createElement("time")}(jQuery),function($){$.extend({tablesorter:new function(){function benchmark(t,e){log(t+","+((new Date).getTime()-e.getTime())+"ms")}function log(t){"undefined"!=typeof console&&"undefined"!=typeof console.debug?console.log(t):alert(t)}function buildParserCache(t,e){if(t.config.debug)var n="";if(0!=t.tBodies.length){var r=t.tBodies[0].rows;if(r[0])for(var a=[],i=r[0].cells,o=i.length,s=0;o>s;s++){var l=!1;$.metadata&&$(e[s]).metadata()&&$(e[s]).metadata().sorter?l=getParserById($(e[s]).metadata().sorter):t.config.headers[s]&&t.config.headers[s].sorter&&(l=getParserById(t.config.headers[s].sorter)),l||(l=detectParserForColumn(t,r,-1,s)),t.config.debug&&(n+="column:"+s+" parser:"+l.id+"\n"),a.push(l)}return t.config.debug&&log(n),a}}function detectParserForColumn(t,e,n,r){for(var a=parsers.length,i=!1,o=!1,s=!0;""==o&&s;)n++,e[n]?(i=getNodeFromRowAndCellIndex(e,n,r),o=trimAndGetNodeText(t.config,i),t.config.debug&&log("Checking if value was empty on row:"+n)):s=!1;for(var l=1;a>l;l++)if(parsers[l].is(o,t,i))return parsers[l];return parsers[0]}function getNodeFromRowAndCellIndex(t,e,n){return t[e].cells[n]}function trimAndGetNodeText(t,e){return $.trim(getElementText(t,e))}function getParserById(t){for(var e=parsers.length,n=0;e>n;n++)if(parsers[n].id.toLowerCase()==t.toLowerCase())return parsers[n];return!1}function buildCache(t){if(t.config.debug)var e=new Date;for(var n=t.tBodies[0]&&t.tBodies[0].rows.length||0,r=t.tBodies[0].rows[0]&&t.tBodies[0].rows[0].cells.length||0,a=t.config.parsers,i={row:[],normalized:[]},o=0;n>o;++o){var s=$(t.tBodies[0].rows[o]),l=[];if(s.hasClass(t.config.cssChildRow))i.row[i.row.length-1]=i.row[i.row.length-1].add(s);else{i.row.push(s);for(var u=0;r>u;++u)l.push(a[u].format(getElementText(t.config,s[0].cells[u]),t,s[0].cells[u]));l.push(i.normalized.length),i.normalized.push(l),l=null}}return t.config.debug&&benchmark("Building cache for "+n+" rows:",e),i}function getElementText(t,e){var n="";return e?(t.supportsTextContent||(t.supportsTextContent=e.textContent||!1),n="simple"==t.textExtraction?t.supportsTextContent?e.textContent:e.childNodes[0]&&e.childNodes[0].hasChildNodes()?e.childNodes[0].innerHTML:e.innerHTML:"function"==typeof t.textExtraction?t.textExtraction(e):$(e).text()):""}function appendToTable(t,e){if(t.config.debug)var n=new Date;for(var r=e,a=r.row,i=r.normalized,o=i.length,s=i[0].length-1,l=$(t.tBodies[0]),u=[],c=0;o>c;c++){var d=i[c][s];if(u.push(a[d]),!t.config.appender)for(var h=a[d].length,f=0;h>f;f++)l[0].appendChild(a[d][f])}t.config.appender&&t.config.appender(t,u),u=null,t.config.debug&&benchmark("Rebuilt table:",n),applyWidget(t),setTimeout(function(){$(t).trigger("sortEnd")},0)}function buildHeaders(t){if(t.config.debug)var e=new Date;var n=($.metadata?!0:!1,computeTableHeaderCellIndexes(t));return $tableHeaders=$(t.config.selectorHeaders,t).each(function(e){if(this.column=n[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=formatSortingOrder(t.config.sortInitialOrder),this.count=this.order,(checkHeaderMetadata(this)||checkHeaderOptions(t,e))&&(this.sortDisabled=!0),checkHeaderOptionsSortingLocked(t,e)&&(this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(t,e)),!this.sortDisabled){var r=$(this).addClass(t.config.cssHeader);t.config.onRenderHeader&&t.config.onRenderHeader.apply(r)}t.config.headerList[e]=this}),t.config.debug&&(benchmark("Built headers:",e),log($tableHeaders)),$tableHeaders}function computeTableHeaderCellIndexes(t){for(var e=[],n={},r=t.getElementsByTagName("THEAD")[0],a=r.getElementsByTagName("TR"),i=0;i<a.length;i++)for(var o=a[i].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 e[c]&&(e[c]=[]);for(var p=0;p<e[c].length+1;p++)if("undefined"==typeof e[c][p]){l=p;break}n[d]=l;for(var p=c;c+h>p;p++){"undefined"==typeof e[p]&&(e[p]=[]);for(var m=e[p],g=l;l+f>g;g++)m[g]="x"}}return n}function checkCellColSpan(t,e,n){for(var r=[],a=t.tHead.rows,i=a[n].cells,o=0;o<i.length;o++){var s=i[o];s.colSpan>1?r=r.concat(checkCellColSpan(t,headerArr,n++)):(1==t.tHead.length||s.rowSpan>1||!a[n+1])&&r.push(s)}return r}function checkHeaderMetadata(t){return $.metadata&&$(t).metadata().sorter===!1?!0:!1}function checkHeaderOptions(t,e){return t.config.headers[e]&&t.config.headers[e].sorter===!1?!0:!1}function checkHeaderOptionsSortingLocked(t,e){return t.config.headers[e]&&t.config.headers[e].lockedOrder?t.config.headers[e].lockedOrder:!1}function applyWidget(t){for(var e=t.config.widgets,n=e.length,r=0;n>r;r++)getWidgetById(e[r]).format(t)}function getWidgetById(t){for(var e=widgets.length,n=0;e>n;n++)if(widgets[n].id.toLowerCase()==t.toLowerCase())return widgets[n]}function formatSortingOrder(t){return"Number"!=typeof t?"desc"==t.toLowerCase()?1:0:1==t?1:0}function isValueInArray(t,e){for(var n=e.length,r=0;n>r;r++)if(e[r][0]==t)return!0;return!1}function setHeadersCss(t,e,n,r){e.removeClass(r[0]).removeClass(r[1]);var a=[];e.each(function(){this.sortDisabled||(a[this.column]=$(this))});for(var i=n.length,o=0;i>o;o++)a[n[o][0]].addClass(r[n[o][1]])}function fixColumnWidth(t){var e=t.config;if(e.widthFixed){var n=$("<colgroup>");$("tr:first td",t.tBodies[0]).each(function(){n.append($("<col>").css("width",$(this).width()))}),$(t).prepend(n)}}function updateHeaderSortCount(t,e){for(var n=t.config,r=e.length,a=0;r>a;a++){var i=e[a],o=n.headerList[i[0]];o.count=i[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(t,e,n){var r="a["+n+"]",a="b["+n+"]";return"text"==t&&"asc"==e?"("+r+" == "+a+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+a+" === null ? Number.NEGATIVE_INFINITY : ("+r+" < "+a+") ? -1 : 1 )));":"text"==t&&"desc"==e?"("+r+" == "+a+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+a+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+r+") ? -1 : 1 )));":"numeric"==t&&"asc"==e?"("+r+" === null && "+a+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+a+" === null ? Number.NEGATIVE_INFINITY : "+r+" - "+a+"));":"numeric"==t&&"desc"==e?"("+r+" === null && "+a+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+a+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+r+"));":void 0}function makeSortText(t){return"((a["+t+"] < b["+t+"]) ? -1 : ((a["+t+"] > b["+t+"]) ? 1 : 0));"}function makeSortTextDesc(t){return"((b["+t+"] < a["+t+"]) ? -1 : ((b["+t+"] > a["+t+"]) ? 1 : 0));"}function makeSortNumeric(t){return"a["+t+"]-b["+t+"];"}function makeSortNumericDesc(t){return"b["+t+"]-a["+t+"];"}function sortText(t,e){return table.config.sortLocaleCompare?t.localeCompare(e):e>t?-1:t>e?1:0}function sortTextDesc(t,e){return table.config.sortLocaleCompare?e.localeCompare(t):t>e?-1:e>t?1:0}function sortNumeric(t,e){return t-e}function sortNumericDesc(t,e){return e-t}function getCachedSortType(t,e){return t[e].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(t){return this.each(function(){if(this.tHead&&this.tBodies){var e,n,r,a;this.config={},a=$.extend(this.config,$.tablesorter.defaults,t),e=$(this),$.data(this,"tablesorter",a),n=buildHeaders(this),this.config.parsers=buildParserCache(this,n),r=buildCache(this);var i=[a.cssDesc,a.cssAsc];
|
||
fixColumnWidth(this),n.click(function(t){var o=e[0].tBodies[0]&&e[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&o>0){e.trigger("sortStart");var s=($(this),this.column);if(this.order=this.count++%2,this.lockedOrder&&(this.order=this.lockedOrder),t[a.sortMultiSortKey])if(isValueInArray(s,a.sortList))for(var l=0;l<a.sortList.length;l++){var u=a.sortList[l],c=a.headerList[u[0]];u[0]==s&&(c.count=u[1],c.count++,u[1]=c.count%2)}else a.sortList.push([s,this.order]);else{if(a.sortList=[],null!=a.sortForce)for(var d=a.sortForce,l=0;l<d.length;l++)d[l][0]!=s&&a.sortList.push(d[l]);a.sortList.push([s,this.order])}return setTimeout(function(){setHeadersCss(e[0],n,a.sortList,i),appendToTable(e[0],multisort(e[0],a.sortList,r))},1),!1}}).mousedown(function(){return a.cancelSelection?(this.onselectstart=function(){return!1},!1):void 0}),e.bind("update",function(){var t=this;setTimeout(function(){t.config.parsers=buildParserCache(t,n),r=buildCache(t)},1)}).bind("updateCell",function(t,e){var n=this.config,a=[e.parentNode.rowIndex-1,e.cellIndex];r.normalized[a[0]][a[1]]=n.parsers[a[1]].format(getElementText(n,e),e)}).bind("sorton",function(t,e){$(this).trigger("sortStart"),a.sortList=e;var o=a.sortList;updateHeaderSortCount(this,o),setHeadersCss(this,n,o,i),appendToTable(this,multisort(this,o,r))}).bind("appendCache",function(){appendToTable(this,r)}).bind("applyWidgetId",function(t,e){getWidgetById(e).format(this)}).bind("applyWidgets",function(){applyWidget(this)}),$.metadata&&$(this).metadata()&&$(this).metadata().sortlist&&(a.sortList=$(this).metadata().sortlist),a.sortList.length>0&&e.trigger("sorton",[a.sortList]),applyWidget(this)}})},this.addParser=function(t){for(var e=parsers.length,n=!0,r=0;e>r;r++)parsers[r].id.toLowerCase()==t.id.toLowerCase()&&(n=!1);n&&parsers.push(t)},this.addWidget=function(t){widgets.push(t)},this.formatFloat=function(t){var e=parseFloat(t);return isNaN(e)?0:e},this.formatInt=function(t){var e=parseInt(t);return isNaN(e)?0:e},this.isDigit=function(t){return/^[-+]?\d*$/.test($.trim(t.replace(/[,.']/g,"")))},this.clearTableBody=function(t){function e(){for(;this.firstChild;)this.removeChild(this.firstChild)}$.browser.msie?e.apply(t.tBodies[0]):t.tBodies[0].innerHTML=""}}}),$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(){return!0},format:function(t){return $.trim(t.toLocaleLowerCase())},type:"text"}),ts.addParser({id:"digit",is:function(t,e){var n=e.config;return $.tablesorter.isDigit(t,n)},format:function(t){return $.tablesorter.formatFloat(t)},type:"numeric"}),ts.addParser({id:"currency",is:function(t){return/^[£$€?.]/.test(t)},format:function(t){return $.tablesorter.formatFloat(t.replace(new RegExp(/[£$€]/g),""))},type:"numeric"}),ts.addParser({id:"ipAddress",is:function(t){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(t)},format:function(t){for(var e=t.split("."),n="",r=e.length,a=0;r>a;a++){var i=e[a];n+=2==i.length?"0"+i:i}return $.tablesorter.formatFloat(n)},type:"numeric"}),ts.addParser({id:"url",is:function(t){return/^(https?|ftp|file):\/\/$/.test(t)},format:function(t){return jQuery.trim(t.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"}),ts.addParser({id:"isoDate",is:function(t){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(t)},format:function(t){return $.tablesorter.formatFloat(""!=t?new Date(t.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"}),ts.addParser({id:"percent",is:function(t){return/\%$/.test($.trim(t))},format:function(t){return $.tablesorter.formatFloat(t.replace(new RegExp(/%/g),""))},type:"numeric"}),ts.addParser({id:"usLongDate",is:function(t){return t.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(t){return $.tablesorter.formatFloat(new Date(t).getTime())},type:"numeric"}),ts.addParser({id:"shortDate",is:function(t){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(t)},format:function(t,e){var n=e.config;return t=t.replace(/\-/g,"/"),"us"==n.dateFormat?t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2"):"uk"==n.dateFormat?t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1"):("dd/mm/yy"==n.dateFormat||"dd-mm-yy"==n.dateFormat)&&(t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")),$.tablesorter.formatFloat(new Date(t).getTime())},type:"numeric"}),ts.addParser({id:"time",is:function(t){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(t)},format:function(t){return $.tablesorter.formatFloat(new Date("2000/01/01 "+t).getTime())},type:"numeric"}),ts.addParser({id:"metadata",is:function(){return!1},format:function(t,e,n){var r=e.config,a=r.parserMetadataName?r.parserMetadataName:"sortValue";return $(n).metadata()[a]},type:"numeric"}),ts.addWidget({id:"zebra",format:function(t){if(t.config.debug)var e=new Date;var n,r,a=-1;$("tr:visible",t.tBodies[0]).each(function(){n=$(this),n.hasClass(t.config.cssChildRow)||a++,r=a%2==0,n.removeClass(t.config.widgetZebra.css[r?0:1]).addClass(t.config.widgetZebra.css[r?1:0])}),t.config.debug&&$.tablesorter.benchmark("Applying Zebra widget",e)}})}(jQuery),function(t){window.NestedFormEvents=function(){this.addFields=t.proxy(this.addFields,this),this.removeFields=t.proxy(this.removeFields,this)},NestedFormEvents.prototype={addFields:function(e){var n=e.currentTarget,r=t(n).data("association"),a=t("#"+t(n).data("blueprint-id")),i=a.data("blueprint"),o=(t(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]&&(i=i.replace(new RegExp("(_"+s[u]+")_.+?_","g"),"$1_"+l[u]+"_"),i=i.replace(new RegExp("(\\["+s[u]+"\\])\\[.+?\\]","g"),"$1["+l[u]+"]"));var c=new RegExp("new_"+r,"g"),d=this.newId();i=t.trim(i.replace(c,d));var h=this.insertFields(i,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(e,n,r){var a=t(r).data("target");return a?t(e).appendTo(t(a)):t(e).insertBefore(r)},removeFields:function(e){var n=t(e.currentTarget),r=n.data("association"),a=n.prev("input[type=hidden]");a.val("1");var i=n.closest(".fields");return i.hide(),i.trigger({type:"nested:fieldRemoved",field:i}).trigger({type:"nested:fieldRemoved:"+r,field:i}),!1}},window.nestedFormEvents=new NestedFormEvents,t(document).delegate("form a.add_nested_fields","click",nestedFormEvents.addFields).delegate("form a.remove_nested_fields","click",nestedFormEvents.removeFields)}(jQuery),function(t){t.fn.closestChild=function(e){if(e&&""!=e){var n=[];for(n.push(this);n.length>0;)for(var r=n.shift(),a=r.children(),i=0;i<a.length;++i){var o=t(a[i]);if(o.is(e))return o;n.push(o)}}return t()}}(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(t){function e(e,r,a,i){l={dataType:"json"},1===arguments.length&&"string"!=typeof arguments[0]?(l=t.extend(l,e),"url"in l&&"data"in l&&n(l.url,l.data)):(t.isFunction(r)&&(i=a,a=r,r=null),e=n(e,r),l=t.extend(l,{url:e,data:r,success:a,error:i}))}function n(t,e){var n,r,a;for(n in e)a=e[n],r=t.replace("{"+n+"}",a),r!=t&&(t=r,delete e[n]);return t}function r(e){return e.type=e.type||"GET","string"!=typeof e.data&&null!=e.data&&(e.data=t.param(e.data)),e.data=e.data||"",t.restSetup.csrf&&!t.isEmptyObject(t.restSetup.csrf)&&(/^(get)$/i.test(e.type)||/(authenticity_token=)/i.test(e.data)||(e.data+=(e.data?"&":"")+t.restSetup.csrfParam+"="+$restSetup.csrfToken)),/^(get|post)$/i.test(e.type)||(e.data+=(e.data?"&":"")+t.restSetup.methodParam+"="+e.type.toLowerCase(),e.type="POST"),u.call(this,e)}function a(){return e.apply(this,arguments),t.extend(l,{type:"GET"}),t.ajax(l)}function i(){return e.apply(this,arguments),t.extend(l,{type:"POST"}),t.ajax(l)}function o(){return e.apply(this,arguments),t.extend(l,{type:"PUT"}),t.ajax(l)}function s(){return e.apply(this,arguments),t.extend(l,{type:"DELETE"}),t.ajax(l)}t.restSetup={methodParam:"_method"},t(document).on("page:load ready",function(){t.extend(t.restSetup,{csrfParam:t("meta[name=csrf-param]").attr("content"),csrfToken:t("meta[name=csrf-token]").attr("content")})});var l,u=t.ajax;t.extend({ajax:r,read:a,create:i,update:o,destroy:s})}(jQuery),function(t){function e(t,e,a){var i=t.scrollTop;t.setSelectionRange?n(t,e,a):document.selection&&r(t,e,a),t.scrollTop=i}function n(t,e,n){var r=t.selectionStart,a=t.selectionEnd;if(r==a)e?" "==t.value.substring(r-n.tabString.length,r)?(t.value=t.value.substring(0,r-n.tabString.length)+t.value.substring(r),t.focus(),t.setSelectionRange(r-n.tabString.length,r-n.tabString.length)):" "==t.value.substring(r,r+n.tabString.length)&&(t.value=t.value.substring(0,r)+t.value.substring(r+n.tabString.length),t.focus(),t.setSelectionRange(r,r)):(t.value=t.value.substring(0,r)+n.tabString+t.value.substring(r),t.focus(),t.setSelectionRange(r+n.tabString.length,r+n.tabString.length));else{var i=t.value.split("\n"),o=new Array,s=0,l=0;for(var u in i)l=s+i[u].length,o.push({start:s,end:l,selected:r>=s&&l>r||l>=a&&a>s||s>r&&a>l}),s=l+1;var c=0;for(var u in o)if(o[u].selected){var d=o[u].start+c;e&&n.tabString==t.value.substring(d,d+n.tabString.length)?(t.value=t.value.substring(0,d)+t.value.substring(d+n.tabString.length),c-=n.tabString.length):e||(t.value=t.value.substring(0,d)+n.tabString+t.value.substring(d),c+=n.tabString.length)}t.focus();var h=r+(c>0?n.tabString.length:0>c?-n.tabString.length:0),f=a+c;t.setSelectionRange(h,f)}}function r(e,n,r){var a=document.selection.createRange();if(e==a.parentElement())if(""==a.text)if(n){var i=a.getBookmark();a.moveStart("character",-r.tabString.length),r.tabString==a.text?a.text="":(a.moveToBookmark(i),a.moveEnd("character",r.tabString.length),r.tabString==a.text&&(a.text="")),a.collapse(!0),a.select()}else a.text=r.tabString,a.collapse(!1),a.select();else{var o=a.text,s=o.length,l=o.split("\r\n"),u=document.body.createTextRange();u.moveToElementText(e),u.setEndPoint("EndToStart",a);var c=u.text,d=c.split("\r\n"),h=c.length,f=document.body.createTextRange();f.moveToElementText(e),f.setEndPoint("StartToEnd",a);var p=f.text,m=document.body.createTextRange();m.moveToElementText(e),m.setEndPoint("StartToEnd",u);var g=m.text,v=t(e).html();t("#r3").text(h+" + "+s+" + "+p.length+" = "+v.length),h+g.length<v.length?(d.push(""),h+=2,n&&r.tabString==l[0].substring(0,r.tabString.length)?l[0]=l[0].substring(r.tabString.length):n||(l[0]=r.tabString+l[0])):n&&r.tabString==d[d.length-1].substring(0,r.tabString.length)?d[d.length-1]=d[d.length-1].substring(r.tabString.length):n||(d[d.length-1]=r.tabString+d[d.length-1]);for(var b=1;b<l.length;b++)n&&r.tabString==l[b].substring(0,r.tabString.length)?l[b]=l[b].substring(r.tabString.length):n||(l[b]=r.tabString+l[b]);1==d.length&&0==h&&(n&&r.tabString==l[0].substring(0,r.tabString.length)?l[0]=l[0].substring(r.tabString.length):n||(l[0]=r.tabString+l[0])),h+s+p.length<v.length&&(l.push(""),s+=2),u.text=d.join("\r\n"),a.text=l.join("\r\n");var y=document.body.createTextRange();y.moveToElementText(e),h>0?y.setEndPoint("StartToEnd",u):y.setEndPoint("StartToStart",u),y.setEndPoint("EndToEnd",a),y.select()}}t.fn.tabby=function(n){var r=t.extend({},t.fn.tabby.defaults,n),a=t.fn.tabby.pressed;return this.each(function(){$this=t(this);var n=t.meta?t.extend({},r,$this.data()):r;$this.bind("keydown",function(r){var i=t.fn.tabby.catch_kc(r);return 16==i&&(a.shft=!0),17==i&&(a.ctrl=!0,setTimeout("$.fn.tabby.pressed.ctrl = false;",1e3)),18==i&&(a.alt=!0,setTimeout("$.fn.tabby.pressed.alt = false;",1e3)),9!=i||a.ctrl||a.alt?void 0:(r.preventDefault,a.last=i,setTimeout("$.fn.tabby.pressed.last = null;",0),e(t(r.target).get(0),a.shft,n),!1)}).bind("keyup",function(e){16==t.fn.tabby.catch_kc(e)&&(a.shft=!1)}).bind("blur",function(e){9==a.last&&t(e.target).one("focus",function(){a.last=null}).get(0).focus()})})},t.fn.tabby.catch_kc=function(t){return t.keyCode?t.keyCode:t.charCode?t.charCode:t.which},t.fn.tabby.pressed={shft:!1,ctrl:!1,alt:!1,last:null},t.fn.tabby.defaults={tabString:String.fromCharCode(9)}}(jQuery),function(t,e,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."},a=function(){},i=/^(.+)\[(.+)\]$/,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(t,n,r){for(this.callback=r||a,this.errors=[],this.fields={},this.form=e.forms[t]||{},this.messages={},this.handlers={},t=0,r=n.length;r>t;t++){var i=n[t];i.name&&i.rules&&(this.fields[i.name]={name:i.name,display:i.display||i.name,rules:i.rules,type:null,value:null,checked:null})}this.form.onsubmit=function(t){return function(e){try{return t._validateForm(e)}catch(n){}}}(this)};f.prototype.setMessage=function(t,e){return this.messages[t]=e,this},f.prototype.registerCallback=function(t,e){return t&&"string"==typeof t&&e&&"function"==typeof e&&(this.handlers[t]=e),this},f.prototype._validateForm=function(t){this.errors=[];for(var e in this.fields)if(this.fields.hasOwnProperty(e)){var r=this.fields[e]||{},a=this.form[r.name];a&&a!==n&&(r.type=a.type,r.value=a.value,r.checked=a.checked),this._validateField(r)}if("function"==typeof this.callback&&this.callback(this.errors,t),this.errors.length>0){if(!t||!t.preventDefault)return!1;t.preventDefault()}return!0},f.prototype._validateField=function(t){var e=t.rules.split("|");if(-1!==t.rules.indexOf("required")||t.value&&""!==t.value&&t.value!==n)for(var a=0,o=e.length;o>a;a++){var s=e[a],l=null,u=!1;if((parts=i.exec(s))&&(s=parts[1],l=parts[2]),"function"==typeof this._hooks[s]?this._hooks[s].apply(this,[t,l])||(u=!0):"callback_"===s.substring(0,9)&&(s=s.substring(9,s.length),"function"==typeof this.handlers[s]&&this.handlers[s].apply(this,[t.value])===!1&&(u=!0)),u){(e=this.messages[s]||r[s])?(t=e.replace("%s",t.display),l&&(t=t.replace("%s",this.fields[l]?this.fields[l].display:l)),this.errors.push(t)):this.errors.push("An error has occurred with the "+t.display+" field.");break}}},f.prototype._hooks={required:function(t){var e=t.value;return"checkbox"===t.type?t.checked===!0:null!==e&&""!==e},matches:function(t,e){return(el=this.form[e])?t.value===el.value:!1},valid_email:function(t){return u.test(t.value)},min_length:function(t,e){return o.test(e)?t.value.length>=e:!1},max_length:function(t,e){return o.test(e)?t.value.length<=e:!1},exact_length:function(t,e){return o.test(e)?t.value.length==e:!1},greater_than:function(t,e){return l.test(t.value)?parseFloat(t.value)>parseFloat(e):!1},less_than:function(t,e){return l.test(t.value)?parseFloat(t.value)<parseFloat(e):!1},alpha:function(t){return c.test(t.value)},alpha_numeric:function(t){return d.test(t.value)},alpha_dash:function(t){return h.test(t.value)},numeric:function(t){return l.test(t.value)},integer:function(t){return s.test(t.value)}},t.FormValidator=f}(window,document),$(function(){$("div.progressbar").each(function(){var t=this;$(t).progressbar({value:parseInt($(t).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(t){t.preventDefault();var e=this.hash;$("html, body").animate({scrollTop:$(this.hash).offset().top-90},300,function(){window.location.hash=e})}))});var q=null;window.PR_SHOULD_USE_CONTINUATION=!0,function(){function t(t){function e(t){var e=t.charCodeAt(0);if(92!==e)return e;var n=t.charAt(1);return(e=d[n])?e:n>="0"&&"7">=n?parseInt(t.substring(1),8):"u"===n||"x"===n?parseInt(t.substring(2),16):t.charCodeAt(1)}function n(t){return 32>t?(16>t?"\\x0":"\\x")+t.toString(16):(t=String.fromCharCode(t),("\\"===t||"-"===t||"["===t||"]"===t)&&(t="\\"+t),t)}function r(t){for(var r=t.substring(1,t.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),t=[],a=[],i="^"===r[0],o=i?1:0,s=r.length;s>o;++o){var l=r[o];if(/\\[bdsw]/i.test(l))t.push(l);else{var u,l=e(l);s>o+2&&"-"===r[o+1]?(u=e(r[o+2]),o+=2):u=l,a.push([l,u]),65>u||l>122||(65>u||l>90||a.push([32|Math.max(65,l),32|Math.min(u,90)]),97>u||l>122||a.push([-33&Math.max(97,l),-33&Math.min(u,122)]))}}for(a.sort(function(t,e){return t[0]-e[0]||e[1]-t[1]}),r=[],l=[0/0,0/0],o=0;o<a.length;++o)s=a[o],s[0]<=l[1]+1?l[1]=Math.max(l[1],s[1]):r.push(l=s);for(a=["["],i&&a.push("^"),a.push.apply(a,t),o=0;o<r.length;++o)s=r[o],a.push(n(s[0])),s[1]>s[0]&&(s[1]+1>s[0]&&a.push("-"),a.push(n(s[1])));return a.push("]"),a.join("")}function a(t){for(var e=t.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),n=e.length,a=[],s=0,l=0;n>s;++s){var u=e[s];"("===u?++l:"\\"===u.charAt(0)&&(u=+u.substring(1))&&l>=u&&(a[u]=-1)}for(s=1;s<a.length;++s)-1===a[s]&&(a[s]=++i);for(l=s=0;n>s;++s)u=e[s],"("===u?(++l,void 0===a[l]&&(e[s]="(?:")):"\\"===u.charAt(0)&&(u=+u.substring(1))&&l>=u&&(e[s]="\\"+a[l]);for(l=s=0;n>s;++s)"^"===e[s]&&"^"!==e[s+1]&&(e[s]="");if(t.ignoreCase&&o)for(s=0;n>s;++s)u=e[s],t=u.charAt(0),u.length>=2&&"["===t?e[s]=r(u):"\\"!==t&&(e[s]=u.replace(/[A-Za-z]/g,function(t){return t=t.charCodeAt(0),"["+String.fromCharCode(-33&t,32|t)+"]"}));return e.join("")}for(var i=0,o=!1,s=!1,l=0,u=t.length;u>l;++l){var c=t[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=t.length;u>l;++l){if(c=t[l],c.global||c.multiline)throw Error(""+c);h.push("(?:"+a(c)+")")}return RegExp(h.join("|"),s?"gi":"g")}function e(t){function e(t){switch(t.nodeType){case 1:if(r.test(t.className))break;for(var n=t.firstChild;n;n=n.nextSibling)e(n);n=t.nodeName,("BR"===n||"LI"===n)&&(a[s]="\n",o[s<<1]=i++,o[s++<<1|1]=t);break;case 3:case 4:n=t.nodeValue,n.length&&(n=l?n.replace(/\r\n?/g,"\n"):n.replace(/[\t\n\r ]+/g," "),a[s]=n,o[s<<1]=i,i+=n.length,o[s++<<1|1]=t)}}var n,r=/(?:^|\s)nocode(?:\s|$)/,a=[],i=0,o=[],s=0;t.currentStyle?n=t.currentStyle.whiteSpace:window.getComputedStyle&&(n=document.defaultView.getComputedStyle(t,q).getPropertyValue("white-space"));var l=n&&"pre"===n.substring(0,3);return e(t),{a:a.join("").replace(/\n$/,""),c:o}}function n(t,e,n,r){e&&(t={a:e,d:t},n(t),r.push.apply(r,t.e))}function r(e,r){function a(t){for(var e=t.d,u=[e,"pln"],c=0,d=t.a.match(i)||[],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(e+y,g.substring(0,w),a,u),n(e+y+w,m,s(v,m),u),n(e+y+x,g.substring(x),a,u)}else u.push(e+y,v)}t.e=u}var i,o={};!function(){for(var n=e.concat(r),a=[],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)||(a.push(c),s[d]=q)}a.push(/[\S\s]/),i=t(a)}();var l=r.length;return a}function a(t){var e=[],n=[];t.tripleQuotedStrings?e.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):t.multiLineStrings?e.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,q,"'\"`"]):e.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]),t.verbatimStrings&&n.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var a=t.hashComments;return a&&(t.cStyleComments?(a>1?e.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):e.push(["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])):e.push(["com",/^#[^\n\r]*/,q,"#"])),t.cStyleComments&&(n.push(["com",/^\/\/[^\n\r]*/,q]),n.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q])),t.regexLiterals&&n.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]),(a=t.types)&&n.push(["typ",a]),t=(""+t.keywords).replace(/^ | $/g,""),t.length&&n.push(["kwd",RegExp("^(?:"+t.replace(/[\s,]+/g,"|")+")\\b"),q]),e.push(["pln",/^\s+/,q," \r\n "]),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(e,n)}function i(t,e){function n(t){switch(t.nodeType){case 1:if(i.test(t.className))break;if("BR"===t.nodeName)r(t),t.parentNode&&t.parentNode.removeChild(t);else for(t=t.firstChild;t;t=t.nextSibling)n(t);break;case 3:case 4:if(l){var e=t.nodeValue,a=e.match(o);if(a){var u=e.substring(0,a.index);t.nodeValue=u,(e=e.substring(a.index+a[0].length))&&t.parentNode.insertBefore(s.createTextNode(e),t.nextSibling),r(t),u||t.parentNode.removeChild(t)}}}}function r(t){function e(t,n){var r=n?t.cloneNode(!1):t,a=t.parentNode;if(a){var a=e(a,1),i=t.nextSibling;a.appendChild(r);for(var o=i;o;o=i)i=o.nextSibling,a.appendChild(o)}return r}for(;!t.nextSibling;)if(t=t.parentNode,!t)return;for(var n,t=e(t.nextSibling,0);(n=t.parentNode)&&1===n.nodeType;)t=n;u.push(t)}var a,i=/(?:^|\s)nocode(?:\s|$)/,o=/\r\n?|\n/,s=t.ownerDocument;t.currentStyle?a=t.currentStyle.whiteSpace:window.getComputedStyle&&(a=s.defaultView.getComputedStyle(t,q).getPropertyValue("white-space"));var l=a&&"pre"===a.substring(0,3);for(a=s.createElement("LI");t.firstChild;)a.appendChild(t.firstChild);for(var u=[a],c=0;c<u.length;++c)n(u[c]);e===(0|e)&&u[0].setAttribute("value",e);var d=s.createElement("OL");d.className="linenums";for(var h=Math.max(0,e-1|0)||0,c=0,f=u.length;f>c;++c)a=u[c],a.className="L"+(c+h)%10,a.firstChild||a.appendChild(s.createTextNode(" ")),d.appendChild(a);t.appendChild(d)}function o(t,e){for(var n=e.length;--n>=0;){var r=e[n];y.hasOwnProperty(r)?window.console&&console.warn("cannot override language handler %s",r):y[r]=t}}function s(t,e){return t&&y.hasOwnProperty(t)||(t=/^\s*</.test(e)?"default-markup":"default-code"),y[t]}function l(t){var n=t.g;try{var r=e(t.h),a=r.a;t.a=a,t.c=r.c,t.d=0,s(n,a)(t);var i=/\bMSIE\b/.test(navigator.userAgent),n=/\n/g,o=t.a,l=o.length,r=0,u=t.c,c=u.length,a=0,d=t.e,h=d.length,t=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>a;){var b,y=u[a+2]||l,w=d[t+2]||l,v=Math.min(y,w),x=u[a+1];if(1!==x.nodeType&&(b=o.substring(r,v))){i&&(b=b.replace(n,"\r")),x.nodeValue=b;var S=x.ownerDocument,$=S.createElement("SPAN");$.className=d[t+1];var k=x.parentNode;k.replaceChild($,x),$.appendChild(x),y>r&&(u[a+1]=x=S.createTextNode(o.substring(v,y)),k.insertBefore(x,$.nextSibling))}r=v,r>=y&&(a+=2),r>=w&&(t+=2)}}catch(C){"console"in window&&console.log(C&&C.stack?C.stack:C)}}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=a({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(a({keywords:d,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),o(a({keywords:"null,true,false"}),["json"]),o(a({keywords:f,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),o(a({keywords:h,cStyleComments:!0}),["java"]),o(a({keywords:u,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]),o(a({keywords:p,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]),o(a({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(a({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]),o(a({keywords:c,cStyleComments:!0,regexLiterals:!0}),["js"]),o(a({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(t,e,n){var r=document.createElement("PRE");return r.innerHTML=t,n&&i(r,n),l({g:e,i:n,h:r}),r.innerHTML},window.prettyPrint=function(t){function e(){for(var n=window.PR_SHOULD_USE_CONTINUATION?u.now()+250:1/0;d<r.length&&u.now()<n;d++){var a=r[d],o=a.className;if(o.indexOf("prettyprint")>=0){var s,f,o=o.match(h);if(f=!o){f=a;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: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=a.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=a.className.match(/\blinenums\b(?::(\d+))?/))?f[1]&&f[1].length?+f[1]:!0:!1)&&i(a,f),c={g:o,h:a,i:f},l(c))}}d<r.length?setTimeout(e,250):t&&t()}for(var n=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],r=[],a=0;a<n.length;++a)for(var o=0,s=n[a].length;s>o;++o)r.push(n[a][o]);var n=q,u=Date;u.now||(u={now:function(){return+new Date}});var c,d=0,h=/\blang(?:uage)?-([\w.]+)(?!\S)/;e()},window.PR={createSimpleLexer:r,registerLangHandler:o,sourceDecorator:a,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(t){t(function(){window.prettyPrint&&prettyPrint()})}(window.jQuery),$(document).on("page:load ready",function(){$(".response").click(function(){var t=$(this).data("response_type");$(".response").removeClass("active"),$(".response-"+t).addClass("active"),$(".format").hide(),$(".format-"+t).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()}); |