commit/galaxy-central: jgoecks: UI framework enhancements: (a) upgrade to jQuery UI 1.9.1; (b) remove version information from jQuery UI file names; (c) add generic jQueryUI search+select combobox widget; (d) use combobox widget for choosing dbkey in Trackster visualizations. Also pack scripts.
a?e.left=3Di+s-t.collisionWidth:e.left=3Di:u>0?e.left+=3Du:a>0?e.left-=3Da= :e.left=3Dr(e.left-o,e.left)},top:function(e,t){var n=3Dt.within,i=3Dn.isWi= ndow?n.scrollTop:n.offset.top,s=3Dt.within.height,o=3De.top-t.collisionPosi= tion.marginTop,u=3Di-o,a=3Do+t.collisionHeight-s-i,f;t.collisionHeight>s?u>= 0&&a<=3D0?(f=3De.top+u+t.collisionHeight-s-i,e.top+=3Du-f):a>0&&u<=3D0?e.to=
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/394c3bd89926/ changeset: 394c3bd89926 user: jgoecks date: 2012-10-30 14:07:29 summary: UI framework enhancements: (a) upgrade to jQuery UI 1.9.1; (b)= remove version information from jQuery UI file names; (c) add generic jQue= ryUI search+select combobox widget; (d) use combobox widget for choosing db= key in Trackster visualizations. Also pack scripts. affected #: 27 files diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/june_2007_style/blue/jquery-ui/smoothness/images/u= i-bg_glass_55_fbf9ee_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_g= lass_55_fbf9ee_1x400.png has changed diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/june_2007_style/blue/jquery-ui/smoothness/images/u= i-icons_2e83ff_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icon= s_2e83ff_256x240.png has changed diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/june_2007_style/blue/jquery-ui/smoothness/jquery-u= i-1.8.23.custom.css --- a/static/june_2007_style/blue/jquery-ui/smoothness/jquery-ui-1.8.23.cus= tom.css +++ /dev/null @@ -1,363 +0,0 @@ -/*! - * jQuery UI CSS Framework 1.8.23 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1= px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-heig= ht: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; displ= ay: table; } -.ui-helper-clearfix:after { clear: both; } -.ui-helper-clearfix { zoom: 1; } -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: ab= solute; opacity: 0; filter:Alpha(Opacity=3D0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; backgr= ound-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; hei= ght: 100%; } - - -/*! - * jQuery UI CSS Framework 1.8.23 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?f= fDefault=3DVerdana,Arial,sans-serif&fwDefault=3Dnormal&fsDefault=3D1.1em&co= rnerRadius=3D4px&bgColorHeader=3Dcccccc&bgTextureHeader=3D03_highlight_soft= .png&bgImgOpacityHeader=3D75&borderColorHeader=3Daaaaaa&fcHeader=3D222222&i= conColorHeader=3D222222&bgColorContent=3Dffffff&bgTextureContent=3D01_flat.= png&bgImgOpacityContent=3D75&borderColorContent=3Daaaaaa&fcContent=3D222222= &iconColorContent=3D222222&bgColorDefault=3De6e6e6&bgTextureDefault=3D02_gl= ass.png&bgImgOpacityDefault=3D75&borderColorDefault=3Dd3d3d3&fcDefault=3D55= 5555&iconColorDefault=3D888888&bgColorHover=3Ddadada&bgTextureHover=3D02_gl= ass.png&bgImgOpacityHover=3D75&borderColorHover=3D999999&fcHover=3D212121&i= conColorHover=3D454545&bgColorActive=3Dffffff&bgTextureActive=3D02_glass.pn= g&bgImgOpacityActive=3D65&borderColorActive=3Daaaaaa&fcActive=3D212121&icon= ColorActive=3D454545&bgColorHighlight=3Dfbf9ee&bgTextureHighlight=3D02_glas= s.png&bgImgOpacityHighlight=3D55&borderColorHighlight=3Dfcefa1&fcHighlight= =3D363636&iconColorHighlight=3D2e83ff&bgColorError=3Dfef1ec&bgTextureError= =3D02_glass.png&bgImgOpacityError=3D95&borderColorError=3Dcd0a0a&fcError=3D= cd0a0a&iconColorError=3Dcd0a0a&bgColorOverlay=3Daaaaaa&bgTextureOverlay=3D0= 1_flat.png&bgImgOpacityOverlay=3D0&opacityOverlay=3D30&bgColorShadow=3Daaaa= aa&bgTextureShadow=3D01_flat.png&bgImgOpacityShadow=3D0&opacityShadow=3D30&= thicknessShadow=3D8px&offsetTopShadow=3D-8px&offsetLeftShadow=3D-8px&corner= RadiusShadow=3D8px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget butto= n { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(im= ages/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(ima= ges/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222= 222; font-weight: bold; } -.ui-widget-header a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header= .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(ima= ges/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal;= color: #555555; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited= { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui= -state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widg= et-header .ui-state-focus { border: 1px solid #999999; background: #dadada = url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: = normal; color: #212121; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decorati= on: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .= ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images= /ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; co= lor: #212121; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { = color: #212121; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-he= ader .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee u= rl(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636= ; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget= -header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui= -state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-= bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header= .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-= header .ui-state-error-text { color: #cd0a0a; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-= header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-wi= dget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=3D70= ); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-head= er .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=3D35); backgroun= d-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icon= s_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_= 256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_2= 56x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_= 256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(= images/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_25= 6x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff= _256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image:= url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-bord= er-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-= top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-bor= der-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-bord= er-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-b= order-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtm= l-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-= border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -k= html-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40= x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=3D30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaa= aa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3= 0;filter:Alpha(Opacity=3D30); -moz-border-radius: 8px; -khtml-border-radius= : 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*! - * jQuery UI Autocomplete 1.8.23 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; }=09 - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands t= o 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.23 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/*! - * jQuery UI Slider 1.8.23 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2e= m; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .= 7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margi= n-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/june_2007_style/blue/jquery-ui/smoothness/jquery-u= i.css --- /dev/null +++ b/static/june_2007_style/blue/jquery-ui/smoothness/jquery-ui.css @@ -0,0 +1,10 @@ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.autocomplete.css, jquery.ui.butt= on.css, jquery.ui.menu.css, jquery.ui.slider.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ff= Default=3DVerdana%2CArial%2Csans-serif&fwDefault=3Dnormal&fsDefault=3D1.1em= &cornerRadius=3D4px&bgColorHeader=3Dcccccc&bgTextureHeader=3D03_highlight_s= oft.png&bgImgOpacityHeader=3D75&borderColorHeader=3Daaaaaa&fcHeader=3D22222= 2&iconColorHeader=3D222222&bgColorContent=3Dffffff&bgTextureContent=3D01_fl= at.png&bgImgOpacityContent=3D75&borderColorContent=3Daaaaaa&fcContent=3D222= 222&iconColorContent=3D222222&bgColorDefault=3De6e6e6&bgTextureDefault=3D02= _glass.png&bgImgOpacityDefault=3D75&borderColorDefault=3Dd3d3d3&fcDefault= =3D555555&iconColorDefault=3D888888&bgColorHover=3Ddadada&bgTextureHover=3D= 02_glass.png&bgImgOpacityHover=3D75&borderColorHover=3D999999&fcHover=3D212= 121&iconColorHover=3D454545&bgColorActive=3Dffffff&bgTextureActive=3D02_gla= ss.png&bgImgOpacityActive=3D65&borderColorActive=3Daaaaaa&fcActive=3D212121= &iconColorActive=3D454545&bgColorHighlight=3Dfbf9ee&bgTextureHighlight=3D02= _glass.png&bgImgOpacityHighlight=3D55&borderColorHighlight=3Dfcefa1&fcHighl= ight=3D363636&iconColorHighlight=3D2e83ff&bgColorError=3Dfef1ec&bgTextureEr= ror=3D02_glass.png&bgImgOpacityError=3D95&borderColorError=3Dcd0a0a&fcError= =3Dcd0a0a&iconColorError=3Dcd0a0a&bgColorOverlay=3Daaaaaa&bgTextureOverlay= =3D01_flat.png&bgImgOpacityOverlay=3D0&opacityOverlay=3D30&bgColorShadow=3D= aaaaaa&bgTextureShadow=3D01_flat.png&bgImgOpacityShadow=3D0&opacityShadow= =3D30&thicknessShadow=3D8px&offsetTopShadow=3D-8px&offsetLeftShadow=3D-8px&= cornerRadiusShadow=3D8px +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT= */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:abs= olute!important;clip:rect(1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{= margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;= font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearf= ix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-= helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;= position:absolute;opacity:0;filter:Alpha(Opacity=3D0)}.ui-state-disabled{cu= rsor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow= :hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;to= p:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;= cursor:default}* html .ui-autocomplete{width:1px}.ui-button{display:inline-= block;position:relative;padding:0;margin-right:.1em;cursor:pointer;text-ali= gn:center;zoom:1;overflow:visible}.ui-button,.ui-button:link,.ui-button:vis= ited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-ico= n-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-= only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-but= ton-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text= {padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-onl= y .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-= primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em = 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-te= xt-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons = .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padd= ing:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui= -icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-ico= n,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}= .ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-ico= n-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-pri= mary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-tex= t-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button= -icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}= .ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-b= utton-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonse= t .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-= inner{border:0;padding:0}.ui-menu{list-style:none;padding:2px;margin:0;disp= lay:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}= .ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;width:100%}.ui-menu .ui-me= nu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;bord= er-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:bl= ock;padding:2px .4em;line-height:1.5;zoom:1;font-weight:normal}.ui-menu .ui= -menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-w= eight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;mar= gin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:defaul= t}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:= relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left= :.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-slider{positio= n:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z= -index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-rang= e{position:absolute;z-index:1;font-size:.7em;display:block;border:0;backgro= und-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .u= i-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slide= r-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0= }.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{wid= th:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margi= n-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;wi= dth:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-verti= cal .ui-slider-range-max{top:0}.ui-widget{font-family:Verdana,Arial,sans-se= rif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.u= i-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,A= rial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;back= ground:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;co= lor:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid= #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) = 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222= }.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .= ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-= bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#55= 5}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{= color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-stat= e-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-conten= t .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;b= ackground:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repea= t-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:ho= ver,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-dec= oration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widge= t-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/= ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:= #212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visit= ed{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-conten= t .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px soli= d #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50= % 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-s= tate-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-= state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-= error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95= _fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-wid= get-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd= 0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widge= t-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget= -content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-w= eight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary= ,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity= =3D70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-d= isabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opaci= ty=3D35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opa= city=3D35)}.ui-icon{width:16px;height:16px;background-image:url(images/ui-i= cons_222222_256x240.png)}.ui-widget-content .ui-icon{background-image:url(i= mages/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-im= age:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{back= ground-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-ic= on,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256= x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_45= 4545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/= ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text = .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-= carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-= 16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{b= ackground-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.= ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{backgroun= d-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-ico= n-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-= position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-ico= n-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{backg= round-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px= -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-trian= gle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-p= osition:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px= }.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle= -2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-posit= ion:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-ar= row-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-posi= tion:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-ico= n-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-= position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.= ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw= {background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:= -160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-ic= on-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{ba= ckground-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-= 224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-ico= n-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{backg= round-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32p= x -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-a= rrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{back= ground-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96= px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon= -arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne= -sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-p= osition:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px= -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-ico= n-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickst= op-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{backgro= und-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position= :0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-= icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowret= urnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{backg= round-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80= px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-= arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{= background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-posit= ion:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px= }.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-= 4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16= px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{b= ackground-position:-48px -80px}.ui-icon-refresh{background-position:-64px -= 80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w= {background-position:-96px -80px}.ui-icon-transferthick-e-w{background-posi= tion:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui= -icon-folder-open{background-position:-16px -96px}.ui-icon-document{backgro= und-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96p= x}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{backgr= ound-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96p= x}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{backg= round-position:-128px -96px}.ui-icon-person{background-position:-144px -96p= x}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background= -position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui= -icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{backgroun= d-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-i= con-home{background-position:0 -112px}.ui-icon-flag{background-position:-16= px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{= background-position:-48px -112px}.ui-icon-pencil{background-position:-64px = -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{backgr= ound-position:-96px -112px}.ui-icon-calculator{background-position:-112px -= 112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{ba= ckground-position:-144px -112px}.ui-icon-search{background-position:-160px = -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{back= ground-position:-192px -112px}.ui-icon-heart{background-position:-208px -11= 2px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{backgroun= d-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-i= con-plus{background-position:-16px -128px}.ui-icon-plusthick{background-pos= ition:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon= -minusthick{background-position:-64px -128px}.ui-icon-close{background-posi= tion:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-= icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-po= sition:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.u= i-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background= -position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}= .ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-= position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.u= i-icon-alert{background-position:0 -144px}.ui-icon-info{background-position= :-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-hel= p{background-position:-48px -144px}.ui-icon-check{background-position:-64px= -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{= background-position:-96px -144px}.ui-icon-radio-off{background-position:-11= 2px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{= background-position:-144px -144px}.ui-icon-play{background-position:0 -160p= x}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{backgr= ound-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -16= 0px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{= background-position:-80px -160px}.ui-icon-seek-first{background-position:-8= 0px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{ba= ckground-position:-112px -160px}.ui-icon-volume-off{background-position:-12= 8px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-po= wer{background-position:0 -176px}.ui-icon-signal-diag{background-position:-= 16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-batte= ry-0{background-position:-48px -176px}.ui-icon-battery-1{background-positio= n:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon= -battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background= -position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.= ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-trian= gle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{backgroun= d-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80p= x -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-ic= on-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s= {background-position:-128px -192px}.ui-icon-circle-arrow-w{background-posit= ion:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px= }.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-z= oomout{background-position:-192px -192px}.ui-icon-circle-check{background-p= osition:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208p= x}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circ= lesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{ba= ckground-position:-48px -208px}.ui-icon-squaresmall-minus{background-positi= on:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px= }.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-d= otted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-verti= cal{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{backgro= und-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-positio= n:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.= ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radi= us-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-ra= dius:4px;border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corne= r-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-ri= ght-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4= px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-bord= er-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-borde= r-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-all,.ui-c= orner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:= 4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radiu= s:4px;border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url= (images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:= Alpha(Opacity=3D30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;back= ground:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opa= city:.3;filter:Alpha(Opacity=3D30);-moz-border-radius:8px;-khtml-border-rad= ius:8px;-webkit-border-radius:8px;border-radius:8px} + +/* For jQueryUI combobox */ +.ui-combobox{position: relative; display: inline-block;} +.ui-combobox-toggle {position: absolute; top: 0; bottom: 0; margin-left: -= 1px; padding: 0;} +.ui-combobox-input {margin: 0; padding: 0.2em;} \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/libs/jquery/jquery-ui-1.8.23.custom.min.js --- a/static/scripts/libs/jquery/jquery-ui-1.8.23.custom.min.js +++ /dev/null @@ -1,25 +0,0 @@ -/*! jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.core.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){function c(b,c){var e=3Db.nodeName.toLowerCase();if("area"= =3D=3D=3De){var f=3Db.parentNode,g=3Df.name,h;return!b.href||!g||f.nodeName= .toLowerCase()!=3D=3D"map"?!1:(h=3Da("img[usemap=3D#"+g+"]")[0],!!h&&d(h))}= return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"=3D=3De= ?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(fu= nction(){return a.curCSS(this,"visibility")=3D=3D=3D"hidden"||a.expr.filter= s.hidden(this)}).length}a.ui=3Da.ui||{};if(a.ui.version)return;a.extend(a.u= i,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMM= AND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35= ,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD= _DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_= SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,= TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus= :a.fn.focus,focus:function(b,c){return typeof b=3D=3D"number"?this.each(fun= ction(){var d=3Dthis;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):= this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.b= rowser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.tes= t(this.css("position"))?b=3Dthis.parents().filter(function(){return/(relati= ve|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test= (a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"o= verflow-x",1))}).eq(0):b=3Dthis.parents().filter(function(){return/(auto|sc= roll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.cur= CSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.le= ngth?a(document):b},zIndex:function(c){if(c!=3D=3Db)return this.css("zIndex= ",c);if(this.length){var d=3Da(this[0]),e,f;while(d.length&&d[0]!=3D=3Ddocu= ment){e=3Dd.css("position");if(e=3D=3D=3D"absolute"||e=3D=3D=3D"relative"||= e=3D=3D=3D"fixed"){f=3DparseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!=3D=3D0= )return f}d=3Dd.parent()}}return 0},disableSelection:function(){return this= .bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelecti= on",function(a){a.preventDefault()})},enableSelection:function(){return thi= s.unbind(".ui-disableSelection")}}),a("<a>").outerWidth(1).jquery||a.each([= "Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,functio= n(){c-=3DparseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=3DparseFloat(a= .curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=3DparseFloat(a.curCSS(b,"ma= rgin"+this,!0))||0)}),c}var e=3Dd=3D=3D=3D"Width"?["Left","Right"]:["Top","= Bottom"],f=3Dd.toLowerCase(),g=3D{innerWidth:a.fn.innerWidth,innerHeight:a.= fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.f= n["inner"+d]=3Dfunction(c){return c=3D=3D=3Db?g["inner"+d].call(this):this.= each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=3Dfunction= (b,c){return typeof b!=3D"number"?g["outer"+d].call(this,b):this.each(funct= ion(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.= expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return= !!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function= (b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=3D= a.attr(b,"tabindex"),e=3DisNaN(d);return(e||d>=3D0)&&c(b,!e)}}),a(function(= ){var b=3Ddocument.body,c=3Db.appendChild(c=3Ddocument.createElement("div")= );c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:= 0,borderWidth:0}),a.support.minHeight=3Dc.offsetHeight=3D=3D=3D100,a.suppor= t.selectstart=3D"onselectstart"in c,b.removeChild(c).style.display=3D"none"= }),a.curCSS||(a.curCSS=3Da.css),a.extend(a.ui,{plugin:{add:function(b,c,d){= var e=3Da.ui[b].prototype;for(var f in d)e.plugins[f]=3De.plugins[f]||[],e.= plugins[f].push([c,d[f]])},call:function(a,b,c){var d=3Da.plugins[b];if(!d|= |!a.element[0].parentNode)return;for(var e=3D0;e<d.length;e++)a.options[d[e= ][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.= compareDocumentPosition?a.compareDocumentPosition(b)&16:a!=3D=3Db&&a.contai= ns(b)},hasScroll:function(b,c){if(a(b).css("overflow")=3D=3D=3D"hidden")ret= urn!1;var d=3Dc&&c=3D=3D=3D"left"?"scrollLeft":"scrollTop",e=3D!1;return b[= d]>0?!0:(b[d]=3D1,e=3Db[d]>0,b[d]=3D0,e)},isOverAxis:function(a,b,c){return= a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.= ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.widget.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){if(a.cleanData){var c=3Da.cleanData;a.cleanData=3Dfunction(= b){for(var d=3D0,e;(e=3Db[d])!=3Dnull;d++)try{a(e).triggerHandler("remove")= }catch(f){}c(b)}}else{var d=3Da.fn.remove;a.fn.remove=3Dfunction(b,c){retur= n this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",thi= s).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b= ){}}),d.call(a(this),b,c)})}}a.widget=3Dfunction(b,c,d){var e=3Db.split("."= )[0],f;b=3Db.split(".")[1],f=3De+"-"+b,d||(d=3Dc,c=3Da.Widget),a.expr[":"][= f]=3Dfunction(c){return!!a.data(c,b)},a[e]=3Da[e]||{},a[e][b]=3Dfunction(a,= b){arguments.length&&this._createWidget(a,b)};var g=3Dnew c;g.options=3Da.e= xtend(!0,{},g.options),a[e][b].prototype=3Da.extend(!0,g,{namespace:e,widge= tName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBase= Class:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=3Dfunction(c,d){a.f= n[c]=3Dfunction(e){var f=3Dtypeof e=3D=3D"string",g=3DArray.prototype.slice= .call(arguments,1),h=3Dthis;return e=3D!f&&g.length?a.extend.apply(null,[!0= ,e].concat(g)):e,f&&e.charAt(0)=3D=3D=3D"_"?h:(f?this.each(function(){var d= =3Da.data(this,c),f=3Dd&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!=3D=3Dd&= &f!=3D=3Db)return h=3Df,!1}):this.each(function(){var b=3Da.data(this,c);b?= b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=3Dfunc= tion(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype=3D{= widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidge= t:function(b,c){a.data(c,this.widgetName,this),this.element=3Da(c),this.opt= ions=3Da.extend(!0,{},this.options,this._getCreateOptions(),b);var d=3Dthis= ;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this.= _create(),this._trigger("create"),this._init()},_getCreateOptions:function(= ){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_cre= ate:function(){},_init:function(){},destroy:function(){this.element.unbind(= "."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+t= his.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClas= s+"-disabled "+"ui-state-disabled")},widget:function(){return this.element}= ,option:function(c,d){var e=3Dc;if(arguments.length=3D=3D=3D0)return a.exte= nd({},this.options);if(typeof c=3D=3D"string"){if(d=3D=3D=3Db)return this.o= ptions[c];e=3D{},e[c]=3Dd}return this._setOptions(e),this},_setOptions:func= tion(b){var c=3Dthis;return a.each(b,function(a,b){c._setOption(a,b)}),this= },_setOption:function(a,b){return this.options[a]=3Db,a=3D=3D=3D"disabled"&= &this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"= +" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){r= eturn this._setOption("disabled",!1)},disable:function(){return this._setOp= tion("disabled",!0)},_trigger:function(b,c,d){var e,f,g=3Dthis.options[b];d= =3Dd||{},c=3Da.Event(c),c.type=3D(b=3D=3D=3Dthis.widgetEventPrefix?b:this.w= idgetEventPrefix+b).toLowerCase(),c.target=3Dthis.element[0],f=3Dc.original= Event;if(f)for(e in f)e in c||(c[e]=3Df[e]);return this.element.trigger(c,d= ),!(a.isFunction(g)&&g.call(this.element[0],c,d)=3D=3D=3D!1||c.isDefaultPre= vented())}}})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.mouse.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){var c=3D!1;a(document).mouseup(function(a){c=3D!1}),a.widge= t("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseIni= t:function(){var b=3Dthis;this.element.bind("mousedown."+this.widgetName,fu= nction(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c= ){if(!0=3D=3D=3Da.data(c.target,b.widgetName+".preventClickEvent"))return a= .removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediateProp= agation(),!1}),this.started=3D!1},_mouseDestroy:function(){this.element.unb= ind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mouse= move."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widg= etName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mou= seStarted&&this._mouseUp(b),this._mouseDownEvent=3Db;var d=3Dthis,e=3Db.whi= ch=3D=3D1,f=3Dtypeof this.options.cancel=3D=3D"string"&&b.target.nodeName?a= (b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCap= ture(b))return!0;this.mouseDelayMet=3D!this.options.delay,this.mouseDelayMe= t||(this._mouseDelayTimer=3DsetTimeout(function(){d.mouseDelayMet=3D!0},thi= s.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){thi= s._mouseStarted=3Dthis._mouseStart(b)!=3D=3D!1;if(!this._mouseStarted)retur= n b.preventDefault(),!0}return!0=3D=3D=3Da.data(b.target,this.widgetName+".= preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEv= ent"),this._mouseMoveDelegate=3Dfunction(a){return d._mouseMove(a)},this._m= ouseUpDelegate=3Dfunction(a){return d._mouseUp(a)},a(document).bind("mousem= ove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetN= ame,this._mouseUpDelegate),b.preventDefault(),c=3D!0,!0},_mouseMove:functio= n(b){return!a.browser.msie||document.documentMode>=3D9||!!b.button?this._mo= useStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(= b)&&this._mouseDelayMet(b)&&(this._mouseStarted=3Dthis._mouseStart(this._mo= useDownEvent,b)!=3D=3D!1,this._mouseStarted?this._mouseDrag(b):this._mouseU= p(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(= document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbi= nd("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(t= his._mouseStarted=3D!1,b.target=3D=3Dthis._mouseDownEvent.target&&a.data(b.= target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mo= useDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pa= geX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=3Dthis.options.= distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart= :function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapt= ure:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.position.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){a.ui=3Da.ui||{};var c=3D/left|center|right/,d=3D/top|center= |bottom/,e=3D"center",f=3D{},g=3Da.fn.position,h=3Da.fn.offset;a.fn.positio= n=3Dfunction(b){if(!b||!b.of)return g.apply(this,arguments);b=3Da.extend({}= ,b);var h=3Da(b.of),i=3Dh[0],j=3D(b.collision||"flip").split(" "),k=3Db.off= set?b.offset.split(" "):[0,0],l,m,n;return i.nodeType=3D=3D=3D9?(l=3Dh.widt= h(),m=3Dh.height(),n=3D{top:0,left:0}):i.setTimeout?(l=3Dh.width(),m=3Dh.he= ight(),n=3D{top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at= =3D"left top",l=3Dm=3D0,n=3D{top:b.of.pageY,left:b.of.pageX}):(l=3Dh.outerW= idth(),m=3Dh.outerHeight(),n=3Dh.offset()),a.each(["my","at"],function(){va= r a=3D(b[this]||"").split(" ");a.length=3D=3D=3D1&&(a=3Dc.test(a[0])?a.conc= at([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=3Dc.test(a[0])?a[0]:e,a[1]= =3Dd.test(a[1])?a[1]:e,b[this]=3Da}),j.length=3D=3D=3D1&&(j[1]=3Dj[0]),k[0]= =3DparseInt(k[0],10)||0,k.length=3D=3D=3D1&&(k[1]=3Dk[0]),k[1]=3DparseInt(k= [1],10)||0,b.at[0]=3D=3D=3D"right"?n.left+=3Dl:b.at[0]=3D=3D=3De&&(n.left+= =3Dl/2),b.at[1]=3D=3D=3D"bottom"?n.top+=3Dm:b.at[1]=3D=3D=3De&&(n.top+=3Dm/= 2),n.left+=3Dk[0],n.top+=3Dk[1],this.each(function(){var c=3Da(this),d=3Dc.= outerWidth(),g=3Dc.outerHeight(),h=3DparseInt(a.curCSS(this,"marginLeft",!0= ))||0,i=3DparseInt(a.curCSS(this,"marginTop",!0))||0,o=3Dd+h+(parseInt(a.cu= rCSS(this,"marginRight",!0))||0),p=3Dg+i+(parseInt(a.curCSS(this,"marginBot= tom",!0))||0),q=3Da.extend({},n),r;b.my[0]=3D=3D=3D"right"?q.left-=3Dd:b.my= [0]=3D=3D=3De&&(q.left-=3Dd/2),b.my[1]=3D=3D=3D"bottom"?q.top-=3Dg:b.my[1]= =3D=3D=3De&&(q.top-=3Dg/2),f.fractions||(q.left=3DMath.round(q.left),q.top= =3DMath.round(q.top)),r=3D{left:q.left-h,top:q.top-i},a.each(["left","top"]= ,function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l= ,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth= :o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe= (),c.offset(a.extend(q,{using:b.using}))})},a.ui.position=3D{fit:{left:func= tion(b,c){var d=3Da(window),e=3Dc.collisionPosition.left+c.collisionWidth-d= .width()-d.scrollLeft();b.left=3De>0?b.left-e:Math.max(b.left-c.collisionPo= sition.left,b.left)},top:function(b,c){var d=3Da(window),e=3Dc.collisionPos= ition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=3De>0?b.top-e:Ma= th.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c= .at[0]=3D=3D=3De)return;var d=3Da(window),f=3Dc.collisionPosition.left+c.co= llisionWidth-d.width()-d.scrollLeft(),g=3Dc.my[0]=3D=3D=3D"left"?-c.elemWid= th:c.my[0]=3D=3D=3D"right"?c.elemWidth:0,h=3Dc.at[0]=3D=3D=3D"left"?c.targe= tWidth:-c.targetWidth,i=3D-2*c.offset[0];b.left+=3Dc.collisionPosition.left= <0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]=3D=3D=3De)return;var d= =3Da(window),f=3Dc.collisionPosition.top+c.collisionHeight-d.height()-d.scr= ollTop(),g=3Dc.my[1]=3D=3D=3D"top"?-c.elemHeight:c.my[1]=3D=3D=3D"bottom"?c= .elemHeight:0,h=3Dc.at[1]=3D=3D=3D"top"?c.targetHeight:-c.targetHeight,i=3D= -2*c.offset[1];b.top+=3Dc.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.of= fset.setOffset||(a.offset.setOffset=3Dfunction(b,c){/static/.test(a.curCSS(= b,"position"))&&(b.style.position=3D"relative");var d=3Da(b),e=3Dd.offset()= ,f=3DparseInt(a.curCSS(b,"top",!0),10)||0,g=3DparseInt(a.curCSS(b,"left",!0= ),10)||0,h=3D{top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.c= all(b,h):d.css(h)},a.fn.offset=3Dfunction(b){var c=3Dthis[0];return!c||!c.o= wnerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.= call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(th= is,b)}):h.call(this)}),a.curCSS||(a.curCSS=3Da.css),function(){var b=3Ddocu= ment.getElementsByTagName("body")[0],c=3Ddocument.createElement("div"),d,e,= g,h,i;d=3Ddocument.createElement(b?"div":"body"),g=3D{visibility:"hidden",w= idth:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{positio= n:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=3Dg[j= ];d.appendChild(c),e=3Db||document.documentElement,e.insertBefore(d,e.first= Child),c.style.cssText=3D"position: absolute; left: 10.7432222px; top: 10.4= 32325px; height: 30px; width: 201px;",h=3Da(c).offset(function(a,b){return = b}).offset(),d.innerHTML=3D"",e.removeChild(d),i=3Dh.top+h.left+(b?2e3:0),f= .fractions=3Di>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.autocomplete.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){var c=3D0;a.widget("ui.autocomplete",{options:{appendTo:"bo= dy",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bot= tom",collision:"none"},source:null},pending:0,_create:function(){var b=3Dth= is,c=3Dthis.element[0].ownerDocument,d;this.isMultiLine=3Dthis.element.is("= textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplet= e","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"= true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.el= ement.propAttr("readOnly"))return;d=3D!1;var e=3Da.ui.keyCode;switch(c.keyC= ode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._mov= e("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN= :b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active= &&(d=3D!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.se= lect(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:= clearTimeout(b.searching),b.searching=3DsetTimeout(function(){b.term!=3Db.e= lement.val()&&(b.selectedItem=3Dnull,b.search(null,c))},b.options.delay)}})= .bind("keypress.autocomplete",function(a){d&&(d=3D!1,a.preventDefault())}).= bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selecte= dItem=3Dnull,b.previous=3Db.element.val()}).bind("blur.autocomplete",functi= on(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=3Dse= tTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this= .menu=3Da("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.= appendTo||"body",c)[0]).mousedown(function(c){var d=3Db.menu.element[0];a(c= .target).closest(".ui-menu-item").length||setTimeout(function(){a(document)= .one("mousedown",function(c){c.target!=3D=3Db.element[0]&&c.target!=3D=3Dd&= &!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTim= eout(b.closing)},13)}).menu({focus:function(a,c){var d=3Dc.item.data("item.= autocomplete");!1!=3D=3Db._trigger("focus",a,{item:d})&&/^key/.test(a.origi= nalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=3Dd.it= em.data("item.autocomplete"),f=3Db.previous;b.element[0]!=3D=3Dc.activeElem= ent&&(b.element.focus(),b.previous=3Df,setTimeout(function(){b.previous=3Df= ,b.selectedItem=3De},1)),!1!=3D=3Db._trigger("select",a,{item:e})&&b.elemen= t.val(e.value),b.term=3Db.element.val(),b.close(a),b.selectedItem=3De},blur= :function(a,c){b.menu.element.is(":visible")&&b.element.val()!=3D=3Db.term&= &b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0= }).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.before= unloadHandler=3Dfunction(){b.element.removeAttr("autocomplete")},a(window).= bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element= .removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr= ("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.m= enu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandl= er),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widge= t.prototype._setOption.apply(this,arguments),b=3D=3D=3D"source"&&this._init= Source(),b=3D=3D=3D"appendTo"&&this.menu.element.appendTo(a(c||"body",this.= element[0].ownerDocument)[0]),b=3D=3D=3D"disabled"&&c&&this.xhr&&this.xhr.a= bort()},_initSource:function(){var b=3Dthis,c,d;a.isArray(this.options.sour= ce)?(c=3Dthis.options.source,this.source=3Dfunction(b,d){d(a.ui.autocomplet= e.filter(c,b.term))}):typeof this.options.source=3D=3D"string"?(d=3Dthis.op= tions.source,this.source=3Dfunction(c,e){b.xhr&&b.xhr.abort(),b.xhr=3Da.aja= x({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(= ){e([])}})}):this.source=3Dthis.options.source},search:function(a,b){a=3Da!= =3Dnull?a:this.element.val(),this.term=3Dthis.element.val();if(a.length<thi= s.options.minLength)return this.close(b);clearTimeout(this.closing);if(this= ._trigger("search",b)=3D=3D=3D!1)return;return this._search(a)},_search:fun= ction(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),th= is.source({term:a},this._response())},_response:function(){var a=3Dthis,b= =3D++c;return function(d){b=3D=3D=3Dc&&a.__response(d),a.pending--,a.pendin= g||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a= ){!this.options.disabled&&a&&a.length?(a=3Dthis._normalize(a),this._suggest= (a),this._trigger("open")):this.close()},close:function(a){clearTimeout(thi= s.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this= .menu.deactivate(),this._trigger("close",a))},_change:function(a){this.prev= ious!=3D=3Dthis.element.val()&&this._trigger("change",a,{item:this.selected= Item})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.= map(b,function(b){return typeof b=3D=3D"string"?{label:b,value:b}:a.extend(= {label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){= var c=3Dthis.menu.element.empty().zIndex(this.element.zIndex()+1);this._ren= derMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resi= zeMenu(),c.position(a.extend({of:this.element},this.options.position)),this= .options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:f= unction(){var a=3Dthis.menu.element;a.outerWidth(Math.max(a.width("").outer= Width()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=3Dth= is;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){r= eturn a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c= .label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visibl= e")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||= this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.de= activate();return}this.menu[a](b)},widget:function(){return this.menu.eleme= nt},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":vi= sible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{e= scapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}= ,filter:function(b,c){var d=3Dnew RegExp(a.ui.autocomplete.escapeRegex(c),"= i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(j= Query),function(a){a.widget("ui.menu",{_create:function(){var b=3Dthis;this= .element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr= ({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(funct= ion(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDe= fault(),b.select(c)}),this.refresh()},refresh:function(){var b=3Dthis,c=3Dt= his.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item= ").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("= tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouse= leave(function(){b.deactivate()})},activate:function(a,b){this.deactivate()= ;if(this.hasScroll()){var c=3Db.offset().top-this.element.offset().top,d=3D= this.element.scrollTop(),e=3Dthis.element.height();c<0?this.element.scrollT= op(d+c):c>=3De&&this.element.scrollTop(d+c-e+b.height())}this.active=3Db.eq= (0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem"= ).end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.a= ctive)return;this.active.children("a").removeClass("ui-state-hover").remove= Attr("id"),this._trigger("blur"),this.active=3Dnull},next:function(a){this.= move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev"= ,".ui-menu-item:last",a)},first:function(){return this.active&&!this.active= .prevAll(".ui-menu-item").length},last:function(){return this.active&&!this= .active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.acti= ve){this.activate(c,this.element.children(b));return}var d=3Dthis.active[a+= "All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,t= his.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!thi= s.active||this.last()){this.activate(b,this.element.children(".ui-menu-item= :first"));return}var c=3Dthis.active.offset().top,d=3Dthis.element.height()= ,e=3Dthis.element.children(".ui-menu-item").filter(function(){var b=3Da(thi= s).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=3Dth= is.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.act= ivate(b,this.element.children(".ui-menu-item").filter(!this.active||this.la= st()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!= this.active||this.first()){this.activate(b,this.element.children(".ui-menu-= item:last"));return}var c=3Dthis.active.offset().top,d=3Dthis.element.heigh= t(),e=3Dthis.element.children(".ui-menu-item").filter(function(){var b=3Da(= this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e= =3Dthis.element.children(".ui-menu-item:first")),this.activate(b,e)}else th= is.activate(b,this.element.children(".ui-menu-item").filter(!this.active||t= his.first()?":last":":first"))},hasScroll:function(){return this.element.he= ight()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:functi= on(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuer= y UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.slider.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){var c=3D5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefi= x:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizon= tal",range:!1,step:1,value:0,values:null},_create:function(){var b=3Dthis,d= =3Dthis.options,e=3Dthis.element.find(".ui-slider-handle").addClass("ui-sta= te-default ui-corner-all"),f=3D"<a class=3D'ui-slider-handle ui-state-defau= lt ui-corner-all' href=3D'#'></a>",g=3Dd.values&&d.values.length||1,h=3D[];= this._keySliding=3D!1,this._mouseSliding=3D!1,this._animateOff=3D!0,this._h= andleIndex=3Dnull,this._detectOrientation(),this._mouseInit(),this.element.= addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-c= ontent"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":""))= ,this.range=3Da([]),d.range&&(d.range=3D=3D=3D!0&&(d.values||(d.values=3D[t= his._valueMin(),this._valueMin()]),d.values.length&&d.values.length!=3D=3D2= &&(d.values=3D[d.values[0],d.values[0]])),this.range=3Da("<div></div>").app= endTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range=3D= =3D=3D"min"||d.range=3D=3D=3D"max"?" ui-slider-range-"+d.range:"")));for(va= r i=3De.length;i<g;i+=3D1)h.push(f);this.handles=3De.add(a(h.join("")).appe= ndTo(b.element)),this.handle=3Dthis.handles.eq(0),this.handles.add(this.ran= ge).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.d= isabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass= ("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-sli= der .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-st= ate-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this= .handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.h= andles.keydown(function(d){var e=3Da(this).data("index.ui-slider-handle"),f= ,g,h,i;if(b.options.disabled)return;switch(d.keyCode){case a.ui.keyCode.HOM= E:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DO= WN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case= a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=3D!0= ,a(this).addClass("ui-state-active"),f=3Db._start(d,e);if(f=3D=3D=3D!1)retu= rn}}i=3Db.options.step,b.options.values&&b.options.values.length?g=3Dh=3Db.= values(e):g=3Dh=3Db.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=3Db.= _valueMin();break;case a.ui.keyCode.END:h=3Db._valueMax();break;case a.ui.k= eyCode.PAGE_UP:h=3Db._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);bre= ak;case a.ui.keyCode.PAGE_DOWN:h=3Db._trimAlignValue(g-(b._valueMax()-b._va= lueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g=3D=3D= =3Db._valueMax())return;h=3Db._trimAlignValue(g+i);break;case a.ui.keyCode.= DOWN:case a.ui.keyCode.LEFT:if(g=3D=3D=3Db._valueMin())return;h=3Db._trimAl= ignValue(g-i)}b._slide(d,e,h)}).keyup(function(c){var d=3Da(this).data("ind= ex.ui-slider-handle");b._keySliding&&(b._keySliding=3D!1,b._stop(c,d),b._ch= ange(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),th= is._animateOff=3D!1},destroy:function(){return this.handles.remove(),this.r= ange.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-s= lider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all= ").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouse= Capture:function(b){var c=3Dthis.options,d,e,f,g,h,i,j,k,l;return c.disable= d?!1:(this.elementSize=3D{width:this.element.outerWidth(),height:this.eleme= nt.outerHeight()},this.elementOffset=3Dthis.element.offset(),d=3D{x:b.pageX= ,y:b.pageY},e=3Dthis._normValueFromMouse(d),f=3Dthis._valueMax()-this._valu= eMin()+1,h=3Dthis,this.handles.each(function(b){var c=3DMath.abs(e-h.values= (b));f>c&&(f=3Dc,g=3Da(this),i=3Db)}),c.range=3D=3D=3D!0&&this.values(1)=3D= =3D=3Dc.min&&(i+=3D1,g=3Da(this.handles[i])),j=3Dthis._start(b,i),j=3D=3D= =3D!1?!1:(this._mouseSliding=3D!0,h._handleIndex=3Di,g.addClass("ui-state-a= ctive").focus(),k=3Dg.offset(),l=3D!a(b.target).parents().andSelf().is(".ui= -slider-handle"),this._clickOffset=3Dl?{left:0,top:0}:{left:b.pageX-k.left-= g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"= ),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("mar= ginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,= e),this._animateOff=3D!0,!0))},_mouseStart:function(a){return!0},_mouseDrag= :function(a){var b=3D{x:a.pageX,y:a.pageY},c=3Dthis._normValueFromMouse(b);= return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return= this.handles.removeClass("ui-state-active"),this._mouseSliding=3D!1,this._= stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleInd= ex=3Dnull,this._clickOffset=3Dnull,this._animateOff=3D!1,!1},_detectOrienta= tion:function(){this.orientation=3Dthis.options.orientation=3D=3D=3D"vertic= al"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;= return this.orientation=3D=3D=3D"horizontal"?(b=3Dthis.elementSize.width,c= =3Da.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)= ):(b=3Dthis.elementSize.height,c=3Da.y-this.elementOffset.top-(this._clickO= ffset?this._clickOffset.top:0)),d=3Dc/b,d>1&&(d=3D1),d<0&&(d=3D0),this.orie= ntation=3D=3D=3D"vertical"&&(d=3D1-d),e=3Dthis._valueMax()-this._valueMin()= ,f=3Dthis._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var= c=3D{handle:this.handles[b],value:this.value()};return this.options.values= &&this.options.values.length&&(c.value=3Dthis.values(b),c.values=3Dthis.val= ues()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.op= tions.values&&this.options.values.length?(d=3Dthis.values(b?0:1),this.optio= ns.values.length=3D=3D=3D2&&this.options.range=3D=3D=3D!0&&(b=3D=3D=3D0&&c>= d||b=3D=3D=3D1&&c<d)&&(c=3Dd),c!=3D=3Dthis.values(b)&&(e=3Dthis.values(),e[= b]=3Dc,f=3Dthis._trigger("slide",a,{handle:this.handles[b],value:c,values:e= }),d=3Dthis.values(b?0:1),f!=3D=3D!1&&this.values(b,c,!0))):c!=3D=3Dthis.va= lue()&&(f=3Dthis._trigger("slide",a,{handle:this.handles[b],value:c}),f!=3D= =3D!1&&this.value(c))},_stop:function(a,b){var c=3D{handle:this.handles[b],= value:this.value()};this.options.values&&this.options.values.length&&(c.val= ue=3Dthis.values(b),c.values=3Dthis.values()),this._trigger("stop",a,c)},_c= hange:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c=3D{han= dle:this.handles[b],value:this.value()};this.options.values&&this.options.v= alues.length&&(c.value=3Dthis.values(b),c.values=3Dthis.values()),this._tri= gger("change",a,c)}},value:function(a){if(arguments.length){this.options.va= lue=3Dthis._trimAlignValue(a),this._refreshValue(),this._change(null,0);ret= urn}return this._value()},values:function(b,c){var d,e,f;if(arguments.lengt= h>1){this.options.values[b]=3Dthis._trimAlignValue(c),this._refreshValue(),= this._change(null,b);return}if(!arguments.length)return this._values();if(!= a.isArray(arguments[0]))return this.options.values&&this.options.values.len= gth?this._values(b):this.value();d=3Dthis.options.values,e=3Darguments[0];f= or(f=3D0;f<d.length;f+=3D1)d[f]=3Dthis._trimAlignValue(e[f]),this._change(n= ull,f);this._refreshValue()},_setOption:function(b,c){var d,e=3D0;a.isArray= (this.options.values)&&(e=3Dthis.options.values.length),a.Widget.prototype.= _setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.f= ilter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),= this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):= (this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled= "));break;case"orientation":this._detectOrientation(),this.element.removeCl= ass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.o= rientation),this._refreshValue();break;case"value":this._animateOff=3D!0,th= is._refreshValue(),this._change(null,0),this._animateOff=3D!1;break;case"va= lues":this._animateOff=3D!0,this._refreshValue();for(d=3D0;d<e;d+=3D1)this.= _change(null,d);this._animateOff=3D!1}},_value:function(){var a=3Dthis.opti= ons.value;return a=3Dthis._trimAlignValue(a),a},_values:function(a){var b,c= ,d;if(arguments.length)return b=3Dthis.options.values[a],b=3Dthis._trimAlig= nValue(b),b;c=3Dthis.options.values.slice();for(d=3D0;d<c.length;d+=3D1)c[d= ]=3Dthis._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<= =3Dthis._valueMin())return this._valueMin();if(a>=3Dthis._valueMax())return= this._valueMax();var b=3Dthis.options.step>0?this.options.step:1,c=3D(a-th= is._valueMin())%b,d=3Da-c;return Math.abs(c)*2>=3Db&&(d+=3Dc>0?b:-b),parseF= loat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax= :function(){return this.options.max},_refreshValue:function(){var b=3Dthis.= options.range,c=3Dthis.options,d=3Dthis,e=3Dthis._animateOff?!1:c.animate,f= ,g=3D{},h,i,j,k;this.options.values&&this.options.values.length?this.handle= s.each(function(b,i){f=3D(d.values(b)-d._valueMin())/(d._valueMax()-d._valu= eMin())*100,g[d.orientation=3D=3D=3D"horizontal"?"left":"bottom"]=3Df+"%",a= (this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range=3D=3D=3D!0= &&(d.orientation=3D=3D=3D"horizontal"?(b=3D=3D=3D0&&d.range.stop(1,1)[e?"an= imate":"css"]({left:f+"%"},c.animate),b=3D=3D=3D1&&d.range[e?"animate":"css= "]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b=3D=3D=3D0&&d.range.st= op(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b=3D=3D=3D1&&d.range[e= ?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=3Df})= :(i=3Dthis.value(),j=3Dthis._valueMin(),k=3Dthis._valueMax(),f=3Dk!=3D=3Dj?= (i-j)/(k-j)*100:0,g[d.orientation=3D=3D=3D"horizontal"?"left":"bottom"]=3Df= +"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b=3D=3D=3D"min"&= &this.orientation=3D=3D=3D"horizontal"&&this.range.stop(1,1)[e?"animate":"c= ss"]({width:f+"%"},c.animate),b=3D=3D=3D"max"&&this.orientation=3D=3D=3D"ho= rizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,durati= on:c.animate}),b=3D=3D=3D"min"&&this.orientation=3D=3D=3D"vertical"&&this.r= ange.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b=3D=3D=3D"max"= &&this.orientation=3D=3D=3D"vertical"&&this.range[e?"animate":"css"]({heigh= t:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{versi= on:"1.8.23"})})(jQuery);; diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/libs/jquery/jquery-ui-combobox.js --- /dev/null +++ b/static/scripts/libs/jquery/jquery-ui-combobox.js @@ -0,0 +1,142 @@ +/** + * A generic search + select combobox based on jQueryUI button and autocom= plete. + * Code is derived from http://jqueryui.com/autocomplete/ + *=20 + * Options: + * appendTo - element to attach autocomplete options to; default is <body> + * size - text input's size; default is 20 + */ + +(function( $ ) { + $.widget( "ui.combobox", { + _create: function() { + var input, + that =3D this, + select =3D this.element.hide(), + selected =3D select.children( ":selected" ), + value =3D selected.val() ? selected.text() : "", + wrapper =3D this.wrapper =3D $( "<span>" ) + .addClass( "ui-combobox" ) + .insertAfter( select ); + + function removeIfInvalid(element) { + var value =3D $( element ).val(), + matcher =3D new RegExp( "^" + $.ui.autocomplete.escape= Regex( value ) + "$", "i" ), + valid =3D false; + select.children( "option" ).each(function() { + if ( $( this ).text().match( matcher ) ) { + this.selected =3D valid =3D true; + return false; + } + }); + if ( !valid ) { + // remove invalid value, as it didn't match anything + $( element ) + .val( "" ) + .attr( "title", value + " didn't match any item" ) + .tooltip( "open" ); + select.val( "" ); + setTimeout(function() { + input.tooltip( "close" ).attr( "title", "" ); + }, 2500 ); + input.data( "autocomplete" ).term =3D ""; + return false; + } + } + + var size =3D ( this.options.size ? this.options.size : 20 ); + input =3D $( "<input>" ) + .appendTo( wrapper ) + .val( value ) + .click( function() { + this.select(); + }) + .attr( "title", "" ) + .attr( "size", size ) + .addClass( "ui-state-default ui-combobox-input" ) + .autocomplete({ + appendTo: this.options.appendTo, + delay: 0, + minLength: 0, + source: function( request, response ) { + var matcher =3D new RegExp( $.ui.autocomplete.esca= peRegex(request.term), "i" ); + response( select.children( "option" ).map(function= () { + var text =3D $( this ).text(); + if ( this.value && ( !request.term || matcher.= test(text) ) ) + return { + label: text.replace( + new RegExp( + "(?![^&;]+;)(?!<[^<>]*)(" + + $.ui.autocomplete.escapeRegex(= request.term) + + ")(?![^<>]*>)(?![^&;]+;)", "gi" + ), "<strong>$1</strong>" ), + value: text, + option: this + }; + }) ); + }, + select: function( event, ui ) { + ui.item.option.selected =3D true; + that._trigger( "selected", event, { + item: ui.item.option + }); + }, + change: function( event, ui ) { + if ( !ui.item ) + return removeIfInvalid( this ); + } + }) + .addClass( "ui-widget ui-widget-content ui-corner-left" ); + + input.data( "autocomplete" )._renderItem =3D function( ul, ite= m ) { + return $( "<li>" ) + .data( "item.autocomplete", item ) + .append( "<a>" + item.label + "</a>" ) + .appendTo( ul ); + }; + + $( "<a>" ) + .attr( "tabIndex", -1 ) + .attr( "title", "Show All Items" ) + .tooltip() + .appendTo( wrapper ) + .button({ + icons: { + primary: "ui-icon-triangle-1-s" + }, + text: false + }) + .removeClass( "ui-corner-all" ) + .addClass( "ui-corner-right ui-combobox-toggle" ) + .click(function() { + // close if already visible + if ( input.autocomplete( "widget" ).is( ":visible" ) )= { + input.autocomplete( "close" ); + removeIfInvalid( input ); + return; + } + + // work around a bug (likely same cause as #5265) + $( this ).blur(); + + // pass empty string as value to search for, displayin= g all results + input.autocomplete( "search", "" ); + input.focus(); + }); + + input + .tooltip({ + position: { + of: this.button + }, + tooltipClass: "ui-state-highlight" + }); + }, + + destroy: function() { + this.wrapper.remove(); + this.element.show(); + $.Widget.prototype.destroy.call( this ); + } + }); +})( jQuery ); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/libs/jquery/jquery-ui.js --- /dev/null +++ b/static/scripts/libs/jquery/jquery-ui.js @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jq= uery.ui.position.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery= .ui.menu.js, jquery.ui.slider.js +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT= */ + +(function(e,t){function i(t,n){var r,i,o,u=3Dt.nodeName.toLowerCase();retu= rn"area"=3D=3D=3Du?(r=3Dt.parentNode,i=3Dr.name,!t.href||!i||r.nodeName.toL= owerCase()!=3D=3D"map"?!1:(o=3De("img[usemap=3D#"+i+"]")[0],!!o&&s(o))):(/i= nput|select|textarea|button|object/.test(u)?!t.disabled:"a"=3D=3D=3Du?t.hre= f||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents= ().andSelf().filter(function(){return e.css(this,"visibility")=3D=3D=3D"hid= den"}).length}var n=3D0,r=3D/^ui-id-\d+$/;e.ui=3De.ui||{};if(e.ui.version)r= eturn;e.extend(e.ui,{version:"1.9.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:= 46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_= DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_S= UBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:3= 8}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=3D= =3D"number"?this.each(function(){var r=3Dthis;setTimeout(function(){e(r).fo= cus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:fu= nction(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"= ))||/absolute/.test(this.css("position"))?t=3Dthis.parents().filter(functio= n(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|= scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"o= verflow-x"))}).eq(0):t=3Dthis.parents().filter(function(){return/(auto|scro= ll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overf= low-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):= t},zIndex:function(n){if(n!=3D=3Dt)return this.css("zIndex",n);if(this.leng= th){var r=3De(this[0]),i,s;while(r.length&&r[0]!=3D=3Ddocument){i=3Dr.css("= position");if(i=3D=3D=3D"absolute"||i=3D=3D=3D"relative"||i=3D=3D=3D"fixed"= ){s=3DparseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!=3D=3D0)return s}r=3Dr.p= arent()}}return 0},uniqueId:function(){return this.each(function(){this.id|= |(this.id=3D"ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(fu= nction(){r.test(this.id)&&e(this).removeAttr("id")})}}),e("<a>").outerWidth= (1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){ret= urn e.each(i,function(){n-=3DparseFloat(e.css(t,"padding"+this))||0,r&&(n-= =3DparseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=3DparseFloat(e.css= (t,"margin"+this))||0)}),n}var i=3Dr=3D=3D=3D"Width"?["Left","Right"]:["Top= ","Bottom"],s=3Dr.toLowerCase(),o=3D{innerWidth:e.fn.innerWidth,innerHeight= :e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};= e.fn["inner"+r]=3Dfunction(n){return n=3D=3D=3Dt?o["inner"+r].call(this):th= is.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=3Dfunct= ion(t,n){return typeof t!=3D"number"?o["outer"+r].call(this,t):this.each(fu= nction(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data= :e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){ret= urn!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:funct= ion(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n= =3De.attr(t,"tabindex"),r=3DisNaN(n);return(r||n>=3D0)&&i(t,!r)}}),e(functi= on(){var t=3Ddocument.body,n=3Dt.appendChild(n=3Ddocument.createElement("di= v"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",paddi= ng:0,borderWidth:0}),e.support.minHeight=3Dn.offsetHeight=3D=3D=3D100,e.sup= port.selectstart=3D"onselectstart"in n,t.removeChild(n).style.display=3D"no= ne"}),function(){var t=3D/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCa= se())||[];e.ui.ie=3Dt.length?!0:!1,e.ui.ie6=3DparseFloat(t[1],10)=3D=3D=3D6= }(),e.fn.extend({disableSelection:function(){return this.bind((e.support.se= lectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.p= reventDefault()})},enableSelection:function(){return this.unbind(".ui-disab= leSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=3De.ui[= t].prototype;for(i in r)s.plugins[i]=3Ds.plugins[i]||[],s.plugins[i].push([= n,r[i]])},call:function(e,t,n){var r,i=3De.plugins[t];if(!i||!e.element[0].= parentNode||e.element[0].parentNode.nodeType=3D=3D=3D11)return;for(r=3D0;r<= i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.co= ntains,hasScroll:function(t,n){if(e(t).css("overflow")=3D=3D=3D"hidden")ret= urn!1;var r=3Dn&&n=3D=3D=3D"left"?"scrollLeft":"scrollTop",i=3D!1;return t[= r]>0?!0:(t[r]=3D1,i=3Dt[r]>0,t[r]=3D0,i)},isOverAxis:function(e,t,n){return= e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.= ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=3D0,r=3DArray.protot= ype.slice,i=3De.cleanData;e.cleanData=3Dfunction(t){for(var n=3D0,r;(r=3Dt[= n])!=3Dnull;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget= =3Dfunction(t,n,r){var i,s,o,u,a=3Dt.split(".")[0];t=3Dt.split(".")[1],i=3D= a+"-"+t,r||(r=3Dn,n=3De.Widget),e.expr[":"][i.toLowerCase()]=3Dfunction(t){= return!!e.data(t,i)},e[a]=3De[a]||{},s=3De[a][t],o=3De[a][t]=3Dfunction(e,t= ){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWi= dget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childCons= tructors:[]}),u=3Dnew n,u.options=3De.widget.extend({},u.options),e.each(r,= function(t,i){e.isFunction(i)&&(r[t]=3Dfunction(){var e=3Dfunction(){return= n.prototype[t].apply(this,arguments)},r=3Dfunction(e){return n.prototype[t= ].apply(this,e)};return function(){var t=3Dthis._super,n=3Dthis._superApply= ,s;return this._super=3De,this._superApply=3Dr,s=3Di.apply(this,arguments),= this._super=3Dt,this._superApply=3Dn,s}}())}),o.prototype=3De.widget.extend= (u,{widgetEventPrefix:u.widgetEventPrefix||t},r,{constructor:o,namespace:a,= widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstru= ctors,function(t,n){var r=3Dn.prototype;e.widget(r.namespace+"."+r.widgetNa= me,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),= e.widget.bridge(t,o)},e.widget.extend=3Dfunction(n){var i=3Dr.call(argument= s,1),s=3D0,o=3Di.length,u,a;for(;s<o;s++)for(u in i[s])a=3Di[s][u],i[s].has= OwnProperty(u)&&a!=3D=3Dt&&(e.isPlainObject(a)?n[u]=3De.isPlainObject(n[u])= ?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=3Da);return n},e.wid= get.bridge=3Dfunction(n,i){var s=3Di.prototype.widgetFullName;e.fn[n]=3Dfun= ction(o){var u=3Dtypeof o=3D=3D"string",a=3Dr.call(arguments,1),f=3Dthis;re= turn o=3D!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.ea= ch(function(){var r,i=3De.data(this,s);if(!i)return e.error("cannot call me= thods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'= ");if(!e.isFunction(i[o])||o.charAt(0)=3D=3D=3D"_")return e.error("no such = method '"+o+"' for "+n+" widget instance");r=3Di[o].apply(i,a);if(r!=3D=3Di= &&r!=3D=3Dt)return f=3Dr&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(fu= nction(){var t=3De.data(this,s);t?t.option(o||{})._init():new i(o,this)}),f= }},e.Widget=3Dfunction(){},e.Widget._childConstructors=3D[],e.Widget.protot= ype=3D{widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",opti= ons:{disabled:!1,create:null},_createWidget:function(t,r){r=3De(r||this.def= aultElement||this)[0],this.element=3De(r),this.uuid=3Dn++,this.eventNamespa= ce=3D"."+this.widgetName+this.uuid,this.options=3De.widget.extend({},this.o= ptions,this._getCreateOptions(),t),this.bindings=3De(),this.hoverable=3De()= ,this.focusable=3De(),r!=3D=3Dthis&&(e.data(r,this.widgetName,this),e.data(= r,this.widgetFullName,this),this._on(this.element,{remove:function(e){e.tar= get=3D=3D=3Dr&&this.destroy()}}),this.document=3De(r.style?r.ownerDocument:= r.document||r),this.window=3De(this.document[0].defaultView||this.document[= 0].parentWindow)),this._create(),this._trigger("create",null,this._getCreat= eEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.= noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.el= ement.unbind(this.eventNamespace).removeData(this.widgetName).removeData(th= is.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget= ().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this= .widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this= .eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusabl= e.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return t= his.element},option:function(n,r){var i=3Dn,s,o,u;if(arguments.length=3D=3D= =3D0)return e.widget.extend({},this.options);if(typeof n=3D=3D"string"){i= =3D{},s=3Dn.split("."),n=3Ds.shift();if(s.length){o=3Di[n]=3De.widget.exten= d({},this.options[n]);for(u=3D0;u<s.length-1;u++)o[s[u]]=3Do[s[u]]||{},o=3D= o[s[u]];n=3Ds.pop();if(r=3D=3D=3Dt)return o[n]=3D=3D=3Dt?null:o[n];o[n]=3Dr= }else{if(r=3D=3D=3Dt)return this.options[n]=3D=3D=3Dt?null:this.options[n];= i[n]=3Dr}}return this._setOptions(i),this},_setOptions:function(e){var t;fo= r(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){retu= rn this.options[e]=3Dt,e=3D=3D=3D"disabled"&&(this.widget().toggleClass(thi= s.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t)= ,this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("u= i-state-focus")),this},enable:function(){return this._setOption("disabled",= !1)},disable:function(){return this._setOption("disabled",!0)},_on:function= (t,n){var r,i=3Dthis;n?(t=3Dr=3De(t),this.bindings=3Dthis.bindings.add(t)):= (n=3Dt,t=3Dthis.element,r=3Dthis.widget()),e.each(n,function(n,s){function = o(){if(i.options.disabled=3D=3D=3D!0||e(this).hasClass("ui-state-disabled")= )return;return(typeof s=3D=3D"string"?i[s]:s).apply(i,arguments)}typeof s!= =3D"string"&&(o.guid=3Ds.guid=3Ds.guid||o.guid||e.guid++);var u=3Dn.match(/= ^(\w+)\s*(.*)$/),a=3Du[1]+i.eventNamespace,f=3Du[2];f?r.delegate(f,a,o):t.b= ind(a,o)})},_off:function(e,t){t=3D(t||"").split(" ").join(this.eventNamesp= ace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t= ){function n(){return(typeof e=3D=3D"string"?r[e]:e).apply(r,arguments)}var= r=3Dthis;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable= =3Dthis.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarg= et).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).r= emoveClass("ui-state-hover")}})},_focusable:function(t){this.focusable=3Dth= is.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addC= lass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass= ("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=3Dthis.options[t]= ;r=3Dr||{},n=3De.Event(n),n.type=3D(t=3D=3D=3Dthis.widgetEventPrefix?t:this= .widgetEventPrefix+t).toLowerCase(),n.target=3Dthis.element[0],s=3Dn.origin= alEvent;if(s)for(i in s)i in n||(n[i]=3Ds[i]);return this.element.trigger(n= ,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))=3D=3D=3D!1||n= .isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n= ){e.Widget.prototype["_"+t]=3Dfunction(r,i,s){typeof i=3D=3D"string"&&(i=3D= {effect:i});var o,u=3Di?i=3D=3D=3D!0||typeof i=3D=3D"number"?n:i.effect||n:= t;i=3Di||{},typeof i=3D=3D"number"&&(i=3D{duration:i}),o=3D!e.isEmptyObject= (i),i.complete=3Ds,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effec= t[u]||e.uiBackCompat!=3D=3D!1&&e.effects[u])?r[t](i):u!=3D=3Dt&&r[u]?r[u](i= .duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()}= )}}),e.uiBackCompat!=3D=3D!1&&(e.Widget.prototype._getCreateOptions=3Dfunct= ion(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})= })(jQuery);(function(e,t){var n=3D!1;e(document).mouseup(function(e){n=3D!1= }),e.widget("ui.mouse",{version:"1.9.1",options:{cancel:"input,textarea,but= ton,select,option",distance:1,delay:0},_mouseInit:function(){var t=3Dthis;t= his.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDo= wn(e)}).bind("click."+this.widgetName,function(n){if(!0=3D=3D=3De.data(n.ta= rget,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widg= etName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started= =3D!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),th= is._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this= ._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegat= e)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t)= ,this._mouseDownEvent=3Dt;var r=3Dthis,i=3Dt.which=3D=3D=3D1,s=3Dtypeof thi= s.options.cancel=3D=3D"string"&&t.target.nodeName?e(t.target).closest(this.= options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mo= useDelayMet=3D!this.options.delay,this.mouseDelayMet||(this._mouseDelayTime= r=3DsetTimeout(function(){r.mouseDelayMet=3D!0},this.options.delay));if(thi= s._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=3Dthis._= mouseStart(t)!=3D=3D!1;if(!this._mouseStarted)return t.preventDefault(),!0}= return!0=3D=3D=3De.data(t.target,this.widgetName+".preventClickEvent")&&e.r= emoveData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDel= egate=3Dfunction(e){return r._mouseMove(e)},this._mouseUpDelegate=3Dfunctio= n(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,th= is._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegat= e),t.preventDefault(),n=3D!0,!0},_mouseMove:function(t){return!e.ui.ie||doc= ument.documentMode>=3D9||!!t.button?this._mouseStarted?(this._mouseDrag(t),= t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(th= is._mouseStarted=3Dthis._mouseStart(this._mouseDownEvent,t)!=3D=3D!1,this._= mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this= ._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+t= his.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,t= his._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=3D!1,t.target= =3D=3D=3Dthis._mouseDownEvent.target&&e.data(t.target,this.widgetName+".pre= ventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){r= eturn Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._= mouseDownEvent.pageY-e.pageY))>=3Dthis.options.distance},_mouseDelayMet:fun= ction(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:fu= nction(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}= )(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test= (e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){r= eturn parseInt(e.css(t,n),10)||0}e.ui=3De.ui||{};var n,r=3DMath.max,i=3DMat= h.abs,s=3DMath.round,o=3D/left|center|right/,u=3D/top|center|bottom/,a=3D/[= \+\-]\d+%?/,f=3D/^\w+/,l=3D/%$/,c=3De.fn.position;e.position=3D{scrollbarWi= dth:function(){if(n!=3D=3Dt)return n;var r,i,s=3De("<div style=3D'display:b= lock;width:50px;height:50px;overflow:hidden;'><div style=3D'height:100px;wi= dth:auto;'></div></div>"),o=3Ds.children()[0];return e("body").append(s),r= =3Do.offsetWidth,s.css("overflow","scroll"),i=3Do.offsetWidth,r=3D=3D=3Di&&= (i=3Ds[0].clientWidth),s.remove(),n=3Dr-i},getScrollInfo:function(t){var n= =3Dt.isWindow?"":t.element.css("overflow-x"),r=3Dt.isWindow?"":t.element.cs= s("overflow-y"),i=3Dn=3D=3D=3D"scroll"||n=3D=3D=3D"auto"&&t.width<t.element= [0].scrollWidth,s=3Dr=3D=3D=3D"scroll"||r=3D=3D=3D"auto"&&t.height<t.elemen= t[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.p= osition.scrollbarWidth():0}},getWithinInfo:function(t){var n=3De(t||window)= ,r=3De.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:= 0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width(= ):n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=3Dfun= ction(t){if(!t||!t.of)return c.apply(this,arguments);t=3De.extend({},t);var= n,l,d,v,m,g=3De(t.of),y=3De.position.getWithinInfo(t.within),b=3De.positio= n.getScrollInfo(y),w=3Dg[0],E=3D(t.collision||"flip").split(" "),S=3D{};ret= urn w.nodeType=3D=3D=3D9?(l=3Dg.width(),d=3Dg.height(),v=3D{top:0,left:0}):= e.isWindow(w)?(l=3Dg.width(),d=3Dg.height(),v=3D{top:g.scrollTop(),left:g.s= crollLeft()}):w.preventDefault?(t.at=3D"left top",l=3Dd=3D0,v=3D{top:w.page= Y,left:w.pageX}):(l=3Dg.outerWidth(),d=3Dg.outerHeight(),v=3Dg.offset()),m= =3De.extend({},v),e.each(["my","at"],function(){var e=3D(t[this]||"").split= (" "),n,r;e.length=3D=3D=3D1&&(e=3Do.test(e[0])?e.concat(["center"]):u.test= (e[0])?["center"].concat(e):["center","center"]),e[0]=3Do.test(e[0])?e[0]:"= center",e[1]=3Du.test(e[1])?e[1]:"center",n=3Da.exec(e[0]),r=3Da.exec(e[1])= ,S[this]=3D[n?n[0]:0,r?r[0]:0],t[this]=3D[f.exec(e[0])[0],f.exec(e[1])[0]]}= ),E.length=3D=3D=3D1&&(E[1]=3DE[0]),t.at[0]=3D=3D=3D"right"?m.left+=3Dl:t.a= t[0]=3D=3D=3D"center"&&(m.left+=3Dl/2),t.at[1]=3D=3D=3D"bottom"?m.top+=3Dd:= t.at[1]=3D=3D=3D"center"&&(m.top+=3Dd/2),n=3Dh(S.at,l,d),m.left+=3Dn[0],m.t= op+=3Dn[1],this.each(function(){var o,u,a=3De(this),f=3Da.outerWidth(),c=3D= a.outerHeight(),w=3Dp(this,"marginLeft"),x=3Dp(this,"marginTop"),T=3Df+w+p(= this,"marginRight")+b.width,N=3Dc+x+p(this,"marginBottom")+b.height,C=3De.e= xtend({},m),k=3Dh(S.my,a.outerWidth(),a.outerHeight());t.my[0]=3D=3D=3D"rig= ht"?C.left-=3Df:t.my[0]=3D=3D=3D"center"&&(C.left-=3Df/2),t.my[1]=3D=3D=3D"= bottom"?C.top-=3Dc:t.my[1]=3D=3D=3D"center"&&(C.top-=3Dc/2),C.left+=3Dk[0],= C.top+=3Dk[1],e.support.offsetFractions||(C.left=3Ds(C.left),C.top=3Ds(C.to= p)),o=3D{marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui= .position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,ele= mWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:= N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgi= frame&&a.bgiframe(),t.using&&(u=3Dfunction(e){var n=3Dv.left-C.left,s=3Dn+l= -f,o=3Dv.top-C.top,u=3Do+d-c,h=3D{target:{element:g,left:v.left,top:v.top,w= idth:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c}= ,horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom"= :"middle"};l<f&&i(n+s)<l&&(h.horizontal=3D"center"),d<c&&i(o+u)<d&&(h.verti= cal=3D"middle"),r(i(n),i(s))>r(i(o),i(u))?h.important=3D"horizontal":h.impo= rtant=3D"vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))= })},e.ui.position=3D{fit:{left:function(e,t){var n=3Dt.within,i=3Dn.isWindo= w?n.scrollLeft:n.offset.left,s=3Dn.width,o=3De.left-t.collisionPosition.mar= ginLeft,u=3Di-o,a=3Do+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=3D0= ?(f=3De.left+u+t.collisionWidth-s-i,e.left+=3Du-f):a>0&&u<=3D0?e.left=3Di:u= p=3Di:u>a?e.top=3Di+s-t.collisionHeight:e.top=3Di:u>0?e.top+=3Du:a>0?e.top-= =3Da:e.top=3Dr(e.top-o,e.top)}},flip:{left:function(e,t){var n=3Dt.within,r= =3Dn.offset.left+n.scrollLeft,s=3Dn.width,o=3Dn.isWindow?n.scrollLeft:n.off= set.left,u=3De.left-t.collisionPosition.marginLeft,a=3Du-o,f=3Du+t.collisio= nWidth-s-o,l=3Dt.my[0]=3D=3D=3D"left"?-t.elemWidth:t.my[0]=3D=3D=3D"right"?= t.elemWidth:0,c=3Dt.at[0]=3D=3D=3D"left"?t.targetWidth:t.at[0]=3D=3D=3D"rig= ht"?-t.targetWidth:0,h=3D-2*t.offset[0],p,d;if(a<0){p=3De.left+l+c+h+t.coll= isionWidth-s-r;if(p<0||p<i(a))e.left+=3Dl+c+h}else if(f>0){d=3De.left-t.col= lisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=3Dl+c+h}},top:func= tion(e,t){var n=3Dt.within,r=3Dn.offset.top+n.scrollTop,s=3Dn.height,o=3Dn.= isWindow?n.scrollTop:n.offset.top,u=3De.top-t.collisionPosition.marginTop,a= =3Du-o,f=3Du+t.collisionHeight-s-o,l=3Dt.my[1]=3D=3D=3D"top",c=3Dl?-t.elemH= eight:t.my[1]=3D=3D=3D"bottom"?t.elemHeight:0,h=3Dt.at[1]=3D=3D=3D"top"?t.t= argetHeight:t.at[1]=3D=3D=3D"bottom"?-t.targetHeight:0,p=3D-2*t.offset[1],d= ,v;a<0?(v=3De.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&= &(e.top+=3Dc+h+p)):f>0&&(d=3De.top-t.collisionPosition.marginTop+c+h+p-o,e.= top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=3Dc+h+p))}},flipfit:{left:function(){e.= ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(th= is,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),= e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o= =3Ddocument.getElementsByTagName("body")[0],u=3Ddocument.createElement("div= ");t=3Ddocument.createElement(o?"div":"body"),r=3D{visibility:"hidden",widt= h:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"= absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=3Dr[s];t.app= endChild(u),n=3Do||document.documentElement,n.insertBefore(t,n.firstChild),= u.style.cssText=3D"position: absolute; left: 10.7432222px;",i=3De(u).offset= ().left,e.support.offsetFractions=3Di>10&&i<11,t.innerHTML=3D"",n.removeChi= ld(t)}(),e.uiBackCompat!=3D=3D!1&&function(e){var n=3De.fn.position;e.fn.po= sition=3Dfunction(r){if(!r||!r.offset)return n.call(this,r);var i=3Dr.offse= t.split(" "),s=3Dr.at.split(" ");return i.length=3D=3D=3D1&&(i[1]=3Di[0]),/= ^\d/.test(i[0])&&(i[0]=3D"+"+i[0]),/^\d/.test(i[1])&&(i[1]=3D"+"+i[1]),s.le= ngth=3D=3D=3D1&&(/left|center|right/.test(s[0])?s[1]=3D"center":(s[1]=3Ds[0= ],s[0]=3D"center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offs= et:t}))}}(jQuery)})(jQuery);(function(e,t){var n=3D0;e.widget("ui.autocompl= ete",{version:"1.9.1",defaultElement:"<input>",options:{appendTo:"body",aut= oFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",co= llision:"none"},source:null,change:null,close:null,focus:null,open:null,res= ponse:null,search:null,select:null},pending:0,_create:function(){var t,n,r;= this.isMultiLine=3Dthis._isMultiLine(),this.valueMethod=3Dthis.element[this= .element.is("input,textarea")?"val":"text"],this.isNewMenu=3D!0,this.elemen= t.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(thi= s.element,{keydown:function(i){if(this.element.prop("readOnly")){t=3D!0,r= =3D!0,n=3D!0;return}t=3D!1,r=3D!1,n=3D!1;var s=3De.ui.keyCode;switch(i.keyC= ode){case s.PAGE_UP:t=3D!0,this._move("previousPage",i);break;case s.PAGE_D= OWN:t=3D!0,this._move("nextPage",i);break;case s.UP:t=3D!0,this._keyEvent("= previous",i);break;case s.DOWN:t=3D!0,this._keyEvent("next",i);break;case s= .ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=3D!0,i.preventDefault(),thi= s.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);br= eak;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term)= ,this.close(i),i.preventDefault());break;default:n=3D!0,this._searchTimeout= (i)}},keypress:function(r){if(t){t=3D!1,r.preventDefault();return}if(n)retu= rn;var i=3De.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previo= usPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:= this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},i= nput:function(e){if(r){r=3D!1,e.preventDefault();return}this._searchTimeout= (e)},focus:function(){this.selectedItem=3Dnull,this.previous=3Dthis._value(= )},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clear= Timeout(this.searching),this.close(e),this._change(e)}}),this._initSource()= ,this.menu=3De("<ul>").addClass("ui-autocomplete").appendTo(this.document.f= ind(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(t= his.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mou= sedown:function(t){t.preventDefault(),this.cancelBlur=3D!0,this._delay(func= tion(){delete this.cancelBlur});var n=3Dthis.menu.element[0];e(t.target).cl= osest(".ui-menu-item").length||this._delay(function(){var t=3Dthis;this.doc= ument.one("mousedown",function(r){r.target!=3D=3Dt.element[0]&&r.target!=3D= =3Dn&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(th= is.isNewMenu){this.isNewMenu=3D!1;if(t.originalEvent&&/^mouse/.test(t.origi= nalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e= (t.target).trigger(t.originalEvent)});return}}var r=3Dn.item.data("ui-autoc= omplete-item")||n.item.data("item.autocomplete");!1!=3D=3Dthis._trigger("fo= cus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._= value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var = n=3Dt.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r= =3Dthis.previous;this.element[0]!=3D=3Dthis.document[0].activeElement&&(thi= s.element.focus(),this.previous=3Dr,this._delay(function(){this.previous=3D= r,this.selectedItem=3Dn})),!1!=3D=3Dthis._trigger("select",e,{item:n})&&thi= s._value(n.value),this.term=3Dthis._value(),this.close(e),this.selectedItem= =3Dn}}),this.liveRegion=3De("<span>",{role:"status","aria-live":"polite"}).= addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgif= rame&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:funct= ion(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clear= Timeout(this.searching),this.element.removeClass("ui-autocomplete-input").r= emoveAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove= ()},_setOption:function(e,t){this._super(e,t),e=3D=3D=3D"source"&&this._ini= tSource(),e=3D=3D=3D"appendTo"&&this.menu.element.appendTo(this.document.fi= nd(t||"body")[0]),e=3D=3D=3D"disabled"&&t&&this.xhr&&this.xhr.abort()},_isM= ultiLine:function(){return this.element.is("textarea")?!0:this.element.is("= input")?!1:this.element.prop("isContentEditable")},_initSource:function(){v= ar t,n,r=3Dthis;e.isArray(this.options.source)?(t=3Dthis.options.source,thi= s.source=3Dfunction(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof thi= s.options.source=3D=3D"string"?(n=3Dthis.options.source,this.source=3Dfunct= ion(t,i){r.xhr&&r.xhr.abort(),r.xhr=3De.ajax({url:n,data:t,dataType:"json",= success:function(e){i(e)},error:function(){i([])}})}):this.source=3Dthis.op= tions.source},_searchTimeout:function(e){clearTimeout(this.searching),this.= searching=3Dthis._delay(function(){this.term!=3D=3Dthis._value()&&(this.sel= ectedItem=3Dnull,this.search(null,e))},this.options.delay)},search:function= (e,t){e=3De!=3Dnull?e:this._value(),this.term=3Dthis._value();if(e.length<t= his.options.minLength)return this.close(t);if(this._trigger("search",t)=3D= =3D=3D!1)return;return this._search(e)},_search:function(e){this.pending++,= this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=3D!1,thi= s.source({term:e},this._response())},_response:function(){var e=3Dthis,t=3D= ++n;return function(r){t=3D=3D=3Dn&&e.__response(r),e.pending--,e.pending||= e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e= &&(e=3Dthis._normalize(e)),this._trigger("response",null,{content:e}),!this= .options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._= trigger("open")):this._close()},close:function(e){this.cancelSearch=3D!0,th= is._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.me= nu.element.hide(),this.menu.blur(),this.isNewMenu=3D!0,this._trigger("close= ",e))},_change:function(e){this.previous!=3D=3Dthis._value()&&this._trigger= ("change",e,{item:this.selectedItem})},_normalize:function(t){return t.leng= th&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=3D=3D"stri= ng"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.lab= el},t)})},_suggest:function(t){var n=3Dthis.menu.element.empty().zIndex(thi= s.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),th= is._resizeMenu(),n.position(e.extend({of:this.element},this.options.positio= n)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e= =3Dthis.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.= element.outerWidth()))},_renderMenu:function(t,n){var r=3Dthis;e.each(n,fun= ction(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return t= his._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t= ,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:func= tion(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}= if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^= next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](= t)},widget:function(){return this.menu.element},_value:function(){return th= is.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!t= his.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.prevent= Default()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.r= eplace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=3D= new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e= ){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.a= utocomplete,{options:{messages:{noResults:"No search results.",results:func= tion(e){return e+(e>1?" results are":" result is")+" available, use up and = down arrow keys to navigate."}}},__response:function(e){var t;this._superAp= ply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.leng= th?t=3Dthis.options.messages.results(e.length):t=3Dthis.options.messages.no= Results,this.liveRegion.text(t)}})})(jQuery);(function(e,t){var n,r,i,s,o= =3D"ui-button ui-widget ui-state-default ui-corner-all",u=3D"ui-state-hover= ui-state-active ",a=3D"ui-button-icons-only ui-button-icon-only ui-button-= text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-but= ton-text-only",f=3Dfunction(){var t=3De(this).find(":ui-button");setTimeout= (function(){t.button("refresh")},1)},l=3Dfunction(t){var n=3Dt.name,r=3Dt.f= orm,i=3De([]);return n&&(r?i=3De(r).find("[name=3D'"+n+"']"):i=3De("[name= =3D'"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.wi= dget("ui.button",{version:"1.9.1",defaultElement:"<button>",options:{disabl= ed:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:fun= ction(){this.element.closest("form").unbind("reset"+this.eventNamespace).bi= nd("reset"+this.eventNamespace,f),typeof this.options.disabled!=3D"boolean"= ?this.options.disabled=3D!!this.element.prop("disabled"):this.element.prop(= "disabled",this.options.disabled),this._determineButtonType(),this.hasTitle= =3D!!this.buttonElement.attr("title");var t=3Dthis,u=3Dthis.options,a=3Dthi= s.type=3D=3D=3D"checkbox"||this.type=3D=3D=3D"radio",c=3D"ui-state-hover"+(= a?"":" ui-state-active"),h=3D"ui-state-focus";u.label=3D=3D=3Dnull&&(u.labe= l=3Dthis.type=3D=3D=3D"input"?this.buttonElement.val():this.buttonElement.h= tml()),this.buttonElement.addClass(o).attr("role","button").bind("mouseente= r"+this.eventNamespace,function(){if(u.disabled)return;e(this).addClass("ui= -state-hover"),this=3D=3D=3Dn&&e(this).addClass("ui-state-active")}).bind("= mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).rem= oveClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.p= reventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+t= his.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+thi= s.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.eleme= nt.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),t= his.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.dis= abled)return;s=3D!1,r=3De.pageX,i=3De.pageY}).bind("mouseup"+this.eventName= space,function(e){if(u.disabled)return;if(r!=3D=3De.pageX||i!=3D=3De.pageY)= s=3D!0})),this.type=3D=3D=3D"checkbox"?this.buttonElement.bind("click"+this= .eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("u= i-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}= ):this.type=3D=3D=3D"radio"?this.buttonElement.bind("click"+this.eventNames= pace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active= "),t.buttonElement.attr("aria-pressed","true");var n=3Dt.element[0];l(n).no= t(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-st= ate-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mouse= down"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClas= s("ui-state-active"),n=3Dthis,t.document.one("mouseup",function(){n=3Dnull}= )}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(= this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,f= unction(t){if(u.disabled)return!1;(t.keyCode=3D=3D=3De.ui.keyCode.SPACE||t.= keyCode=3D=3D=3De.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).= bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-a= ctive")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){= t.keyCode=3D=3D=3De.ui.keyCode.SPACE&&e(this).click()})),this._setOption("d= isabled",u.disabled),this._resetButton()},_determineButtonType:function(){v= ar e,t,n;this.element.is("[type=3Dcheckbox]")?this.type=3D"checkbox":this.e= lement.is("[type=3Dradio]")?this.type=3D"radio":this.element.is("input")?th= is.type=3D"input":this.type=3D"button",this.type=3D=3D=3D"checkbox"||this.t= ype=3D=3D=3D"radio"?(e=3Dthis.element.parents().last(),t=3D"label[for=3D'"+= this.element.attr("id")+"']",this.buttonElement=3De.find(t),this.buttonElem= ent.length||(e=3De.length?e.siblings():this.element.siblings(),this.buttonE= lement=3De.filter(t),this.buttonElement.length||(this.buttonElement=3De.fin= d(t))),this.element.addClass("ui-helper-hidden-accessible"),n=3Dthis.elemen= t.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.but= tonElement.prop("aria-pressed",n)):this.buttonElement=3Dthis.element},widge= t:function(){return this.buttonElement},_destroy:function(){this.element.re= moveClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+"= "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonE= lement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.re= moveAttr("title")},_setOption:function(e,t){this._super(e,t);if(e=3D=3D=3D"= disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",= !1);return}this._resetButton()},refresh:function(){var t=3Dthis.element.is(= ":disabled")||this.element.hasClass("ui-button-disabled");t!=3D=3Dthis.opti= ons.disabled&&this._setOption("disabled",t),this.type=3D=3D=3D"radio"?l(thi= s.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget= ").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("= widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this= .type=3D=3D=3D"checkbox"&&(this.element.is(":checked")?this.buttonElement.a= ddClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.r= emoveClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:f= unction(){if(this.type=3D=3D=3D"input"){this.options.label&&this.element.va= l(this.options.label);return}var t=3Dthis.buttonElement.removeClass(a),n=3D= e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.op= tions.label).appendTo(t.empty()).text(),r=3Dthis.options.icons,i=3Dr.primar= y&&r.secondary,s=3D[];r.primary||r.secondary?(this.options.text&&s.push("ui= -button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.= prepend("<span class=3D'ui-button-icon-primary ui-icon "+r.primary+"'></spa= n>"),r.secondary&&t.append("<span class=3D'ui-button-icon-secondary ui-icon= "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-o= nly":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.pu= sh("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset= ",{version:"1.9.1",options:{items:"button, input[type=3Dbutton], input[type= =3Dsubmit], input[type=3Dreset], input[type=3Dcheckbox], input[type=3Dradio= ], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonse= t")},_init:function(){this.refresh()},_setOption:function(e,t){e=3D=3D=3D"d= isabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:funct= ion(){var t=3Dthis.element.css("direction")=3D=3D=3D"rtl";this.buttons=3Dth= is.element.find(this.options.items).filter(":ui-button").button("refresh").= end().not(":ui-button").button().end().map(function(){return e(this).button= ("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right")= .filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filt= er(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_de= stroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(= function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left= ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){var = n=3D!1;e.widget("ui.menu",{version:"1.9.1",defaultElement:"<ul>",delay:300,= options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left = top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:= function(){this.activeMenu=3Dthis.element,this.element.uniqueId().addClass(= "ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-i= cons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,= tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.opti= ons.disabled&&e.preventDefault()},this)),this.options.disabled&&this.elemen= t.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mou= sedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-= disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":= function(t){var r=3De(t.target).closest(".ui-menu-item");!n&&r.not(".ui-sta= te-disabled").length&&(n=3D!0,this.select(t),r.has(".ui-menu").length?this.= expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),th= is.active&&this.active.parents(".ui-menu").length=3D=3D=3D1&&clearTimeout(t= his.timer)))},"mouseenter .ui-menu-item":function(t){var n=3De(t.currentTar= get);n.siblings().children(".ui-state-active").removeClass("ui-state-active= "),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collaps= eAll",focus:function(e,t){var n=3Dthis.active||this.element.children(".ui-m= enu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(= ){e.contains(this.element[0],this.document[0].activeElement)||this.collapse= All(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click= :function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n= =3D!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendan= t").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-con= tent ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex"= ).removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("ari= a-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element= .find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").remov= eAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corne= r-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr= ("aria-haspopup").children().each(function(){var t=3De(this);t.data("ui-men= u-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").remov= eClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function = a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u= =3D!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);brea= k;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME= :this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last= ","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.key= Code.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;= case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&= &this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this.= _activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:= u=3D!1,r=3Dthis.previousFilter||"",i=3DString.fromCharCode(t.keyCode),s=3D!= 1,clearTimeout(this.filterTimer),i=3D=3D=3Dr?s=3D!0:i=3Dr+i,o=3Dnew RegExp(= "^"+a(i),"i"),n=3Dthis.activeMenu.children(".ui-menu-item").filter(function= (){return o.test(e(this).children("a").text())}),n=3Ds&&n.index(this.active= .next())!=3D=3D-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=3DStr= ing.fromCharCode(t.keyCode),o=3Dnew RegExp("^"+a(i),"i"),n=3Dthis.activeMen= u.children(".ui-menu-item").filter(function(){return o.test(e(this).childre= n("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter= =3Di,this.filterTimer=3Dthis._delay(function(){delete this.previousFilter},= 1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDe= fault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.= active.children("a[aria-haspopup=3D'true']").length?this.expand(e):this.sel= ect(e))},refresh:function(){var t,n=3Dthis.options.icons.submenu,r=3Dthis.e= lement.find(this.options.menus+":not(.ui-menu)").addClass("ui-menu ui-widge= t ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"ar= ia-hidden":"true","aria-expanded":"false"});t=3Dr.add(this.element),t.child= ren(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","pre= sentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabInd= ex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(functi= on(){var t=3De(this);/[^\-=E2=80=94=E2=80=93\s]/.test(t.text())||t.addClass= ("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").at= tr("aria-disabled","true"),r.each(function(){var t=3De(this),r=3Dt.prev("a"= ),i=3De("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu= -carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelled= by",r.attr("id"))}),this.active&&!e.contains(this.element[0],this.active[0]= )&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option= "}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type=3D= =3D=3D"focus"),this._scrollIntoView(t),this.active=3Dt.first(),r=3Dthis.act= ive.children("a").addClass("ui-state-focus"),this.options.role&&this.elemen= t.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest("= .ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type= =3D=3D=3D"keydown"?this._close():this.timer=3Dthis._delay(function(){this._= close()},this.delay),n=3Dt.children(".ui-menu"),n.length&&/^mouse/.test(e.t= ype)&&this._startOpening(n),this.activeMenu=3Dt.parent(),this._trigger("foc= us",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScrol= l()&&(n=3DparseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=3Dpar= seFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=3Dt.offset().top-this.= activeMenu.offset().top-n-r,s=3Dthis.activeMenu.scrollTop(),o=3Dthis.active= Menu.height(),u=3Dt.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this= .activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.ti= mer);if(!this.active)return;this.active.children("a").removeClass("ui-state= -focus"),this.active=3Dnull,this._trigger("blur",e,{item:this.active})},_st= artOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!= =3D=3D"true")return;this.timer=3Dthis._delay(function(){this._close(),this.= _open(e)},this.delay)},_open:function(t){var n=3De.extend({of:this.active},= this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu= ").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().re= moveAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseA= ll:function(t,n){clearTimeout(this.timer),this.timer=3Dthis._delay(function= (){var r=3Dn?this.element:e(t&&t.target).closest(this.element.find(".ui-men= u"));r.length||(r=3Dthis.element),this._close(r),this.blur(t),this.activeMe= nu=3Dr},this.delay)},_close:function(e){e||(e=3Dthis.active?this.active.par= ent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").at= tr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui= -state-active")},collapse:function(e){var t=3Dthis.active&&this.active.pare= nt().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this= .focus(e,t))},expand:function(e){var t=3Dthis.active&&this.active.children(= ".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.p= arent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._= move("next","first",e)},previous:function(e){this._move("prev","last",e)},i= sFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-it= em").length},isLastItem:function(){return this.active&&!this.active.nextAll= (".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e=3D=3D= =3D"first"||e=3D=3D=3D"last"?r=3Dthis.active[e=3D=3D=3D"first"?"prevAll":"n= extAll"](".ui-menu-item").eq(-1):r=3Dthis.active[e+"All"](".ui-menu-item").= eq(0));if(!r||!r.length||!this.active)r=3Dthis.activeMenu.children(".ui-men= u-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.acti= ve){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=3D= this.active.offset().top,i=3Dthis.element.height(),this.active.nextAll(".ui= -menu-item").each(function(){return n=3De(this),n.offset().top-r-i<0}),this= .focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.ac= tive?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active= ){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=3Dt= his.active.offset().top,i=3Dthis.element.height(),this.active.prevAll(".ui-= menu-item").each(function(){return n=3De(this),n.offset().top-r+i>0}),this.= focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())= },_hasScroll:function(){return this.element.outerHeight()<this.element.prop= ("scrollHeight")},select:function(t){this.active=3Dthis.active||e(t.target)= .closest(".ui-menu-item");var n=3D{item:this.active};this.active.has(".ui-m= enu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuer= y);(function(e,t){var n=3D5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.1= ",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,or= ientation:"horizontal",range:!1,step:1,value:0,values:null},_create:functio= n(){var t,r,i=3Dthis.options,s=3Dthis.element.find(".ui-slider-handle").add= Class("ui-state-default ui-corner-all"),o=3D"<a class=3D'ui-slider-handle u= i-state-default ui-corner-all' href=3D'#'></a>",u=3D[];this._keySliding=3D!= 1,this._mouseSliding=3D!1,this._animateOff=3D!0,this._handleIndex=3Dnull,th= is._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider = ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-= all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=3De([]),= i.range&&(i.range=3D=3D=3D!0&&(i.values||(i.values=3D[this._valueMin(),this= ._valueMin()]),i.values.length&&i.values.length!=3D=3D2&&(i.values=3D[i.val= ues[0],i.values[0]])),this.range=3De("<div></div>").appendTo(this.element).= addClass("ui-slider-range ui-widget-header"+(i.range=3D=3D=3D"min"||i.range= =3D=3D=3D"max"?" ui-slider-range-"+i.range:""))),r=3Di.values&&i.values.len= gth||1;for(t=3Ds.length;t<r;t++)u.push(o);this.handles=3Ds.add(e(u.join("")= ).appendTo(this.element)),this.handle=3Dthis.handles.eq(0),this.handles.add= (this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(= function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(func= tion(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?= e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus= "),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClas= s("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider= -handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,= u=3De(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.= keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyC= ode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCod= e.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this= ._keySliding=3D!0,e(t.target).addClass("ui-state-active"),r=3Dthis._start(t= ,u);if(r=3D=3D=3D!1)return}}o=3Dthis.options.step,this.options.values&&this= .options.values.length?i=3Ds=3Dthis.values(u):i=3Ds=3Dthis.value();switch(t= .keyCode){case e.ui.keyCode.HOME:s=3Dthis._valueMin();break;case e.ui.keyCo= de.END:s=3Dthis._valueMax();break;case e.ui.keyCode.PAGE_UP:s=3Dthis._trimA= lignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.= PAGE_DOWN:s=3Dthis._trimAlignValue(i-(this._valueMax()-this._valueMin())/n)= ;break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i=3D=3D=3Dthis._valu= eMax())return;s=3Dthis._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:ca= se e.ui.keyCode.LEFT:if(i=3D=3D=3Dthis._valueMin())return;s=3Dthis._trimAli= gnValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=3De(t.target).data= ("ui-slider-handle-index");this._keySliding&&(this._keySliding=3D!1,this._s= top(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),t= his._refreshValue(),this._animateOff=3D!1},_destroy:function(){this.handles= .remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider= -horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-conte= nt ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,= i,s,o,u,a,f,l=3Dthis,c=3Dthis.options;return c.disabled?!1:(this.elementSiz= e=3D{width:this.element.outerWidth(),height:this.element.outerHeight()},thi= s.elementOffset=3Dthis.element.offset(),n=3D{x:t.pageX,y:t.pageY},r=3Dthis.= _normValueFromMouse(n),i=3Dthis._valueMax()-this._valueMin()+1,this.handles= .each(function(t){var n=3DMath.abs(r-l.values(t));i>n&&(i=3Dn,s=3De(this),o= =3Dt)}),c.range=3D=3D=3D!0&&this.values(1)=3D=3D=3Dc.min&&(o+=3D1,s=3De(thi= s.handles[o])),u=3Dthis._start(t,o),u=3D=3D=3D!1?!1:(this._mouseSliding=3D!= 0,this._handleIndex=3Do,s.addClass("ui-state-active").focus(),a=3Ds.offset(= ),f=3D!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickO= ffset=3Df?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top= -s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("bo= rderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handle= s.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=3D!0,!0))= },_mouseStart:function(){return!0},_mouseDrag:function(e){var t=3D{x:e.page= X,y:e.pageY},n=3Dthis._normValueFromMouse(t);return this._slide(e,this._han= dleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-= state-active"),this._mouseSliding=3D!1,this._stop(e,this._handleIndex),this= ._change(e,this._handleIndex),this._handleIndex=3Dnull,this._clickOffset=3D= null,this._animateOff=3D!1,!1},_detectOrientation:function(){this.orientati= on=3Dthis.options.orientation=3D=3D=3D"vertical"?"vertical":"horizontal"},_= normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation=3D=3D= =3D"horizontal"?(t=3Dthis.elementSize.width,n=3De.x-this.elementOffset.left= -(this._clickOffset?this._clickOffset.left:0)):(t=3Dthis.elementSize.height= ,n=3De.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)= ),r=3Dn/t,r>1&&(r=3D1),r<0&&(r=3D0),this.orientation=3D=3D=3D"vertical"&&(r= =3D1-r),i=3Dthis._valueMax()-this._valueMin(),s=3Dthis._valueMin()+r*i,this= ._trimAlignValue(s)},_start:function(e,t){var n=3D{handle:this.handles[t],v= alue:this.value()};return this.options.values&&this.options.values.length&&= (n.value=3Dthis.values(t),n.values=3Dthis.values()),this._trigger("start",e= ,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.val= ues.length?(r=3Dthis.values(t?0:1),this.options.values.length=3D=3D=3D2&&th= is.options.range=3D=3D=3D!0&&(t=3D=3D=3D0&&n>r||t=3D=3D=3D1&&n<r)&&(n=3Dr),= n!=3D=3Dthis.values(t)&&(i=3Dthis.values(),i[t]=3Dn,s=3Dthis._trigger("slid= e",e,{handle:this.handles[t],value:n,values:i}),r=3Dthis.values(t?0:1),s!= =3D=3D!1&&this.values(t,n,!0))):n!=3D=3Dthis.value()&&(s=3Dthis._trigger("s= lide",e,{handle:this.handles[t],value:n}),s!=3D=3D!1&&this.value(n))},_stop= :function(e,t){var n=3D{handle:this.handles[t],value:this.value()};this.opt= ions.values&&this.options.values.length&&(n.value=3Dthis.values(t),n.values= =3Dthis.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this= ._keySliding&&!this._mouseSliding){var n=3D{handle:this.handles[t],value:th= is.value()};this.options.values&&this.options.values.length&&(n.value=3Dthi= s.values(t),n.values=3Dthis.values()),this._trigger("change",e,n)}},value:f= unction(e){if(arguments.length){this.options.value=3Dthis._trimAlignValue(e= ),this._refreshValue(),this._change(null,0);return}return this._value()},va= lues:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]= =3Dthis._trimAlignValue(n),this._refreshValue(),this._change(null,t);return= }if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))ret= urn this.options.values&&this.options.values.length?this._values(t):this.va= lue();r=3Dthis.options.values,i=3Darguments[0];for(s=3D0;s<r.length;s+=3D1)= r[s]=3Dthis._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()= },_setOption:function(t,n){var r,i=3D0;e.isArray(this.options.values)&&(i= =3Dthis.options.values.length),e.Widget.prototype._setOption.apply(this,arg= uments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").= blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabl= ed",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled"= ,!1),this.element.removeClass("ui-disabled"));break;case"orientation":this.= _detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slid= er-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();= break;case"value":this._animateOff=3D!0,this._refreshValue(),this._change(n= ull,0),this._animateOff=3D!1;break;case"values":this._animateOff=3D!0,this.= _refreshValue();for(r=3D0;r<i;r+=3D1)this._change(null,r);this._animateOff= =3D!1;break;case"min":case"max":this._animateOff=3D!0,this._refreshValue(),= this._animateOff=3D!1}},_value:function(){var e=3Dthis.options.value;return= e=3Dthis._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.= length)return t=3Dthis.options.values[e],t=3Dthis._trimAlignValue(t),t;n=3D= this.options.values.slice();for(r=3D0;r<n.length;r+=3D1)n[r]=3Dthis._trimAl= ignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=3Dthis._valueMin= ())return this._valueMin();if(e>=3Dthis._valueMax())return this._valueMax()= ;var t=3Dthis.options.step>0?this.options.step:1,n=3D(e-this._valueMin())%t= ,r=3De-n;return Math.abs(n)*2>=3Dt&&(r+=3Dn>0?t:-t),parseFloat(r.toFixed(5)= )},_valueMin:function(){return this.options.min},_valueMax:function(){retur= n this.options.max},_refreshValue:function(){var t,n,r,i,s,o=3Dthis.options= .range,u=3Dthis.options,a=3Dthis,f=3Dthis._animateOff?!1:u.animate,l=3D{};t= his.options.values&&this.options.values.length?this.handles.each(function(r= ){n=3D(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.ori= entation=3D=3D=3D"horizontal"?"left":"bottom"]=3Dn+"%",e(this).stop(1,1)[f?= "animate":"css"](l,u.animate),a.options.range=3D=3D=3D!0&&(a.orientation=3D= =3D=3D"horizontal"?(r=3D=3D=3D0&&a.range.stop(1,1)[f?"animate":"css"]({left= :n+"%"},u.animate),r=3D=3D=3D1&&a.range[f?"animate":"css"]({width:n-t+"%"},= {queue:!1,duration:u.animate})):(r=3D=3D=3D0&&a.range.stop(1,1)[f?"animate"= :"css"]({bottom:n+"%"},u.animate),r=3D=3D=3D1&&a.range[f?"animate":"css"]({= height:n-t+"%"},{queue:!1,duration:u.animate}))),t=3Dn}):(r=3Dthis.value(),= i=3Dthis._valueMin(),s=3Dthis._valueMax(),n=3Ds!=3D=3Di?(r-i)/(s-i)*100:0,l= [this.orientation=3D=3D=3D"horizontal"?"left":"bottom"]=3Dn+"%",this.handle= .stop(1,1)[f?"animate":"css"](l,u.animate),o=3D=3D=3D"min"&&this.orientatio= n=3D=3D=3D"horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%= "},u.animate),o=3D=3D=3D"max"&&this.orientation=3D=3D=3D"horizontal"&&this.= range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o= =3D=3D=3D"min"&&this.orientation=3D=3D=3D"vertical"&&this.range.stop(1,1)[f= ?"animate":"css"]({height:n+"%"},u.animate),o=3D=3D=3D"max"&&this.orientati= on=3D=3D=3D"vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{qu= eue:!1,duration:u.animate}))}})})(jQuery); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/libs/jquery/jquery-ui-1.8.23.custom= .min.js --- a/static/scripts/packed/libs/jquery/jquery-ui-1.8.23.custom.min.js +++ /dev/null @@ -1,30 +0,0 @@ -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.core.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(f,e){function h(a,l){var k=3Da.nodeName.toLowerCase();if("area"= =3D=3D=3Dk){var j=3Da.parentNode,i=3Dj.name,d;return !a.href||!i||j.nodeNam= e.toLowerCase()!=3D=3D"map"?!1:(d=3Df("img[usemap=3D#"+i+"]")[0],!!d&&g(d))= }return(/input|select|textarea|button|object/.test(k)?!a.disabled:"a"=3D=3D= k?a.href||l:l)&&g(a)}function g(a){return !f(a).parents().andSelf().filter(= function(){return f.curCSS(this,"visibility")=3D=3D=3D"hidden"||f.expr.filt= ers.hidden(this)}).length}f.ui=3Df.ui||{};if(f.ui.version){return}f.extend(= f.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,C= OMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END= :35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUM= PAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMP= AD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:= 32,TAB:9,UP:38,WINDOWS:91}}),f.fn.extend({propAttr:f.fn.prop||f.fn.attr,_fo= cus:f.fn.focus,focus:function(a,d){return typeof a=3D=3D"number"?this.each(= function(){var b=3Dthis;setTimeout(function(){f(b).focus(),d&&d.call(b)},a)= }):this._focus.apply(this,arguments)},scrollParent:function(){var a;return = f.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.= test(this.css("position"))?a=3Dthis.parents().filter(function(){return/(rel= ative|absolute|fixed)/.test(f.curCSS(this,"position",1))&&/(auto|scroll)/.t= est(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this= ,"overflow-x",1))}).eq(0):a=3Dthis.parents().filter(function(){return/(auto= |scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.= curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!a= .length?f(document):a},zIndex:function(j){if(j!=3D=3De){return this.css("zI= ndex",j)}if(this.length){var i=3Df(this[0]),b,a;while(i.length&&i[0]!=3D=3D= document){b=3Di.css("position");if(b=3D=3D=3D"absolute"||b=3D=3D=3D"relativ= e"||b=3D=3D=3D"fixed"){a=3DparseInt(i.css("zIndex"),10);if(!isNaN(a)&&a!=3D= =3D0){return a}}i=3Di.parent()}}return 0},disableSelection:function(){retur= n this.bind((f.support.selectstart?"selectstart":"mousedown")+".ui-disableS= election",function(b){b.preventDefault()})},enableSelection:function(){retu= rn this.unbind(".ui-disableSelection")}}),f("<a>").outerWidth(1).jquery||f.= each(["Width","Height"],function(l,k){function a(m,p,o,n){return f.each(j,f= unction(){p-=3DparseFloat(f.curCSS(m,"padding"+this,!0))||0,o&&(p-=3DparseF= loat(f.curCSS(m,"border"+this+"Width",!0))||0),n&&(p-=3DparseFloat(f.curCSS= (m,"margin"+this,!0))||0)}),p}var j=3Dk=3D=3D=3D"Width"?["Left","Right"]:["= Top","Bottom"],i=3Dk.toLowerCase(),b=3D{innerWidth:f.fn.innerWidth,innerHei= ght:f.fn.innerHeight,outerWidth:f.fn.outerWidth,outerHeight:f.fn.outerHeigh= t};f.fn["inner"+k]=3Dfunction(d){return d=3D=3D=3De?b["inner"+k].call(this)= :this.each(function(){f(this).css(i,a(this,d)+"px")})},f.fn["outer"+k]=3Dfu= nction(d,m){return typeof d!=3D"number"?b["outer"+k].call(this,d):this.each= (function(){f(this).css(i,a(this,d,!0,m)+"px")})}}),f.extend(f.expr[":"],{d= ata:f.expr.createPseudo?f.expr.createPseudo(function(a){return function(b){= return !!f.data(b,a)}}):function(a,j,i){return !!f.data(a,i[3])},focusable:= function(a){return h(a,!isNaN(f.attr(a,"tabindex")))},tabbable:function(a){= var i=3Df.attr(a,"tabindex"),c=3DisNaN(i);return(c||i>=3D0)&&h(a,!c)}}),f(f= unction(){var a=3Ddocument.body,d=3Da.appendChild(d=3Ddocument.createElemen= t("div"));d.offsetHeight,f.extend(d.style,{minHeight:"100px",height:"auto",= padding:0,borderWidth:0}),f.support.minHeight=3Dd.offsetHeight=3D=3D=3D100,= f.support.selectstart=3D"onselectstart" in d,a.removeChild(d).style.display= =3D"none"}),f.curCSS||(f.curCSS=3Df.css),f.extend(f.ui,{plugin:{add:functio= n(a,l,k){var j=3Df.ui[a].prototype;for(var i in k){j.plugins[i]=3Dj.plugins= [i]||[],j.plugins[i].push([l,k[i]])}},call:function(j,i,m){var l=3Dj.plugin= s[i];if(!l||!j.element[0].parentNode){return}for(var k=3D0;k<l.length;k++){= j.options[l[k][0]]&&l[k][1].apply(j.element,m)}}},contains:function(d,c){re= turn document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!=3D= =3Dc&&d.contains(c)},hasScroll:function(a,k){if(f(a).css("overflow")=3D=3D= =3D"hidden"){return !1}var j=3Dk&&k=3D=3D=3D"left"?"scrollLeft":"scrollTop"= ,i=3D!1;return a[j]>0?!0:(a[j]=3D1,i=3Da[j]>0,a[j]=3D0,i)},isOverAxis:funct= ion(i,d,j){return i>d&&i<d+j},isOver:function(a,m,l,k,j,i){return f.ui.isOv= erAxis(a,l,j)&&f.ui.isOverAxis(m,k,i)}})})(jQuery); -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.widget.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(f,e){if(f.cleanData){var h=3Df.cleanData;f.cleanData=3Dfunction(= a){for(var j=3D0,i;(i=3Da[j])!=3Dnull;j++){try{f(i).triggerHandler("remove"= )}catch(c){}}h(a)}}else{var g=3Df.fn.remove;f.fn.remove=3Dfunction(a,d){ret= urn this.each(function(){return d||(!a||f.filter(a,[this]).length)&&f("*",t= his).add([this]).each(function(){try{f(this).triggerHandler("remove")}catch= (c){}}),g.call(f(this),a,d)})}}f.widget=3Dfunction(a,m,l){var k=3Da.split("= .")[0],j;a=3Da.split(".")[1],j=3Dk+"-"+a,l||(l=3Dm,m=3Df.Widget),f.expr[":"= ][j]=3Dfunction(b){return !!f.data(b,a)},f[k]=3Df[k]||{},f[k][a]=3Dfunction= (d,c){arguments.length&&this._createWidget(d,c)};var i=3Dnew m;i.options=3D= f.extend(!0,{},i.options),f[k][a].prototype=3Df.extend(!0,i,{namespace:k,wi= dgetName:a,widgetEventPrefix:f[k][a].prototype.widgetEventPrefix||a,widgetB= aseClass:j},l),f.widget.bridge(a,f[k][a])},f.widget.bridge=3Dfunction(b,a){= f.fn[b]=3Dfunction(j){var i=3Dtypeof j=3D=3D"string",d=3DArray.prototype.sl= ice.call(arguments,1),c=3Dthis;return j=3D!i&&d.length?f.extend.apply(null,= [!0,j].concat(d)):j,i&&j.charAt(0)=3D=3D=3D"_"?c:(i?this.each(function(){va= r l=3Df.data(this,b),k=3Dl&&f.isFunction(l[j])?l[j].apply(l,d):l;if(k!=3D= =3Dl&&k!=3D=3De){return c=3Dk,!1}}):this.each(function(){var k=3Df.data(thi= s,b);k?k.option(j||{})._init():f.data(this,b,new a(j,this))}),c)}},f.Widget= =3Dfunction(d,c){arguments.length&&this._createWidget(d,c)},f.Widget.protot= ype=3D{widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_crea= teWidget:function(a,j){f.data(j,this.widgetName,this),this.element=3Df(j),t= his.options=3Df.extend(!0,{},this.options,this._getCreateOptions(),a);var i= =3Dthis;this.element.bind("remove."+this.widgetName,function(){i.destroy()}= ),this._create(),this._trigger("create"),this._init()},_getCreateOptions:fu= nction(){return f.metadata&&f.metadata.get(this.element[0])[this.widgetName= ]},_create:function(){},_init:function(){},destroy:function(){this.element.= unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbin= d("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetB= aseClass+"-disabled ui-state-disabled")},widget:function(){return this.elem= ent},option:function(i,b){var a=3Di;if(arguments.length=3D=3D=3D0){return f= .extend({},this.options)}if(typeof i=3D=3D"string"){if(b=3D=3D=3De){return = this.options[i]}a=3D{},a[i]=3Db}return this._setOptions(a),this},_setOption= s:function(a){var d=3Dthis;return f.each(a,function(i,c){d._setOption(i,c)}= ),this},_setOption:function(d,c){return this.options[d]=3Dc,d=3D=3D=3D"disa= bled"&&this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-dis= abled ui-state-disabled").attr("aria-disabled",c),this},enable:function(){r= eturn this._setOption("disabled",!1)},disable:function(){return this._setOp= tion("disabled",!0)},_trigger:function(a,m,l){var k,j,i=3Dthis.options[a];l= =3Dl||{},m=3Df.Event(m),m.type=3D(a=3D=3D=3Dthis.widgetEventPrefix?a:this.w= idgetEventPrefix+a).toLowerCase(),m.target=3Dthis.element[0],j=3Dm.original= Event;if(j){for(k in j){k in m||(m[k]=3Dj[k])}}return this.element.trigger(= m,l),!(f.isFunction(i)&&i.call(this.element[0],m,l)=3D=3D=3D!1||m.isDefault= Prevented())}}})(jQuery); -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.mouse.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(e,d){var f=3D!1;e(document).mouseup(function(b){f=3D!1}),e.widge= t("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseIni= t:function(){var a=3Dthis;this.element.bind("mousedown."+this.widgetName,fu= nction(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b= ){if(!0=3D=3D=3De.data(b.target,a.widgetName+".preventClickEvent")){return = e.removeData(b.target,a.widgetName+".preventClickEvent"),b.stopImmediatePro= pagation(),!1}}),this.started=3D!1},_mouseDestroy:function(){this.element.u= nbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mou= semove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.wi= dgetName,this._mouseUpDelegate)},_mouseDown:function(a){if(f){return}this._= mouseStarted&&this._mouseUp(a),this._mouseDownEvent=3Da;var h=3Dthis,g=3Da.= which=3D=3D1,c=3Dtypeof this.options.cancel=3D=3D"string"&&a.target.nodeNam= e?e(a.target).closest(this.options.cancel).length:!1;if(!g||c||!this._mouse= Capture(a)){return !0}this.mouseDelayMet=3D!this.options.delay,this.mouseDe= layMet||(this._mouseDelayTimer=3DsetTimeout(function(){h.mouseDelayMet=3D!0= },this.options.delay));if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)= ){this._mouseStarted=3Dthis._mouseStart(a)!=3D=3D!1;if(!this._mouseStarted)= {return a.preventDefault(),!0}}return !0=3D=3D=3De.data(a.target,this.widge= tName+".preventClickEvent")&&e.removeData(a.target,this.widgetName+".preven= tClickEvent"),this._mouseMoveDelegate=3Dfunction(b){return h._mouseMove(b)}= ,this._mouseUpDelegate=3Dfunction(b){return h._mouseUp(b)},e(document).bind= ("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this= .widgetName,this._mouseUpDelegate),a.preventDefault(),f=3D!0,!0},_mouseMove= :function(a){return !e.browser.msie||document.documentMode>=3D9||!!a.button= ?this._mouseStarted?(this._mouseDrag(a),a.preventDefault()):(this._mouseDis= tanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=3Dthis._mouseStart= (this._mouseDownEvent,a)!=3D=3D!1,this._mouseStarted?this._mouseDrag(a):thi= s._mouseUp(a)),!this._mouseStarted):this._mouseUp(a)},_mouseUp:function(a){= return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDeleg= ate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseSt= arted&&(this._mouseStarted=3D!1,a.target=3D=3Dthis._mouseDownEvent.target&&= e.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a)= ),!1},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDow= nEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=3Dthis= .options.distance},_mouseDelayMet:function(b){return this.mouseDelayMet},_m= ouseStart:function(b){},_mouseDrag:function(b){},_mouseStop:function(b){},_= mouseCapture:function(b){return !0}})})(jQuery); -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.position.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(j,i){j.ui=3Dj.ui||{};var p=3D/left|center|right/,o=3D/top|center= |bottom/,n=3D"center",m=3D{},l=3Dj.fn.position,k=3Dj.fn.offset;j.fn.positio= n=3Dfunction(c){if(!c||!c.of){return l.apply(this,arguments)}c=3Dj.extend({= },c);var q=3Dj(c.of),g=3Dq[0],f=3D(c.collision||"flip").split(" "),e=3Dc.of= fset?c.offset.split(" "):[0,0],d,a,r;return g.nodeType=3D=3D=3D9?(d=3Dq.wid= th(),a=3Dq.height(),r=3D{top:0,left:0}):g.setTimeout?(d=3Dq.width(),a=3Dq.h= eight(),r=3D{top:q.scrollTop(),left:q.scrollLeft()}):g.preventDefault?(c.at= =3D"left top",d=3Da=3D0,r=3D{top:c.of.pageY,left:c.of.pageX}):(d=3Dq.outerW= idth(),a=3Dq.outerHeight(),r=3Dq.offset()),j.each(["my","at"],function(){va= r b=3D(c[this]||"").split(" ");b.length=3D=3D=3D1&&(b=3Dp.test(b[0])?b.conc= at([n]):o.test(b[0])?[n].concat(b):[n,n]),b[0]=3Dp.test(b[0])?b[0]:n,b[1]= =3Do.test(b[1])?b[1]:n,c[this]=3Db}),f.length=3D=3D=3D1&&(f[1]=3Df[0]),e[0]= =3DparseInt(e[0],10)||0,e.length=3D=3D=3D1&&(e[1]=3De[0]),e[1]=3DparseInt(e= [1],10)||0,c.at[0]=3D=3D=3D"right"?r.left+=3Dd:c.at[0]=3D=3D=3Dn&&(r.left+= =3Dd/2),c.at[1]=3D=3D=3D"bottom"?r.top+=3Da:c.at[1]=3D=3D=3Dn&&(r.top+=3Da/= 2),r.left+=3De[0],r.top+=3De[1],this.each(function(){var z=3Dj(this),y=3Dz.= outerWidth(),x=3Dz.outerHeight(),w=3DparseInt(j.curCSS(this,"marginLeft",!0= ))||0,v=3DparseInt(j.curCSS(this,"marginTop",!0))||0,u=3Dy+w+(parseInt(j.cu= rCSS(this,"marginRight",!0))||0),t=3Dx+v+(parseInt(j.curCSS(this,"marginBot= tom",!0))||0),s=3Dj.extend({},r),b;c.my[0]=3D=3D=3D"right"?s.left-=3Dy:c.my= [0]=3D=3D=3Dn&&(s.left-=3Dy/2),c.my[1]=3D=3D=3D"bottom"?s.top-=3Dx:c.my[1]= =3D=3D=3Dn&&(s.top-=3Dx/2),m.fractions||(s.left=3DMath.round(s.left),s.top= =3DMath.round(s.top)),b=3D{left:s.left-w,top:s.top-v},j.each(["left","top"]= ,function(A,h){j.ui.position[f[A]]&&j.ui.position[f[A]][h](s,{targetWidth:d= ,targetHeight:a,elemWidth:y,elemHeight:x,collisionPosition:b,collisionWidth= :u,collisionHeight:t,offset:e,my:c.my,at:c.at})}),j.fn.bgiframe&&z.bgiframe= (),z.offset(j.extend(s,{using:c.using}))})},j.ui.position=3D{fit:{left:func= tion(a,h){var g=3Dj(window),f=3Dh.collisionPosition.left+h.collisionWidth-g= .width()-g.scrollLeft();a.left=3Df>0?a.left-f:Math.max(a.left-h.collisionPo= sition.left,a.left)},top:function(a,h){var g=3Dj(window),f=3Dh.collisionPos= ition.top+h.collisionHeight-g.height()-g.scrollTop();a.top=3Df>0?a.top-f:Ma= th.max(a.top-h.collisionPosition.top,a.top)}},flip:{left:function(a,u){if(u= .at[0]=3D=3D=3Dn){return}var t=3Dj(window),s=3Du.collisionPosition.left+u.c= ollisionWidth-t.width()-t.scrollLeft(),r=3Du.my[0]=3D=3D=3D"left"?-u.elemWi= dth:u.my[0]=3D=3D=3D"right"?u.elemWidth:0,q=3Du.at[0]=3D=3D=3D"left"?u.targ= etWidth:-u.targetWidth,e=3D-2*u.offset[0];a.left+=3Du.collisionPosition.lef= t<0?r+q+e:s>0?r+q+e:0},top:function(a,u){if(u.at[1]=3D=3D=3Dn){return}var t= =3Dj(window),s=3Du.collisionPosition.top+u.collisionHeight-t.height()-t.scr= ollTop(),r=3Du.my[1]=3D=3D=3D"top"?-u.elemHeight:u.my[1]=3D=3D=3D"bottom"?u= .elemHeight:0,q=3Du.at[1]=3D=3D=3D"top"?u.targetHeight:-u.targetHeight,e=3D= -2*u.offset[1];a.top+=3Du.collisionPosition.top<0?r+q+e:s>0?r+q+e:0}}},j.of= fset.setOffset||(j.offset.setOffset=3Dfunction(a,v){/static/.test(j.curCSS(= a,"position"))&&(a.style.position=3D"relative");var u=3Dj(a),t=3Du.offset()= ,s=3DparseInt(j.curCSS(a,"top",!0),10)||0,r=3DparseInt(j.curCSS(a,"left",!0= ),10)||0,q=3D{top:v.top-t.top+s,left:v.left-t.left+r};"using" in v?v.using.= call(a,q):u.css(q)},j.fn.offset=3Dfunction(a){var d=3Dthis[0];return !d||!d= .ownerDocument?null:a?j.isFunction(a)?this.each(function(b){j(this).offset(= a.call(this,b,j(this).offset()))}):this.each(function(){j.offset.setOffset(= this,a)}):k.call(this)}),j.curCSS||(j.curCSS=3Dj.css),function(){var a=3Ddo= cument.getElementsByTagName("body")[0],v=3Ddocument.createElement("div"),u,= t,s,r,q;u=3Ddocument.createElement(a?"div":"body"),s=3D{visibility:"hidden"= ,width:0,height:0,border:0,margin:0,background:"none"},a&&j.extend(s,{posit= ion:"absolute",left:"-1000px",top:"-1000px"});for(var f in s){u.style[f]=3D= s[f]}u.appendChild(v),t=3Da||document.documentElement,t.insertBefore(u,t.fi= rstChild),v.style.cssText=3D"position: absolute; left: 10.7432222px; top: 1= 0.432325px; height: 30px; width: 201px;",r=3Dj(v).offset(function(d,c){retu= rn c}).offset(),u.innerHTML=3D"",t.removeChild(u),q=3Dr.top+r.left+(a?2000:= 0),m.fractions=3Dq>21&&q<22}()})(jQuery); -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.autocomplete.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(e,d){var f=3D0;e.widget("ui.autocomplete",{options:{appendTo:"bo= dy",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bot= tom",collision:"none"},source:null},pending:0,_create:function(){var a=3Dth= is,h=3Dthis.element[0].ownerDocument,g;this.isMultiLine=3Dthis.element.is("= textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplet= e","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"= true"}).bind("keydown.autocomplete",function(i){if(a.options.disabled||a.el= ement.propAttr("readOnly")){return}g=3D!1;var b=3De.ui.keyCode;switch(i.key= Code){case b.PAGE_UP:a._move("previousPage",i);break;case b.PAGE_DOWN:a._mo= ve("nextPage",i);break;case b.UP:a._keyEvent("previous",i);break;case b.DOW= N:a._keyEvent("next",i);break;case b.ENTER:case b.NUMPAD_ENTER:a.menu.activ= e&&(g=3D!0,i.preventDefault());case b.TAB:if(!a.menu.active){return}a.menu.= select(i);break;case b.ESCAPE:a.element.val(a.term),a.close(i);break;defaul= t:clearTimeout(a.searching),a.searching=3DsetTimeout(function(){a.term!=3Da= .element.val()&&(a.selectedItem=3Dnull,a.search(null,i))},a.options.delay)}= }).bind("keypress.autocomplete",function(b){g&&(g=3D!1,b.preventDefault())}= ).bind("focus.autocomplete",function(){if(a.options.disabled){return}a.sele= ctedItem=3Dnull,a.previous=3Da.element.val()}).bind("blur.autocomplete",fun= ction(b){if(a.options.disabled){return}clearTimeout(a.searching),a.closing= =3DsetTimeout(function(){a.close(b),a._change(b)},150)}),this._initSource()= ,this.menu=3De("<ul></ul>").addClass("ui-autocomplete").appendTo(e(this.opt= ions.appendTo||"body",h)[0]).mousedown(function(i){var b=3Da.menu.element[0= ];e(i.target).closest(".ui-menu-item").length||setTimeout(function(){e(docu= ment).one("mousedown",function(j){j.target!=3D=3Da.element[0]&&j.target!=3D= =3Db&&!e.ui.contains(b,j.target)&&a.close()})},1),setTimeout(function(){cle= arTimeout(a.closing)},13)}).menu({focus:function(b,j){var i=3Dj.item.data("= item.autocomplete");!1!=3D=3Da._trigger("focus",b,{item:i})&&/^key/.test(b.= originalEvent.type)&&a.element.val(i.value)},selected:function(b,j){var i= =3Dj.item.data("item.autocomplete"),c=3Da.previous;a.element[0]!=3D=3Dh.act= iveElement&&(a.element.focus(),a.previous=3Dc,setTimeout(function(){a.previ= ous=3Dc,a.selectedItem=3Di},1)),!1!=3D=3Da._trigger("select",b,{item:i})&&a= .element.val(i.value),a.term=3Da.element.val(),a.close(b),a.selectedItem=3D= i},blur:function(b,i){a.menu.element.is(":visible")&&a.element.val()!=3D=3D= a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0= ,left:0}).hide().data("menu"),e.fn.bgiframe&&this.menu.element.bgiframe(),a= .beforeunloadHandler=3Dfunction(){a.element.removeAttr("autocomplete")},e(w= indow).bind("beforeunload",a.beforeunloadHandler)},destroy:function(){this.= element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").rem= oveAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup")= ,this.menu.element.remove(),e(window).unbind("beforeunload",this.beforeunlo= adHandler),e.Widget.prototype.destroy.call(this)},_setOption:function(a,g){= e.Widget.prototype._setOption.apply(this,arguments),a=3D=3D=3D"source"&&thi= s._initSource(),a=3D=3D=3D"appendTo"&&this.menu.element.appendTo(e(g||"body= ",this.element[0].ownerDocument)[0]),a=3D=3D=3D"disabled"&&g&&this.xhr&&thi= s.xhr.abort()},_initSource:function(){var a=3Dthis,h,g;e.isArray(this.optio= ns.source)?(h=3Dthis.options.source,this.source=3Dfunction(c,i){i(e.ui.auto= complete.filter(h,c.term))}):typeof this.options.source=3D=3D"string"?(g=3D= this.options.source,this.source=3Dfunction(i,b){a.xhr&&a.xhr.abort(),a.xhr= =3De.ajax({url:g,data:i,dataType:"json",success:function(j,c){b(j)},error:f= unction(){b([])}})}):this.source=3Dthis.options.source},search:function(g,c= ){g=3Dg!=3Dnull?g:this.element.val(),this.term=3Dthis.element.val();if(g.le= ngth<this.options.minLength){return this.close(c)}clearTimeout(this.closing= );if(this._trigger("search",c)=3D=3D=3D!1){return}return this._search(g)},_= search:function(b){this.pending++,this.element.addClass("ui-autocomplete-lo= ading"),this.source({term:b},this._response())},_response:function(){var g= =3Dthis,c=3D++f;return function(a){c=3D=3D=3Df&&g.__response(a),g.pending--= ,g.pending||g.element.removeClass("ui-autocomplete-loading")}},__response:f= unction(b){!this.options.disabled&&b&&b.length?(b=3Dthis._normalize(b),this= ._suggest(b),this._trigger("open")):this.close()},close:function(b){clearTi= meout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hi= de(),this.menu.deactivate(),this._trigger("close",b))},_change:function(b){= this.previous!=3D=3Dthis.element.val()&&this._trigger("change",b,{item:this= .selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].v= alue?a:e.map(a,function(c){return typeof c=3D=3D"string"?{label:c,value:c}:= e.extend({label:c.label||c.value,value:c.value||c.label},c)})},_suggest:fun= ction(a){var g=3Dthis.menu.element.empty().zIndex(this.element.zIndex()+1);= this._renderMenu(g,a),this.menu.deactivate(),this.menu.refresh(),g.show(),t= his._resizeMenu(),g.position(e.extend({of:this.element},this.options.positi= on)),this.options.autoFocus&&this.menu.next(new e.Event("mouseover"))},_res= izeMenu:function(){var b=3Dthis.menu.element;b.outerWidth(Math.max(b.width(= "").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,h){v= ar g=3Dthis;e.each(h,function(b,i){g._renderItem(a,i)})},_renderItem:functi= on(a,g){return e("<li></li>").data("item.autocomplete",g).append(e("<a></a>= ").text(g.label)).appendTo(a)},_move:function(g,c){if(!this.menu.element.is= (":visible")){this.search(null,c);return}if(this.menu.first()&&/^previous/.= test(g)||this.menu.last()&&/^next/.test(g)){this.element.val(this.term),thi= s.menu.deactivate();return}this.menu[g](c)},widget:function(){return this.m= enu.element},_keyEvent:function(g,c){if(!this.isMultiLine||this.menu.elemen= t.is(":visible")){this._move(g,c),c.preventDefault()}}}),e.extend(e.ui.auto= complete,{escapeRegex:function(b){return b.replace(/[-[\]{}()*+?.,\\^$|#\s]= /g,"\\$&")},filter:function(a,h){var g=3Dnew RegExp(e.ui.autocomplete.escap= eRegex(h),"i");return e.grep(a,function(b){return g.test(b.label||b.value||= b)})}})})(jQuery),function(b){b.widget("ui.menu",{_create:function(){var a= =3Dthis;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corne= r-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"})= .click(function(d){if(!b(d.target).closest(".ui-menu-item a").length){retur= n}d.preventDefault(),a.select(d)}),this.refresh()},refresh:function(){var a= =3Dthis,d=3Dthis.element.children("li:not(.ui-menu-item):has(a)").addClass(= "ui-menu-item").attr("role","menuitem");d.children("a").addClass("ui-corner= -all").attr("tabindex",-1).mouseenter(function(e){a.activate(e,b(this).pare= nt())}).mouseleave(function(){a.deactivate()})},activate:function(g,f){this= .deactivate();if(this.hasScroll()){var j=3Df.offset().top-this.element.offs= et().top,i=3Dthis.element.scrollTop(),h=3Dthis.element.height();j<0?this.el= ement.scrollTop(i+j):j>=3Dh&&this.element.scrollTop(i+j-h+f.height())}this.= active=3Df.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-act= ive-menuitem").end(),this._trigger("focus",g,{item:f})},deactivate:function= (){if(!this.active){return}this.active.children("a").removeClass("ui-state-= hover").removeAttr("id"),this._trigger("blur"),this.active=3Dnull},next:fun= ction(c){this.move("next",".ui-menu-item:first",c)},previous:function(c){th= is.move("prev",".ui-menu-item:last",c)},first:function(){return this.active= &&!this.active.prevAll(".ui-menu-item").length},last:function(){return this= .active&&!this.active.nextAll(".ui-menu-item").length},move:function(f,e,h)= {if(!this.active){this.activate(h,this.element.children(e));return}var g=3D= this.active[f+"All"](".ui-menu-item").eq(0);g.length?this.activate(h,g):thi= s.activate(h,this.element.children(e))},nextPage:function(a){if(this.hasScr= oll()){if(!this.active||this.last()){this.activate(a,this.element.children(= ".ui-menu-item:first"));return}var h=3Dthis.active.offset().top,g=3Dthis.el= ement.height(),f=3Dthis.element.children(".ui-menu-item").filter(function()= {var c=3Db(this).offset().top-h-g+b(this).height();return c<10&&c>-10});f.l= ength||(f=3Dthis.element.children(".ui-menu-item:last")),this.activate(a,f)= }else{this.activate(a,this.element.children(".ui-menu-item").filter(!this.a= ctive||this.last()?":first":":last"))}},previousPage:function(a){if(this.ha= sScroll()){if(!this.active||this.first()){this.activate(a,this.element.chil= dren(".ui-menu-item:last"));return}var h=3Dthis.active.offset().top,g=3Dthi= s.element.height(),f=3Dthis.element.children(".ui-menu-item").filter(functi= on(){var c=3Db(this).offset().top-h+g-b(this).height();return c<10&&c>-10})= ;f.length||(f=3Dthis.element.children(".ui-menu-item:first")),this.activate= (a,f)}else{this.activate(a,this.element.children(".ui-menu-item").filter(!t= his.active||this.first()?":last":":first"))}},hasScroll:function(){return t= his.element.height()<this.element[b.fn.prop?"prop":"attr"]("scrollHeight")}= ,select:function(c){this._trigger("selected",c,{item:this.active})}})}(jQue= ry); -/* jQuery UI - v1.8.23 - 2012-08-15 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.slider.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(e,d){var f=3D5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefi= x:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizon= tal",range:!1,step:1,value:0,values:null},_create:function(){var a=3Dthis,n= =3Dthis.options,m=3Dthis.element.find(".ui-slider-handle").addClass("ui-sta= te-default ui-corner-all"),l=3D"<a class=3D'ui-slider-handle ui-state-defau= lt ui-corner-all' href=3D'#'></a>",k=3Dn.values&&n.values.length||1,j=3D[];= this._keySliding=3D!1,this._mouseSliding=3D!1,this._animateOff=3D!0,this._h= andleIndex=3Dnull,this._detectOrientation(),this._mouseInit(),this.element.= addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-cont= ent ui-corner-all"+(n.disabled?" ui-slider-disabled ui-disabled":"")),this.= range=3De([]),n.range&&(n.range=3D=3D=3D!0&&(n.values||(n.values=3D[this._v= alueMin(),this._valueMin()]),n.values.length&&n.values.length!=3D=3D2&&(n.v= alues=3D[n.values[0],n.values[0]])),this.range=3De("<div></div>").appendTo(= this.element).addClass("ui-slider-range ui-widget-header"+(n.range=3D=3D=3D= "min"||n.range=3D=3D=3D"max"?" ui-slider-range-"+n.range:"")));for(var c=3D= m.length;c<k;c+=3D1){j.push(l)}this.handles=3Dm.add(e(j.join("")).appendTo(= a.element)),this.handle=3Dthis.handles.eq(0),this.handles.add(this.range).f= ilter("a").click(function(b){b.preventDefault()}).hover(function(){n.disabl= ed||e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-= state-hover")}).focus(function(){n.disabled?e(this).blur():(e(".ui-slider .= ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-f= ocus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.hand= les.each(function(g){e(this).data("index.ui-slider-handle",g)}),this.handle= s.keydown(function(s){var r=3De(this).data("index.ui-slider-handle"),q,p,o,= b;if(a.options.disabled){return}switch(s.keyCode){case e.ui.keyCode.HOME:ca= se e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:c= ase e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.u= i.keyCode.LEFT:s.preventDefault();if(!a._keySliding){a._keySliding=3D!0,e(t= his).addClass("ui-state-active"),q=3Da._start(s,r);if(q=3D=3D=3D!1){return}= }}b=3Da.options.step,a.options.values&&a.options.values.length?p=3Do=3Da.va= lues(r):p=3Do=3Da.value();switch(s.keyCode){case e.ui.keyCode.HOME:o=3Da._v= alueMin();break;case e.ui.keyCode.END:o=3Da._valueMax();break;case e.ui.key= Code.PAGE_UP:o=3Da._trimAlignValue(p+(a._valueMax()-a._valueMin())/f);break= ;case e.ui.keyCode.PAGE_DOWN:o=3Da._trimAlignValue(p-(a._valueMax()-a._valu= eMin())/f);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(p=3D=3D=3D= a._valueMax()){return}o=3Da._trimAlignValue(p+b);break;case e.ui.keyCode.DO= WN:case e.ui.keyCode.LEFT:if(p=3D=3D=3Da._valueMin()){return}o=3Da._trimAli= gnValue(p-b)}a._slide(s,r,o)}).keyup(function(g){var b=3De(this).data("inde= x.ui-slider-handle");a._keySliding&&(a._keySliding=3D!1,a._stop(g,b),a._cha= nge(g,b),e(this).removeClass("ui-state-active"))}),this._refreshValue(),thi= s._animateOff=3D!1},destroy:function(){return this.handles.remove(),this.ra= nge.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-sl= ider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"= ).removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseC= apture:function(v){var u=3Dthis.options,t,s,r,q,p,o,n,m,a;return u.disabled= ?!1:(this.elementSize=3D{width:this.element.outerWidth(),height:this.elemen= t.outerHeight()},this.elementOffset=3Dthis.element.offset(),t=3D{x:v.pageX,= y:v.pageY},s=3Dthis._normValueFromMouse(t),r=3Dthis._valueMax()-this._value= Min()+1,p=3Dthis,this.handles.each(function(g){var h=3DMath.abs(s-p.values(= g));r>h&&(r=3Dh,q=3De(this),o=3Dg)}),u.range=3D=3D=3D!0&&this.values(1)=3D= =3D=3Du.min&&(o+=3D1,q=3De(this.handles[o])),n=3Dthis._start(v,o),n=3D=3D= =3D!1?!1:(this._mouseSliding=3D!0,p._handleIndex=3Do,q.addClass("ui-state-a= ctive").focus(),m=3Dq.offset(),a=3D!e(v.target).parents().andSelf().is(".ui= -slider-handle"),this._clickOffset=3Da?{left:0,top:0}:{left:v.pageX-m.left-= q.width()/2,top:v.pageY-m.top-q.height()/2-(parseInt(q.css("borderTopWidth"= ),10)||0)-(parseInt(q.css("borderBottomWidth"),10)||0)+(parseInt(q.css("mar= ginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(v,o,= s),this._animateOff=3D!0,!0))},_mouseStart:function(b){return !0},_mouseDra= g:function(h){var g=3D{x:h.pageX,y:h.pageY},i=3Dthis._normValueFromMouse(g)= ;return this._slide(h,this._handleIndex,i),!1},_mouseStop:function(b){retur= n this.handles.removeClass("ui-state-active"),this._mouseSliding=3D!1,this.= _stop(b,this._handleIndex),this._change(b,this._handleIndex),this._handleIn= dex=3Dnull,this._clickOffset=3Dnull,this._animateOff=3D!1,!1},_detectOrient= ation:function(){this.orientation=3Dthis.options.orientation=3D=3D=3D"verti= cal"?"vertical":"horizontal"},_normValueFromMouse:function(h){var g,l,k,j,i= ;return this.orientation=3D=3D=3D"horizontal"?(g=3Dthis.elementSize.width,l= =3Dh.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)= ):(g=3Dthis.elementSize.height,l=3Dh.y-this.elementOffset.top-(this._clickO= ffset?this._clickOffset.top:0)),k=3Dl/g,k>1&&(k=3D1),k<0&&(k=3D0),this.orie= ntation=3D=3D=3D"vertical"&&(k=3D1-k),j=3Dthis._valueMax()-this._valueMin()= ,i=3Dthis._valueMin()+k*j,this._trimAlignValue(i)},_start:function(h,g){var= i=3D{handle:this.handles[g],value:this.value()};return this.options.values= &&this.options.values.length&&(i.value=3Dthis.values(g),i.values=3Dthis.val= ues()),this._trigger("start",h,i)},_slide:function(h,g,l){var k,j,i;this.op= tions.values&&this.options.values.length?(k=3Dthis.values(g?0:1),this.optio= ns.values.length=3D=3D=3D2&&this.options.range=3D=3D=3D!0&&(g=3D=3D=3D0&&l>= k||g=3D=3D=3D1&&l<k)&&(l=3Dk),l!=3D=3Dthis.values(g)&&(j=3Dthis.values(),j[= g]=3Dl,i=3Dthis._trigger("slide",h,{handle:this.handles[g],value:l,values:j= }),k=3Dthis.values(g?0:1),i!=3D=3D!1&&this.values(g,l,!0))):l!=3D=3Dthis.va= lue()&&(i=3Dthis._trigger("slide",h,{handle:this.handles[g],value:l}),i!=3D= =3D!1&&this.value(l))},_stop:function(h,g){var i=3D{handle:this.handles[g],= value:this.value()};this.options.values&&this.options.values.length&&(i.val= ue=3Dthis.values(g),i.values=3Dthis.values()),this._trigger("stop",h,i)},_c= hange:function(h,g){if(!this._keySliding&&!this._mouseSliding){var i=3D{han= dle:this.handles[g],value:this.value()};this.options.values&&this.options.v= alues.length&&(i.value=3Dthis.values(g),i.values=3Dthis.values()),this._tri= gger("change",h,i)}},value:function(b){if(arguments.length){this.options.va= lue=3Dthis._trimAlignValue(b),this._refreshValue(),this._change(null,0);ret= urn}return this._value()},values:function(a,j){var i,h,g;if(arguments.lengt= h>1){this.options.values[a]=3Dthis._trimAlignValue(j),this._refreshValue(),= this._change(null,a);return}if(!arguments.length){return this._values()}if(= !e.isArray(arguments[0])){return this.options.values&&this.options.values.l= ength?this._values(a):this.value()}i=3Dthis.options.values,h=3Darguments[0]= ;for(g=3D0;g<i.length;g+=3D1){i[g]=3Dthis._trimAlignValue(h[g]),this._chang= e(null,g)}this._refreshValue()},_setOption:function(a,i){var h,g=3D0;e.isAr= ray(this.options.values)&&(g=3Dthis.options.values.length),e.Widget.prototy= pe._setOption.apply(this,arguments);switch(a){case"disabled":i?(this.handle= s.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover= "),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled"= )):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disab= led"));break;case"orientation":this._detectOrientation(),this.element.remov= eClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+thi= s.orientation),this._refreshValue();break;case"value":this._animateOff=3D!0= ,this._refreshValue(),this._change(null,0),this._animateOff=3D!1;break;case= "values":this._animateOff=3D!0,this._refreshValue();for(h=3D0;h<g;h+=3D1){t= his._change(null,h)}this._animateOff=3D!1}},_value:function(){var b=3Dthis.= options.value;return b=3Dthis._trimAlignValue(b),b},_values:function(h){var= g,j,i;if(arguments.length){return g=3Dthis.options.values[h],g=3Dthis._tri= mAlignValue(g),g}j=3Dthis.options.values.slice();for(i=3D0;i<j.length;i+=3D= 1){j[i]=3Dthis._trimAlignValue(j[i])}return j},_trimAlignValue:function(h){= if(h<=3Dthis._valueMin()){return this._valueMin()}if(h>=3Dthis._valueMax())= {return this._valueMax()}var g=3Dthis.options.step>0?this.options.step:1,j= =3D(h-this._valueMin())%g,i=3Dh-j;return Math.abs(j)*2>=3Dg&&(i+=3Dj>0?g:-g= ),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_= valueMax:function(){return this.options.max},_refreshValue:function(){var t= =3Dthis.options.range,s=3Dthis.options,r=3Dthis,q=3Dthis._animateOff?!1:s.a= nimate,p,o=3D{},n,m,l,a;this.options.values&&this.options.values.length?thi= s.handles.each(function(c,g){p=3D(r.values(c)-r._valueMin())/(r._valueMax()= -r._valueMin())*100,o[r.orientation=3D=3D=3D"horizontal"?"left":"bottom"]= =3Dp+"%",e(this).stop(1,1)[q?"animate":"css"](o,s.animate),r.options.range= =3D=3D=3D!0&&(r.orientation=3D=3D=3D"horizontal"?(c=3D=3D=3D0&&r.range.stop= (1,1)[q?"animate":"css"]({left:p+"%"},s.animate),c=3D=3D=3D1&&r.range[q?"an= imate":"css"]({width:p-n+"%"},{queue:!1,duration:s.animate})):(c=3D=3D=3D0&= &r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},s.animate),c=3D=3D=3D1= &&r.range[q?"animate":"css"]({height:p-n+"%"},{queue:!1,duration:s.animate}= ))),n=3Dp}):(m=3Dthis.value(),l=3Dthis._valueMin(),a=3Dthis._valueMax(),p= =3Da!=3D=3Dl?(m-l)/(a-l)*100:0,o[r.orientation=3D=3D=3D"horizontal"?"left":= "bottom"]=3Dp+"%",this.handle.stop(1,1)[q?"animate":"css"](o,s.animate),t= =3D=3D=3D"min"&&this.orientation=3D=3D=3D"horizontal"&&this.range.stop(1,1)= [q?"animate":"css"]({width:p+"%"},s.animate),t=3D=3D=3D"max"&&this.orientat= ion=3D=3D=3D"horizontal"&&this.range[q?"animate":"css"]({width:100-p+"%"},{= queue:!1,duration:s.animate}),t=3D=3D=3D"min"&&this.orientation=3D=3D=3D"ve= rtical"&&this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},s.animate),= t=3D=3D=3D"max"&&this.orientation=3D=3D=3D"vertical"&&this.range[q?"animate= ":"css"]({height:100-p+"%"},{queue:!1,duration:s.animate}))}}),e.extend(e.u= i.slider,{version:"1.8.23"})})(jQuery); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/libs/jquery/jquery-ui-combobox.js --- /dev/null +++ b/static/scripts/packed/libs/jquery/jquery-ui-combobox.js @@ -0,0 +1,1 @@ +(function(a){a.widget("ui.combobox",{_create:function(){var c,g=3Dthis,b= =3Dthis.element.hide(),f=3Db.children(":selected"),h=3Df.val()?f.text():"",= i=3Dthis.wrapper=3Da("<span>").addClass("ui-combobox").insertAfter(b);funct= ion e(j){var l=3Da(j).val(),m=3Dnew RegExp("^"+a.ui.autocomplete.escapeRege= x(l)+"$","i"),k=3Dfalse;b.children("option").each(function(){if(a(this).tex= t().match(m)){this.selected=3Dk=3Dtrue;return false}});if(!k){a(j).val("").= attr("title",l+" didn't match any item").tooltip("open");b.val("");setTimeo= ut(function(){c.tooltip("close").attr("title","")},2500);c.data("autocomple= te").term=3D"";return false}}var d=3D(this.options.size?this.options.size:2= 0);c=3Da("<input>").appendTo(i).val(h).click(function(){this.select()}).att= r("title","").attr("size",d).addClass("ui-state-default ui-combobox-input")= .autocomplete({appendTo:this.options.appendTo,delay:0,minLength:0,source:fu= nction(k,j){var l=3Dnew RegExp(a.ui.autocomplete.escapeRegex(k.term),"i");j= (b.children("option").map(function(){var m=3Da(this).text();if(this.value&&= (!k.term||l.test(m))){return{label:m.replace(new RegExp("(?![^&;]+;)(?!<[^<=
]*)("+a.ui.autocomplete.escapeRegex(k.term)+")(?![^<>]*>)(?![^&;]+;)","gi"= ),"<strong>$1</strong>"),value:m,option:this}}}))},select:function(j,k){k.i= tem.option.selected=3Dtrue;g._trigger("selected",j,{item:k.item.option})},c= hange:function(j,k){if(!k.item){return e(this)}}}).addClass("ui-widget ui-w= idget-content ui-corner-left");c.data("autocomplete")._renderItem=3Dfunctio= n(j,k){return a("<li>").data("item.autocomplete",k).append("<a>"+k.label+"<= /a>").appendTo(j)};a("<a>").attr("tabIndex",-1).attr("title","Show All Item= s").tooltip().appendTo(i).button({icons:{primary:"ui-icon-triangle-1-s"},te= xt:false}).removeClass("ui-corner-all").addClass("ui-corner-right ui-combob= ox-toggle").click(function(){if(c.autocomplete("widget").is(":visible")){c.= autocomplete("close");e(c);return}a(this).blur();c.autocomplete("search",""= );c.focus()});c.tooltip({position:{of:this.button},tooltipClass:"ui-state-h= ighlight"})},destroy:function(){this.wrapper.remove();this.element.show();a= .Widget.prototype.destroy.call(this)}})})(jQuery); \ No newline at end of file
feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thi= ck_start=3DMath.max(block_start,thick_start),block_thick_end=3DMath.min(blo= ck_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end= -block_thick_start,thick_height);if(feature_blocks.length=3D=3D=3D1&&mode= =3D=3D=3D"Pack"){if(feature_strand=3D=3D=3D"+"){ctx.fillStyle=3Dctx.canvas.= manager.get_pattern("right_strand_inv")}else{if(feature_strand=3D=3D=3D"-")= {ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left_strand_inv")}}if(bloc= k_thick_start+14<block_thick_end){block_thick_start+=3D2;block_thick_end-= =3D2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_= start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){=
feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thi= ck_start=3DMath.max(block_start,thick_start),block_thick_end=3DMath.min(blo= ck_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end= -block_thick_start,thick_height);if(feature_blocks.length=3D=3D=3D1&&mode= =3D=3D=3D"Pack"){if(feature_strand=3D=3D=3D"+"){ctx.fillStyle=3Dctx.canvas.= manager.get_pattern("right_strand_inv")}else{if(feature_strand=3D=3D=3D"-")= {ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left_strand_inv")}}if(bloc= k_thick_start+14<block_thick_end){block_thick_start+=3D2;block_thick_end-= =3D2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_= start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){=
=3D0){return this.positive_ramp.map_value(value)}else{return this.negative= _ramp.map_value(-value)}};var DiagonalHeatmapPainter=3Dfunction(data,view_s= tart,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,= mode);var i,len;if(this.prefs.min_value=3D=3D=3Dundefined){var min_value=3D= Infinity;for(i=3D0,len=3Dthis.data.length;i<len;i++){min_value=3DMath.min(m= in_value,this.data[i][5])}this.prefs.min_value=3Dmin_value}if(this.prefs.ma= x_value=3D=3D=3Dundefined){var max_value=3D-Infinity;for(i=3D0,len=3Dthis.d= ata.length;i<len;i++){max_value=3DMath.max(max_value,this.data[i][5])}this.=
").appendTo(ar),al=3D$.farbtastic(aj,{width:100,height:100,callback:ap,col= or:at});au.append($("<div/>").css("clear","both"));(function(aw){an.click(f= unction(){aw.setColor(l.get_random_color())})})(al)}else{av.append($("<inpu= t />").attr("id",ai).attr("name",ai).val(at))}}}}if(ae.help){av.append($("<=
diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/libs/jquery/jquery-ui.js --- /dev/null +++ b/static/scripts/packed/libs/jquery/jquery-ui.js @@ -0,0 +1,5 @@ +/* jQuery UI - v1.9.1 - 2012-10-29 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jq= uery.ui.position.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery= .ui.menu.js, jquery.ui.slider.js +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT= */ +(function(f,b){function a(j,m){var k,h,l,e=3Dj.nodeName.toLowerCase();retu= rn"area"=3D=3D=3De?(k=3Dj.parentNode,h=3Dk.name,!j.href||!h||k.nodeName.toL= owerCase()!=3D=3D"map"?!1:(l=3Df("img[usemap=3D#"+h+"]")[0],!!l&&c(l))):(/i= nput|select|textarea|button|object/.test(e)?!j.disabled:"a"=3D=3D=3De?j.hre= f||m:m)&&c(j)}function c(e){return f.expr.filters.visible(e)&&!f(e).parents= ().andSelf().filter(function(){return f.css(this,"visibility")=3D=3D=3D"hid= den"}).length}var g=3D0,d=3D/^ui-id-\d+$/;f.ui=3Df.ui||{};if(f.ui.version){= return}f.extend(f.ui,{version:"1.9.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE= :46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD= _DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_= SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:= 38}}),f.fn.extend({_focus:f.fn.focus,focus:function(e,h){return typeof e=3D= =3D"number"?this.each(function(){var i=3Dthis;setTimeout(function(){f(i).fo= cus(),h&&h.call(i)},e)}):this._focus.apply(this,arguments)},scrollParent:fu= nction(){var e;return f.ui.ie&&/(static|relative)/.test(this.css("position"= ))||/absolute/.test(this.css("position"))?e=3Dthis.parents().filter(functio= n(){return/(relative|absolute|fixed)/.test(f.css(this,"position"))&&/(auto|= scroll)/.test(f.css(this,"overflow")+f.css(this,"overflow-y")+f.css(this,"o= verflow-x"))}).eq(0):e=3Dthis.parents().filter(function(){return/(auto|scro= ll)/.test(f.css(this,"overflow")+f.css(this,"overflow-y")+f.css(this,"overf= low-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?f(document):= e},zIndex:function(k){if(k!=3D=3Db){return this.css("zIndex",k)}if(this.len= gth){var j=3Df(this[0]),e,h;while(j.length&&j[0]!=3D=3Ddocument){e=3Dj.css(= "position");if(e=3D=3D=3D"absolute"||e=3D=3D=3D"relative"||e=3D=3D=3D"fixed= "){h=3DparseInt(j.css("zIndex"),10);if(!isNaN(h)&&h!=3D=3D0){return h}}j=3D= j.parent()}}return 0},uniqueId:function(){return this.each(function(){this.= id||(this.id=3D"ui-id-"+ ++g)})},removeUniqueId:function(){return this.each= (function(){d.test(this.id)&&f(this).removeAttr("id")})}}),f("<a>").outerWi= dth(1).jquery||f.each(["Width","Height"],function(m,k){function e(i,q,p,o){= return f.each(h,function(){q-=3DparseFloat(f.css(i,"padding"+this))||0,p&&(= q-=3DparseFloat(f.css(i,"border"+this+"Width"))||0),o&&(q-=3DparseFloat(f.c= ss(i,"margin"+this))||0)}),q}var h=3Dk=3D=3D=3D"Width"?["Left","Right"]:["T= op","Bottom"],j=3Dk.toLowerCase(),l=3D{innerWidth:f.fn.innerWidth,innerHeig= ht:f.fn.innerHeight,outerWidth:f.fn.outerWidth,outerHeight:f.fn.outerHeight= };f.fn["inner"+k]=3Dfunction(i){return i=3D=3D=3Db?l["inner"+k].call(this):= this.each(function(){f(this).css(j,e(this,i)+"px")})},f.fn["outer"+k]=3Dfun= ction(i,o){return typeof i!=3D"number"?l["outer"+k].call(this,i):this.each(= function(){f(this).css(j,e(this,i,!0,o)+"px")})}}),f.extend(f.expr[":"],{da= ta:f.expr.createPseudo?f.expr.createPseudo(function(e){return function(h){r= eturn !!f.data(h,e)}}):function(e,i,h){return !!f.data(e,h[3])},focusable:f= unction(e){return a(e,!isNaN(f.attr(e,"tabindex")))},tabbable:function(e){v= ar i=3Df.attr(e,"tabindex"),h=3DisNaN(i);return(h||i>=3D0)&&a(e,!h)}}),f(fu= nction(){var e=3Ddocument.body,h=3De.appendChild(h=3Ddocument.createElement= ("div"));h.offsetHeight,f.extend(h.style,{minHeight:"100px",height:"auto",p= adding:0,borderWidth:0}),f.support.minHeight=3Dh.offsetHeight=3D=3D=3D100,f= .support.selectstart=3D"onselectstart" in h,e.removeChild(h).style.display= =3D"none"}),function(){var e=3D/msie ([\w.]+)/.exec(navigator.userAgent.toL= owerCase())||[];f.ui.ie=3De.length?!0:!1,f.ui.ie6=3DparseFloat(e[1],10)=3D= =3D=3D6}(),f.fn.extend({disableSelection:function(){return this.bind((f.sup= port.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function= (h){h.preventDefault()})},enableSelection:function(){return this.unbind(".u= i-disableSelection")}}),f.extend(f.ui,{plugin:{add:function(h,l,k){var e,j= =3Df.ui[h].prototype;for(e in k){j.plugins[e]=3Dj.plugins[e]||[],j.plugins[= e].push([l,k[e]])}},call:function(l,j,m){var k,h=3Dl.plugins[j];if(!h||!l.e= lement[0].parentNode||l.element[0].parentNode.nodeType=3D=3D=3D11){return}f= or(k=3D0;k<h.length;k++){l.options[h[k][0]]&&h[k][1].apply(l.element,m)}}},= contains:f.contains,hasScroll:function(h,k){if(f(h).css("overflow")=3D=3D= =3D"hidden"){return !1}var j=3Dk&&k=3D=3D=3D"left"?"scrollLeft":"scrollTop"= ,e=3D!1;return h[j]>0?!0:(h[j]=3D1,e=3Dh[j]>0,h[j]=3D0,e)},isOverAxis:funct= ion(i,h,j){return i>h&&i<h+j},isOver:function(h,m,k,e,j,l){return f.ui.isOv= erAxis(h,k,j)&&f.ui.isOverAxis(m,e,l)}})})(jQuery);(function(d,b){var f=3D0= ,c=3DArray.prototype.slice,a=3Dd.cleanData;d.cleanData=3Dfunction(e){for(va= r i=3D0,h;(h=3De[i])!=3Dnull;i++){try{d(h).triggerHandler("remove")}catch(g= ){}}a(e)},d.widget=3Dfunction(j,p,l){var h,k,m,g,e=3Dj.split(".")[0];j=3Dj.= split(".")[1],h=3De+"-"+j,l||(l=3Dp,p=3Dd.Widget),d.expr[":"][h.toLowerCase= ()]=3Dfunction(i){return !!d.data(i,h)},d[e]=3Dd[e]||{},k=3Dd[e][j],m=3Dd[e= ][j]=3Dfunction(n,i){if(!this._createWidget){return new m(n,i)}arguments.le= ngth&&this._createWidget(n,i)},d.extend(m,k,{version:l.version,_proto:d.ext= end({},l),_childConstructors:[]}),g=3Dnew p,g.options=3Dd.widget.extend({},= g.options),d.each(l,function(o,n){d.isFunction(n)&&(l[o]=3Dfunction(){var q= =3Dfunction(){return p.prototype[o].apply(this,arguments)},i=3Dfunction(r){= return p.prototype[o].apply(this,r)};return function(){var r=3Dthis._super,= v=3Dthis._superApply,u;return this._super=3Dq,this._superApply=3Di,u=3Dn.ap= ply(this,arguments),this._super=3Dr,this._superApply=3Dv,u}}())}),m.prototy= pe=3Dd.widget.extend(g,{widgetEventPrefix:g.widgetEventPrefix||j},l,{constr= uctor:m,namespace:e,widgetName:j,widgetBaseClass:h,widgetFullName:h}),k?(d.= each(k._childConstructors,function(i,q){var o=3Dq.prototype;d.widget(o.name= space+"."+o.widgetName,m,q._proto)}),delete k._childConstructors):p._childC= onstructors.push(m),d.widget.bridge(j,m)},d.widget.extend=3Dfunction(l){var= h=3Dc.call(arguments,1),j=3D0,k=3Dh.length,g,e;for(;j<k;j++){for(g in h[j]= ){e=3Dh[j][g],h[j].hasOwnProperty(g)&&e!=3D=3Db&&(d.isPlainObject(e)?l[g]= =3Dd.isPlainObject(l[g])?d.widget.extend({},l[g],e):d.widget.extend({},e):l= [g]=3De)}}return l},d.widget.bridge=3Dfunction(h,e){var g=3De.prototype.wid= getFullName;d.fn[h]=3Dfunction(l){var j=3Dtypeof l=3D=3D"string",i=3Dc.call= (arguments,1),k=3Dthis;return l=3D!j&&i.length?d.widget.extend.apply(null,[= l].concat(i)):l,j?this.each(function(){var n,m=3Dd.data(this,g);if(!m){retu= rn d.error("cannot call methods on "+h+" prior to initialization; attempted= to call method '"+l+"'")}if(!d.isFunction(m[l])||l.charAt(0)=3D=3D=3D"_"){= return d.error("no such method '"+l+"' for "+h+" widget instance")}n=3Dm[l]= .apply(m,i);if(n!=3D=3Dm&&n!=3D=3Db){return k=3Dn&&n.jquery?k.pushStack(n.g= et()):n,!1}}):this.each(function(){var m=3Dd.data(this,g);m?m.option(l||{})= ._init():new e(l,this)}),k}},d.Widget=3Dfunction(){},d.Widget._childConstru= ctors=3D[],d.Widget.prototype=3D{widgetName:"widget",widgetEventPrefix:"",d= efaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:funct= ion(e,g){g=3Dd(g||this.defaultElement||this)[0],this.element=3Dd(g),this.uu= id=3Df++,this.eventNamespace=3D"."+this.widgetName+this.uuid,this.options= =3Dd.widget.extend({},this.options,this._getCreateOptions(),e),this.binding= s=3Dd(),this.hoverable=3Dd(),this.focusable=3Dd(),g!=3D=3Dthis&&(d.data(g,t= his.widgetName,this),d.data(g,this.widgetFullName,this),this._on(this.eleme= nt,{remove:function(h){h.target=3D=3D=3Dg&&this.destroy()}}),this.document= =3Dd(g.style?g.ownerDocument:g.document||g),this.window=3Dd(this.document[0= ].defaultView||this.document[0].parentWindow)),this._create(),this._trigger= ("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:= d.noop,_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:funct= ion(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(t= his.widgetName).removeData(this.widgetFullName).removeData(d.camelCase(this= .widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("ari= a-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled")= ,this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-s= tate-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:d.noop,= widget:function(){return this.element},option:function(l,j){var g=3Dl,h,k,e= ;if(arguments.length=3D=3D=3D0){return d.widget.extend({},this.options)}if(= typeof l=3D=3D"string"){g=3D{},h=3Dl.split("."),l=3Dh.shift();if(h.length){= k=3Dg[l]=3Dd.widget.extend({},this.options[l]);for(e=3D0;e<h.length-1;e++){= k[h[e]]=3Dk[h[e]]||{},k=3Dk[h[e]]}l=3Dh.pop();if(j=3D=3D=3Db){return k[l]= =3D=3D=3Db?null:k[l]}k[l]=3Dj}else{if(j=3D=3D=3Db){return this.options[l]= =3D=3D=3Db?null:this.options[l]}g[l]=3Dj}}return this._setOptions(g),this},= _setOptions:function(h){var g;for(g in h){this._setOption(g,h[g])}return th= is},_setOption:function(h,g){return this.options[h]=3Dg,h=3D=3D=3D"disabled= "&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disab= led",!!g).attr("aria-disabled",g),this.hoverable.removeClass("ui-state-hove= r"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){r= eturn this._setOption("disabled",!1)},disable:function(){return this._setOp= tion("disabled",!0)},_on:function(g,j){var h,e=3Dthis;j?(g=3Dh=3Dd(g),this.= bindings=3Dthis.bindings.add(g)):(j=3Dg,g=3Dthis.element,h=3Dthis.widget())= ,d.each(j,function(q,l){function p(){if(e.options.disabled=3D=3D=3D!0||d(th= is).hasClass("ui-state-disabled")){return}return(typeof l=3D=3D"string"?e[l= ]:l).apply(e,arguments)}typeof l!=3D"string"&&(p.guid=3Dl.guid=3Dl.guid||p.= guid||d.guid++);var k=3Dq.match(/^(\w+)\s*(.*)$/),i=3Dk[1]+e.eventNamespace= ,m=3Dk[2];m?h.delegate(m,i,p):g.bind(i,p)})},_off:function(h,g){g=3D(g||"")= .split(" ").join(this.eventNamespace+" ")+this.eventNamespace,h.unbind(g).u= ndelegate(g)},_delay:function(i,g){function j(){return(typeof i=3D=3D"strin= g"?h[i]:i).apply(h,arguments)}var h=3Dthis;return setTimeout(j,g||0)},_hove= rable:function(e){this.hoverable=3Dthis.hoverable.add(e),this._on(e,{mousee= nter:function(g){d(g.currentTarget).addClass("ui-state-hover")},mouseleave:= function(g){d(g.currentTarget).removeClass("ui-state-hover")}})},_focusable= :function(e){this.focusable=3Dthis.focusable.add(e),this._on(e,{focusin:fun= ction(g){d(g.currentTarget).addClass("ui-state-focus")},focusout:function(g= ){d(g.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(g,= l,j){var e,h,k=3Dthis.options[g];j=3Dj||{},l=3Dd.Event(l),l.type=3D(g=3D=3D= =3Dthis.widgetEventPrefix?g:this.widgetEventPrefix+g).toLowerCase(),l.targe= t=3Dthis.element[0],h=3Dl.originalEvent;if(h){for(e in h){e in l||(l[e]=3Dh= [e])}}return this.element.trigger(l,j),!(d.isFunction(k)&&k.apply(this.elem= ent[0],[l].concat(j))=3D=3D=3D!1||l.isDefaultPrevented())}},d.each({show:"f= adeIn",hide:"fadeOut"},function(e,g){d.Widget.prototype["_"+e]=3Dfunction(l= ,j,k){typeof j=3D=3D"string"&&(j=3D{effect:j});var m,h=3Dj?j=3D=3D=3D!0||ty= peof j=3D=3D"number"?g:j.effect||g:e;j=3Dj||{},typeof j=3D=3D"number"&&(j= =3D{duration:j}),m=3D!d.isEmptyObject(j),j.complete=3Dk,j.delay&&l.delay(j.= delay),m&&d.effects&&(d.effects.effect[h]||d.uiBackCompat!=3D=3D!1&&d.effec= ts[h])?l[e](j):h!=3D=3De&&l[h]?l[h](j.duration,j.easing,k):l.queue(function= (i){d(this)[e](),k&&k.call(l[0]),i()})}}),d.uiBackCompat!=3D=3D!1&&(d.Widge= t.prototype._getCreateOptions=3Dfunction(){return d.metadata&&d.metadata.ge= t(this.element[0])[this.widgetName]})})(jQuery);(function(b,a){var c=3D!1;b= (document).mouseup(function(d){c=3D!1}),b.widget("ui.mouse",{version:"1.9.1= ",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0}= ,_mouseInit:function(){var d=3Dthis;this.element.bind("mousedown."+this.wid= getName,function(f){return d._mouseDown(f)}).bind("click."+this.widgetName,= function(e){if(!0=3D=3D=3Db.data(e.target,d.widgetName+".preventClickEvent"= )){return b.removeData(e.target,d.widgetName+".preventClickEvent"),e.stopIm= mediatePropagation(),!1}}),this.started=3D!1},_mouseDestroy:function(){this= .element.unbind("."+this.widgetName),this._mouseMoveDelegate&&b(document).u= nbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup= ."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(c){ret= urn}this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=3De;var g=3Dt= his,d=3De.which=3D=3D=3D1,f=3Dtypeof this.options.cancel=3D=3D"string"&&e.t= arget.nodeName?b(e.target).closest(this.options.cancel).length:!1;if(!d||f|= |!this._mouseCapture(e)){return !0}this.mouseDelayMet=3D!this.options.delay= ,this.mouseDelayMet||(this._mouseDelayTimer=3DsetTimeout(function(){g.mouse= DelayMet=3D!0},this.options.delay));if(this._mouseDistanceMet(e)&&this._mou= seDelayMet(e)){this._mouseStarted=3Dthis._mouseStart(e)!=3D=3D!1;if(!this._= mouseStarted){return e.preventDefault(),!0}}return !0=3D=3D=3Db.data(e.targ= et,this.widgetName+".preventClickEvent")&&b.removeData(e.target,this.widget= Name+".preventClickEvent"),this._mouseMoveDelegate=3Dfunction(h){return g._= mouseMove(h)},this._mouseUpDelegate=3Dfunction(h){return g._mouseUp(h)},b(d= ocument).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("m= ouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),c=3D!0,!= 0},_mouseMove:function(d){return !b.ui.ie||document.documentMode>=3D9||!!d.= button?this._mouseStarted?(this._mouseDrag(d),d.preventDefault()):(this._mo= useDistanceMet(d)&&this._mouseDelayMet(d)&&(this._mouseStarted=3Dthis._mous= eStart(this._mouseDownEvent,d)!=3D=3D!1,this._mouseStarted?this._mouseDrag(= d):this._mouseUp(d)),!this._mouseStarted):this._mouseUp(d)},_mouseUp:functi= on(d){return b(document).unbind("mousemove."+this.widgetName,this._mouseMov= eDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._m= ouseStarted&&(this._mouseStarted=3D!1,d.target=3D=3D=3Dthis._mouseDownEvent= .target&&b.data(d.target,this.widgetName+".preventClickEvent",!0),this._mou= seStop(d)),!1},_mouseDistanceMet:function(d){return Math.max(Math.abs(this.= _mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY)= )>=3Dthis.options.distance},_mouseDelayMet:function(d){return this.mouseDel= ayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:functi= on(d){},_mouseCapture:function(d){return !0}})})(jQuery);(function(w,A){fun= ction q(c,a,f){return[parseInt(c[0],10)*(k.test(c[0])?a/100:1),parseInt(c[1= ],10)*(k.test(c[1])?f/100:1)]}function d(a,c){return parseInt(w.css(a,c),10= )||0}w.ui=3Dw.ui||{};var j,b=3DMath.max,m=3DMath.abs,B=3DMath.round,g=3D/le= ft|center|right/,z=3D/top|center|bottom/,y=3D/[\+\-]\d+%?/,v=3D/^\w+/,k=3D/= %$/,x=3Dw.fn.position;w.position=3D{scrollbarWidth:function(){if(j!=3D=3DA)= {return j}var e,a,c=3Dw("<div style=3D'display:block;width:50px;height:50px= ;overflow:hidden;'><div style=3D'height:100px;width:auto;'></div></div>"),f= =3Dc.children()[0];return w("body").append(c),e=3Df.offsetWidth,c.css("over= flow","scroll"),a=3Df.offsetWidth,e=3D=3D=3Da&&(a=3Dc[0].clientWidth),c.rem= ove(),j=3De-a},getScrollInfo:function(c){var h=3Dc.isWindow?"":c.element.cs= s("overflow-x"),f=3Dc.isWindow?"":c.element.css("overflow-y"),a=3Dh=3D=3D= =3D"scroll"||h=3D=3D=3D"auto"&&c.width<c.element[0].scrollWidth,e=3Df=3D=3D= =3D"scroll"||f=3D=3D=3D"auto"&&c.height<c.element[0].scrollHeight;return{wi= dth:a?w.position.scrollbarWidth():0,height:e?w.position.scrollbarWidth():0}= },getWithinInfo:function(a){var e=3Dw(a||window),c=3Dw.isWindow(e[0]);retur= n{element:e,isWindow:c,offset:e.offset()||{left:0,top:0},scrollLeft:e.scrol= lLeft(),scrollTop:e.scrollTop(),width:c?e.width():e.outerWidth(),height:c?e= .height():e.outerHeight()}}},w.fn.position=3Dfunction(u){if(!u||!u.of){retu= rn x.apply(this,arguments)}u=3Dw.extend({},u);var a,e,i,s,c,h=3Dw(u.of),p= =3Dw.position.getWithinInfo(u.within),o=3Dw.position.getScrollInfo(p),r=3Dh= [0],C=3D(u.collision||"flip").split(" "),f=3D{};return r.nodeType=3D=3D=3D9= ?(e=3Dh.width(),i=3Dh.height(),s=3D{top:0,left:0}):w.isWindow(r)?(e=3Dh.wid= th(),i=3Dh.height(),s=3D{top:h.scrollTop(),left:h.scrollLeft()}):r.preventD= efault?(u.at=3D"left top",e=3Di=3D0,s=3D{top:r.pageY,left:r.pageX}):(e=3Dh.= outerWidth(),i=3Dh.outerHeight(),s=3Dh.offset()),c=3Dw.extend({},s),w.each(= ["my","at"],function(){var t=3D(u[this]||"").split(" "),D,l;t.length=3D=3D= =3D1&&(t=3Dg.test(t[0])?t.concat(["center"]):z.test(t[0])?["center"].concat= (t):["center","center"]),t[0]=3Dg.test(t[0])?t[0]:"center",t[1]=3Dz.test(t[= 1])?t[1]:"center",D=3Dy.exec(t[0]),l=3Dy.exec(t[1]),f[this]=3D[D?D[0]:0,l?l= [0]:0],u[this]=3D[v.exec(t[0])[0],v.exec(t[1])[0]]}),C.length=3D=3D=3D1&&(C= [1]=3DC[0]),u.at[0]=3D=3D=3D"right"?c.left+=3De:u.at[0]=3D=3D=3D"center"&&(= c.left+=3De/2),u.at[1]=3D=3D=3D"bottom"?c.top+=3Di:u.at[1]=3D=3D=3D"center"= &&(c.top+=3Di/2),a=3Dq(f.at,e,i),c.left+=3Da[0],c.top+=3Da[1],this.each(fun= ction(){var n,K,H=3Dw(this),E=3DH.outerWidth(),G=3DH.outerHeight(),J=3Dd(th= is,"marginLeft"),I=3Dd(this,"marginTop"),D=3DE+J+d(this,"marginRight")+o.wi= dth,F=3DG+I+d(this,"marginBottom")+o.height,l=3Dw.extend({},c),t=3Dq(f.my,H= .outerWidth(),H.outerHeight());u.my[0]=3D=3D=3D"right"?l.left-=3DE:u.my[0]= =3D=3D=3D"center"&&(l.left-=3DE/2),u.my[1]=3D=3D=3D"bottom"?l.top-=3DG:u.my= [1]=3D=3D=3D"center"&&(l.top-=3DG/2),l.left+=3Dt[0],l.top+=3Dt[1],w.support= .offsetFractions||(l.left=3DB(l.left),l.top=3DB(l.top)),n=3D{marginLeft:J,m= arginTop:I},w.each(["left","top"],function(M,L){w.ui.position[C[M]]&&w.ui.p= osition[C[M]][L](l,{targetWidth:e,targetHeight:i,elemWidth:E,elemHeight:G,c= ollisionPosition:n,collisionWidth:D,collisionHeight:F,offset:[a[0]+t[0],a[1= ]+t[1]],my:u.my,at:u.at,within:p,elem:H})}),w.fn.bgiframe&&H.bgiframe(),u.u= sing&&(K=3Dfunction(O){var Q=3Ds.left-l.left,N=3DQ+e-E,P=3Ds.top-l.top,L=3D= P+i-G,M=3D{target:{element:h,left:s.left,top:s.top,width:e,height:i},elemen= t:{element:H,left:l.left,top:l.top,width:E,height:G},horizontal:N<0?"left":= Q>0?"right":"center",vertical:L<0?"top":P>0?"bottom":"middle"};e<E&&m(Q+N)<= e&&(M.horizontal=3D"center"),i<G&&m(P+L)<i&&(M.vertical=3D"middle"),b(m(Q),= m(N))>b(m(P),m(L))?M.important=3D"horizontal":M.important=3D"vertical",u.us= ing.call(this,O,M)}),H.offset(w.extend(l,{using:K}))})},w.ui.position=3D{fi= t:{left:function(r,E){var h=3DE.within,l=3Dh.isWindow?h.scrollLeft:h.offset= .left,F=3Dh.width,c=3Dr.left-E.collisionPosition.marginLeft,D=3Dl-c,C=3Dc+E= .collisionWidth-F-l,p;E.collisionWidth>F?D>0&&C<=3D0?(p=3Dr.left+D+E.collis= ionWidth-F-l,r.left+=3DD-p):C>0&&D<=3D0?r.left=3Dl:D>C?r.left=3Dl+F-E.colli= sionWidth:r.left=3Dl:D>0?r.left+=3DD:C>0?r.left-=3DC:r.left=3Db(r.left-c,r.= left)},top:function(r,E){var h=3DE.within,l=3Dh.isWindow?h.scrollTop:h.offs= et.top,F=3DE.within.height,c=3Dr.top-E.collisionPosition.marginTop,D=3Dl-c,= C=3Dc+E.collisionHeight-F-l,p;E.collisionHeight>F?D>0&&C<=3D0?(p=3Dr.top+D+= E.collisionHeight-F-l,r.top+=3DD-p):C>0&&D<=3D0?r.top=3Dl:D>C?r.top=3Dl+F-E= .collisionHeight:r.top=3Dl:D>0?r.top+=3DD:C>0?r.top-=3DC:r.top=3Db(r.top-c,= r.top)}},flip:{left:function(I,N){var E=3DN.within,i=3DE.offset.left+E.scro= llLeft,O=3DE.width,D=3DE.isWindow?E.scrollLeft:E.offset.left,M=3DI.left-N.c= ollisionPosition.marginLeft,L=3DM-D,H=3DM+N.collisionWidth-O-D,F=3DN.my[0]= =3D=3D=3D"left"?-N.elemWidth:N.my[0]=3D=3D=3D"right"?N.elemWidth:0,K=3DN.at= [0]=3D=3D=3D"left"?N.targetWidth:N.at[0]=3D=3D=3D"right"?-N.targetWidth:0,G= =3D-2*N.offset[0],C,J;if(L<0){C=3DI.left+F+K+G+N.collisionWidth-O-i;if(C<0|= |C<m(L)){I.left+=3DF+K+G}}else{if(H>0){J=3DI.left-N.collisionPosition.margi= nLeft+F+K+G-D;if(J>0||m(J)<H){I.left+=3DF+K+G}}}},top:function(I,O){var E= =3DO.within,i=3DE.offset.top+E.scrollTop,P=3DE.height,D=3DE.isWindow?E.scro= llTop:E.offset.top,N=3DI.top-O.collisionPosition.marginTop,L=3DN-D,H=3DN+O.= collisionHeight-P-D,F=3DO.my[1]=3D=3D=3D"top",K=3DF?-O.elemHeight:O.my[1]= =3D=3D=3D"bottom"?O.elemHeight:0,G=3DO.at[1]=3D=3D=3D"top"?O.targetHeight:O= .at[1]=3D=3D=3D"bottom"?-O.targetHeight:0,C=3D-2*O.offset[1],J,M;L<0?(M=3DI= .top+K+G+C+O.collisionHeight-P-i,I.top+K+G+C>L&&(M<0||M<m(L))&&(I.top+=3DK+= G+C)):H>0&&(J=3DI.top-O.collisionPosition.marginTop+K+G+C-D,I.top+K+G+C>H&&= (J>0||m(J)<H)&&(I.top+=3DK+G+C))}},flipfit:{left:function(){w.ui.position.f= lip.left.apply(this,arguments),w.ui.position.fit.left.apply(this,arguments)= },top:function(){w.ui.position.flip.top.apply(this,arguments),w.ui.position= .fit.top.apply(this,arguments)}}},function(){var e,p,h,c,f,l=3Ddocument.get= ElementsByTagName("body")[0],a=3Ddocument.createElement("div");e=3Ddocument= .createElement(l?"div":"body"),h=3D{visibility:"hidden",width:0,height:0,bo= rder:0,margin:0,background:"none"},l&&w.extend(h,{position:"absolute",left:= "-1000px",top:"-1000px"});for(f in h){e.style[f]=3Dh[f]}e.appendChild(a),p= =3Dl||document.documentElement,p.insertBefore(e,p.firstChild),a.style.cssTe= xt=3D"position: absolute; left: 10.7432222px;",c=3Dw(a).offset().left,w.sup= port.offsetFractions=3Dc>10&&c<11,e.innerHTML=3D"",p.removeChild(e)}(),w.ui= BackCompat!=3D=3D!1&&function(a){var c=3Da.fn.position;a.fn.position=3Dfunc= tion(h){if(!h||!h.offset){return c.call(this,h)}var e=3Dh.offset.split(" ")= ,f=3Dh.at.split(" ");return e.length=3D=3D=3D1&&(e[1]=3De[0]),/^\d/.test(e[= 0])&&(e[0]=3D"+"+e[0]),/^\d/.test(e[1])&&(e[1]=3D"+"+e[1]),f.length=3D=3D= =3D1&&(/left|center|right/.test(f[0])?f[1]=3D"center":(f[1]=3Df[0],f[0]=3D"= center")),c.call(this,a.extend(h,{at:f[0]+e[0]+" "+f[1]+e[1],offset:A}))}}(= jQuery)})(jQuery);(function(b,a){var c=3D0;b.widget("ui.autocomplete",{vers= ion:"1.9.1",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,= delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"n= one"},source:null,change:null,close:null,focus:null,open:null,response:null= ,search:null,select:null},pending:0,_create:function(){var d,f,e;this.isMul= tiLine=3Dthis._isMultiLine(),this.valueMethod=3Dthis.element[this.element.i= s("input,textarea")?"val":"text"],this.isNewMenu=3D!0,this.element.addClass= ("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,= {keydown:function(g){if(this.element.prop("readOnly")){d=3D!0,e=3D!0,f=3D!0= ;return}d=3D!1,e=3D!1,f=3D!1;var h=3Db.ui.keyCode;switch(g.keyCode){case h.= PAGE_UP:d=3D!0,this._move("previousPage",g);break;case h.PAGE_DOWN:d=3D!0,t= his._move("nextPage",g);break;case h.UP:d=3D!0,this._keyEvent("previous",g)= ;break;case h.DOWN:d=3D!0,this._keyEvent("next",g);break;case h.ENTER:case = h.NUMPAD_ENTER:this.menu.active&&(d=3D!0,g.preventDefault(),this.menu.selec= t(g));break;case h.TAB:this.menu.active&&this.menu.select(g);break;case h.E= SCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(= g),g.preventDefault());break;default:f=3D!0,this._searchTimeout(g)}},keypre= ss:function(h){if(d){d=3D!1,h.preventDefault();return}if(f){return}var g=3D= b.ui.keyCode;switch(h.keyCode){case g.PAGE_UP:this._move("previousPage",h);= break;case g.PAGE_DOWN:this._move("nextPage",h);break;case g.UP:this._keyEv= ent("previous",h);break;case g.DOWN:this._keyEvent("next",h)}},input:functi= on(g){if(e){e=3D!1,g.preventDefault();return}this._searchTimeout(g)},focus:= function(){this.selectedItem=3Dnull,this.previous=3Dthis._value()},blur:fun= ction(g){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(thi= s.searching),this.close(g),this._change(g)}}),this._initSource(),this.menu= =3Db("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.o= ptions.appendTo||"body")[0]).menu({input:b(),role:null}).zIndex(this.elemen= t.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:fun= ction(g){g.preventDefault(),this.cancelBlur=3D!0,this._delay(function(){del= ete this.cancelBlur});var h=3Dthis.menu.element[0];b(g.target).closest(".ui= -menu-item").length||this._delay(function(){var i=3Dthis;this.document.one(= "mousedown",function(j){j.target!=3D=3Di.element[0]&&j.target!=3D=3Dh&&!b.c= ontains(h,j.target)&&i.close()})})},menufocus:function(g,i){if(this.isNewMe= nu){this.isNewMenu=3D!1;if(g.originalEvent&&/^mouse/.test(g.originalEvent.t= ype)){this.menu.blur(),this.document.one("mousemove",function(){b(g.target)= .trigger(g.originalEvent)});return}}var h=3Di.item.data("ui-autocomplete-it= em")||i.item.data("item.autocomplete");!1!=3D=3Dthis._trigger("focus",g,{it= em:h})?g.originalEvent&&/^key/.test(g.originalEvent.type)&&this._value(h.va= lue):this.liveRegion.text(h.value)},menuselect:function(i,g){var j=3Dg.item= .data("ui-autocomplete-item")||g.item.data("item.autocomplete"),h=3Dthis.pr= evious;this.element[0]!=3D=3Dthis.document[0].activeElement&&(this.element.= focus(),this.previous=3Dh,this._delay(function(){this.previous=3Dh,this.sel= ectedItem=3Dj})),!1!=3D=3Dthis._trigger("select",i,{item:j})&&this._value(j= .value),this.term=3Dthis._value(),this.close(i),this.selectedItem=3Dj}}),th= is.liveRegion=3Db("<span>",{role:"status","aria-live":"polite"}).addClass("= ui-helper-hidden-accessible").insertAfter(this.element),b.fn.bgiframe&&this= .menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this= .element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(th= is.searching),this.element.removeClass("ui-autocomplete-input").removeAttr(= "autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOp= tion:function(f,d){this._super(f,d),f=3D=3D=3D"source"&&this._initSource(),= f=3D=3D=3D"appendTo"&&this.menu.element.appendTo(this.document.find(d||"bod= y")[0]),f=3D=3D=3D"disabled"&&d&&this.xhr&&this.xhr.abort()},_isMultiLine:f= unction(){return this.element.is("textarea")?!0:this.element.is("input")?!1= :this.element.prop("isContentEditable")},_initSource:function(){var d,f,e= =3Dthis;b.isArray(this.options.source)?(d=3Dthis.options.source,this.source= =3Dfunction(h,g){g(b.ui.autocomplete.filter(d,h.term))}):typeof this.option= s.source=3D=3D"string"?(f=3Dthis.options.source,this.source=3Dfunction(h,g)= {e.xhr&&e.xhr.abort(),e.xhr=3Db.ajax({url:f,data:h,dataType:"json",success:= function(i){g(i)},error:function(){g([])}})}):this.source=3Dthis.options.so= urce},_searchTimeout:function(d){clearTimeout(this.searching),this.searchin= g=3Dthis._delay(function(){this.term!=3D=3Dthis._value()&&(this.selectedIte= m=3Dnull,this.search(null,d))},this.options.delay)},search:function(f,d){f= =3Df!=3Dnull?f:this._value(),this.term=3Dthis._value();if(f.length<this.opt= ions.minLength){return this.close(d)}if(this._trigger("search",d)=3D=3D=3D!= 1){return}return this._search(f)},_search:function(d){this.pending++,this.e= lement.addClass("ui-autocomplete-loading"),this.cancelSearch=3D!1,this.sour= ce({term:d},this._response())},_response:function(){var f=3Dthis,d=3D++c;re= turn function(e){d=3D=3D=3Dc&&f.__response(e),f.pending--,f.pending||f.elem= ent.removeClass("ui-autocomplete-loading")}},__response:function(d){d&&(d= =3Dthis._normalize(d)),this._trigger("response",null,{content:d}),!this.opt= ions.disabled&&d&&d.length&&!this.cancelSearch?(this._suggest(d),this._trig= ger("open")):this._close()},close:function(d){this.cancelSearch=3D!0,this._= close(d)},_close:function(d){this.menu.element.is(":visible")&&(this.menu.e= lement.hide(),this.menu.blur(),this.isNewMenu=3D!0,this._trigger("close",d)= )},_change:function(d){this.previous!=3D=3Dthis._value()&&this._trigger("ch= ange",d,{item:this.selectedItem})},_normalize:function(d){return d.length&&= d[0].label&&d[0].value?d:b.map(d,function(e){return typeof e=3D=3D"string"?= {label:e,value:e}:b.extend({label:e.label||e.value,value:e.value||e.label},= e)})},_suggest:function(d){var e=3Dthis.menu.element.empty().zIndex(this.el= ement.zIndex()+1);this._renderMenu(e,d),this.menu.refresh(),e.show(),this._= resizeMenu(),e.position(b.extend({of:this.element},this.options.position)),= this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var d=3Dth= is.menu.element;d.outerWidth(Math.max(d.width("").outerWidth()+1,this.eleme= nt.outerWidth()))},_renderMenu:function(d,f){var e=3Dthis;b.each(f,function= (g,h){e._renderItemData(d,h)})},_renderItemData:function(f,d){return this._= renderItem(f,d).data("ui-autocomplete-item",d)},_renderItem:function(d,e){r= eturn b("<li>").append(b("<a>").text(e.label)).appendTo(d)},_move:function(= f,d){if(!this.menu.element.is(":visible")){this.search(null,d);return}if(th= is.menu.isFirstItem()&&/^previous/.test(f)||this.menu.isLastItem()&&/^next/= .test(f)){this._value(this.term),this.menu.blur();return}this.menu[f](d)},w= idget:function(){return this.menu.element},_value:function(){return this.va= lueMethod.apply(this.element,arguments)},_keyEvent:function(f,d){if(!this.i= sMultiLine||this.menu.element.is(":visible")){this._move(f,d),d.preventDefa= ult()}}}),b.extend(b.ui.autocomplete,{escapeRegex:function(d){return d.repl= ace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(d,f){var e=3Dnew= RegExp(b.ui.autocomplete.escapeRegex(f),"i");return b.grep(d,function(g){r= eturn e.test(g.label||g.value||g)})}}),b.widget("ui.autocomplete",b.ui.auto= complete,{options:{messages:{noResults:"No search results.",results:functio= n(d){return d+(d>1?" results are":" result is")+" available, use up and dow= n arrow keys to navigate."}}},__response:function(f){var d;this._superApply= (arguments);if(this.options.disabled||this.cancelSearch){return}f&&f.length= ?d=3Dthis.options.messages.results(f.length):d=3Dthis.options.messages.noRe= sults,this.liveRegion.text(d)}})})(jQuery);(function(k,q){var d,b,h,v,c=3D"= ui-button ui-widget ui-state-default ui-corner-all",p=3D"ui-state-hover ui-= state-active ",m=3D"ui-button-icons-only ui-button-icon-only ui-button-text= -icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-= text-only",j=3Dfunction(){var a=3Dk(this).find(":ui-button");setTimeout(fun= ction(){a.button("refresh")},1)},g=3Dfunction(e){var l=3De.name,f=3De.form,= a=3Dk([]);return l&&(f?a=3Dk(f).find("[name=3D'"+l+"']"):a=3Dk("[name=3D'"+= l+"']",e.ownerDocument).filter(function(){return !this.form})),a};k.widget(= "ui.button",{version:"1.9.1",defaultElement:"<button>",options:{disabled:nu= ll,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function= (){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("r= eset"+this.eventNamespace,j),typeof this.options.disabled!=3D"boolean"?this= .options.disabled=3D!!this.element.prop("disabled"):this.element.prop("disa= bled",this.options.disabled),this._determineButtonType(),this.hasTitle=3D!!= this.buttonElement.attr("title");var i=3Dthis,f=3Dthis.options,e=3Dthis.typ= e=3D=3D=3D"checkbox"||this.type=3D=3D=3D"radio",n=3D"ui-state-hover"+(e?"":= " ui-state-active"),l=3D"ui-state-focus";f.label=3D=3D=3Dnull&&(f.label=3Dt= his.type=3D=3D=3D"input"?this.buttonElement.val():this.buttonElement.html()= ),this.buttonElement.addClass(c).attr("role","button").bind("mouseenter"+th= is.eventNamespace,function(){if(f.disabled){return}k(this).addClass("ui-sta= te-hover"),this=3D=3D=3Dd&&k(this).addClass("ui-state-active")}).bind("mous= eleave"+this.eventNamespace,function(){if(f.disabled){return}k(this).remove= Class(n)}).bind("click"+this.eventNamespace,function(a){f.disabled&&(a.prev= entDefault(),a.stopImmediatePropagation())}),this.element.bind("focus"+this= .eventNamespace,function(){i.buttonElement.addClass(l)}).bind("blur"+this.e= ventNamespace,function(){i.buttonElement.removeClass(l)}),e&&(this.element.= bind("change"+this.eventNamespace,function(){if(v){return}i.refresh()}),thi= s.buttonElement.bind("mousedown"+this.eventNamespace,function(a){if(f.disab= led){return}v=3D!1,b=3Da.pageX,h=3Da.pageY}).bind("mouseup"+this.eventNames= pace,function(a){if(f.disabled){return}if(b!=3D=3Da.pageX||h!=3D=3Da.pageY)= {v=3D!0}})),this.type=3D=3D=3D"checkbox"?this.buttonElement.bind("click"+th= is.eventNamespace,function(){if(f.disabled||v){return !1}k(this).toggleClas= s("ui-state-active"),i.buttonElement.attr("aria-pressed",i.element[0].check= ed)}):this.type=3D=3D=3D"radio"?this.buttonElement.bind("click"+this.eventN= amespace,function(){if(f.disabled||v){return !1}k(this).addClass("ui-state-= active"),i.buttonElement.attr("aria-pressed","true");var a=3Di.element[0];g= (a).not(a).map(function(){return k(this).button("widget")[0]}).removeClass(= "ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind(= "mousedown"+this.eventNamespace,function(){if(f.disabled){return !1}k(this)= .addClass("ui-state-active"),d=3Dthis,i.document.one("mouseup",function(){d= =3Dnull})}).bind("mouseup"+this.eventNamespace,function(){if(f.disabled){re= turn !1}k(this).removeClass("ui-state-active")}).bind("keydown"+this.eventN= amespace,function(a){if(f.disabled){return !1}(a.keyCode=3D=3D=3Dk.ui.keyCo= de.SPACE||a.keyCode=3D=3D=3Dk.ui.keyCode.ENTER)&&k(this).addClass("ui-state= -active")}).bind("keyup"+this.eventNamespace,function(){k(this).removeClass= ("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(= function(a){a.keyCode=3D=3D=3Dk.ui.keyCode.SPACE&&k(this).click()})),this._= setOption("disabled",f.disabled),this._resetButton()},_determineButtonType:= function(){var f,a,i;this.element.is("[type=3Dcheckbox]")?this.type=3D"chec= kbox":this.element.is("[type=3Dradio]")?this.type=3D"radio":this.element.is= ("input")?this.type=3D"input":this.type=3D"button",this.type=3D=3D=3D"check= box"||this.type=3D=3D=3D"radio"?(f=3Dthis.element.parents().last(),a=3D"lab= el[for=3D'"+this.element.attr("id")+"']",this.buttonElement=3Df.find(a),thi= s.buttonElement.length||(f=3Df.length?f.siblings():this.element.siblings(),= this.buttonElement=3Df.filter(a),this.buttonElement.length||(this.buttonEle= ment=3Df.find(a))),this.element.addClass("ui-helper-hidden-accessible"),i= =3Dthis.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-act= ive"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=3Dthis.= element},widget:function(){return this.buttonElement},_destroy:function(){t= his.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.r= emoveClass(c+" "+p+" "+m).removeAttr("role").removeAttr("aria-pressed").htm= l(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.bu= ttonElement.removeAttr("title")},_setOption:function(f,a){this._super(f,a);= if(f=3D=3D=3D"disabled"){a?this.element.prop("disabled",!0):this.element.pr= op("disabled",!1);return}this._resetButton()},refresh:function(){var a=3Dth= is.element.is(":disabled")||this.element.hasClass("ui-button-disabled");a!= =3D=3Dthis.options.disabled&&this._setOption("disabled",a),this.type=3D=3D= =3D"radio"?g(this.element[0]).each(function(){k(this).is(":checked")?k(this= ).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):= k(this).button("widget").removeClass("ui-state-active").attr("aria-pressed"= ,"false")}):this.type=3D=3D=3D"checkbox"&&(this.element.is(":checked")?this= .buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this= .buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))= },_resetButton:function(){if(this.type=3D=3D=3D"input"){this.options.label&= &this.element.val(this.options.label);return}var e=3Dthis.buttonElement.rem= oveClass(m),o=3Dk("<span></span>",this.document[0]).addClass("ui-button-tex= t").html(this.options.label).appendTo(e.empty()).text(),l=3Dthis.options.ic= ons,a=3Dl.primary&&l.secondary,f=3D[];l.primary||l.secondary?(this.options.= text&&f.push("ui-button-text-icon"+(a?"s":l.primary?"-primary":"-secondary"= )),l.primary&&e.prepend("<span class=3D'ui-button-icon-primary ui-icon "+l.= primary+"'></span>"),l.secondary&&e.append("<span class=3D'ui-button-icon-s= econdary ui-icon "+l.secondary+"'></span>"),this.options.text||(f.push(a?"u= i-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",k= .trim(o)))):f.push("ui-button-text-only"),e.addClass(f.join(" "))}}),k.widg= et("ui.buttonset",{version:"1.9.1",options:{items:"button, input[type=3Dbut= ton], input[type=3Dsubmit], input[type=3Dreset], input[type=3Dcheckbox], in= put[type=3Dradio], a, :data(button)"},_create:function(){this.element.addCl= ass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(f= ,a){f=3D=3D=3D"disabled"&&this.buttons.button("option",f,a),this._super(f,a= )},refresh:function(){var a=3Dthis.element.css("direction")=3D=3D=3D"rtl";t= his.buttons=3Dthis.element.find(this.options.items).filter(":ui-button").bu= tton("refresh").end().not(":ui-button").button().end().map(function(){retur= n k(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left u= i-corner-right").filter(":first").addClass(a?"ui-corner-right":"ui-corner-l= eft").end().filter(":last").addClass(a?"ui-corner-left":"ui-corner-right").= end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),t= his.buttons.map(function(){return k(this).button("widget")[0]}).removeClass= ("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(fu= nction(b,a){var c=3D!1;b.widget("ui.menu",{version:"1.9.1",defaultElement:"= <ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",pos= ition:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,selec= t:null},_create:function(){this.activeMenu=3Dthis.element,this.element.uniq= ueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggle= Class("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:th= is.options.role,tabIndex:0}).bind("click"+this.eventNamespace,b.proxy(funct= ion(d){this.options.disabled&&d.preventDefault()},this)),this.options.disab= led&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"= ),this._on({"mousedown .ui-menu-item > a":function(d){d.preventDefault()},"= click .ui-state-disabled > a":function(d){d.preventDefault()},"click .ui-me= nu-item:has(a)":function(d){var e=3Db(d.target).closest(".ui-menu-item");!c= &&e.not(".ui-state-disabled").length&&(c=3D!0,this.select(d),e.has(".ui-men= u").length?this.expand(d):this.element.is(":focus")||(this.element.trigger(= "focus",[!0]),this.active&&this.active.parents(".ui-menu").length=3D=3D=3D1= &&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(d){var e= =3Db(d.currentTarget);e.siblings().children(".ui-state-active").removeClass= ("ui-state-active"),this.focus(d,e)},mouseleave:"collapseAll","mouseleave .= ui-menu":"collapseAll",focus:function(f,d){var g=3Dthis.active||this.elemen= t.children(".ui-menu-item").eq(0);d||this.focus(f,g)},blur:function(d){this= ._delay(function(){b.contains(this.element[0],this.document[0].activeElemen= t)||this.collapseAll(d)})},keydown:"_keydown"}),this.refresh(),this._on(thi= s.document,{click:function(d){b(d.target).closest(".ui-menu").length||this.= collapseAll(d),c=3D!1}})},_destroy:function(){this.element.removeAttr("aria= -activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widg= et ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").remov= eAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded")= .removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().sho= w(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAt= tr("role").removeAttr("aria-disabled").children("a").removeUniqueId().remov= eClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("r= ole").removeAttr("aria-haspopup").children().each(function(){var d=3Db(this= );d.data("ui-menu-submenu-carat")&&d.remove()}),this.element.find(".ui-menu= -divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:funct= ion(g){function d(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")= }var l,j,f,h,k,e=3D!0;switch(g.keyCode){case b.ui.keyCode.PAGE_UP:this.prev= iousPage(g);break;case b.ui.keyCode.PAGE_DOWN:this.nextPage(g);break;case b= .ui.keyCode.HOME:this._move("first","first",g);break;case b.ui.keyCode.END:= this._move("last","last",g);break;case b.ui.keyCode.UP:this.previous(g);bre= ak;case b.ui.keyCode.DOWN:this.next(g);break;case b.ui.keyCode.LEFT:this.co= llapse(g);break;case b.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-s= tate-disabled")&&this.expand(g);break;case b.ui.keyCode.ENTER:case b.ui.key= Code.SPACE:this._activate(g);break;case b.ui.keyCode.ESCAPE:this.collapse(g= );break;default:e=3D!1,j=3Dthis.previousFilter||"",f=3DString.fromCharCode(= g.keyCode),h=3D!1,clearTimeout(this.filterTimer),f=3D=3D=3Dj?h=3D!0:f=3Dj+f= ,k=3Dnew RegExp("^"+d(f),"i"),l=3Dthis.activeMenu.children(".ui-menu-item")= .filter(function(){return k.test(b(this).children("a").text())}),l=3Dh&&l.i= ndex(this.active.next())!=3D=3D-1?this.active.nextAll(".ui-menu-item"):l,l.= length||(f=3DString.fromCharCode(g.keyCode),k=3Dnew RegExp("^"+d(f),"i"),l= =3Dthis.activeMenu.children(".ui-menu-item").filter(function(){return k.tes= t(b(this).children("a").text())})),l.length?(this.focus(g,l),l.length>1?(th= is.previousFilter=3Df,this.filterTimer=3Dthis._delay(function(){delete this= .previousFilter},1000)):delete this.previousFilter):delete this.previousFil= ter}e&&g.preventDefault()},_activate:function(d){this.active.is(".ui-state-= disabled")||(this.active.children("a[aria-haspopup=3D'true']").length?this.= expand(d):this.select(d))},refresh:function(){var d,f=3Dthis.options.icons.= submenu,e=3Dthis.element.find(this.options.menus+":not(.ui-menu)").addClass= ("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:thi= s.options.role,"aria-hidden":"true","aria-expanded":"false"});d=3De.add(thi= s.element),d.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item"= ).attr("role","presentation").children("a").uniqueId().addClass("ui-corner-= all").attr({tabIndex:-1,role:this._itemRole()}),d.children(":not(.ui-menu-i= tem)").each(function(){var g=3Db(this);/[^\-=E2=80=94=E2=80=93\s]/.test(g.t= ext())||g.addClass("ui-widget-content ui-menu-divider")}),d.children(".ui-s= tate-disabled").attr("aria-disabled","true"),e.each(function(){var h=3Db(th= is),j=3Dh.prev("a"),g=3Db("<span>").addClass("ui-menu-icon ui-icon "+f).dat= a("ui-menu-submenu-carat",!0);j.attr("aria-haspopup","true").prepend(g),h.a= ttr("aria-labelledby",j.attr("id"))}),this.active&&!b.contains(this.element= [0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuite= m",listbox:"option"}[this.options.role]},focus:function(g,d){var h,f;this.b= lur(g,g&&g.type=3D=3D=3D"focus"),this._scrollIntoView(d),this.active=3Dd.fi= rst(),f=3Dthis.active.children("a").addClass("ui-state-focus"),this.options= .role&&this.element.attr("aria-activedescendant",f.attr("id")),this.active.= parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-ac= tive"),g&&g.type=3D=3D=3D"keydown"?this._close():this.timer=3Dthis._delay(f= unction(){this._close()},this.delay),h=3Dd.children(".ui-menu"),h.length&&/= ^mouse/.test(g.type)&&this._startOpening(h),this.activeMenu=3Dd.parent(),th= is._trigger("focus",g,{item:d})},_scrollIntoView:function(f){var k,h,e,g,j,= d;this._hasScroll()&&(k=3DparseFloat(b.css(this.activeMenu[0],"borderTopWid= th"))||0,h=3DparseFloat(b.css(this.activeMenu[0],"paddingTop"))||0,e=3Df.of= fset().top-this.activeMenu.offset().top-k-h,g=3Dthis.activeMenu.scrollTop()= ,j=3Dthis.activeMenu.height(),d=3Df.height(),e<0?this.activeMenu.scrollTop(= g+e):e+d>j&&this.activeMenu.scrollTop(g+e-j+d))},blur:function(f,d){d||clea= rTimeout(this.timer);if(!this.active){return}this.active.children("a").remo= veClass("ui-state-focus"),this.active=3Dnull,this._trigger("blur",f,{item:t= his.active})},_startOpening:function(d){clearTimeout(this.timer);if(d.attr(= "aria-hidden")!=3D=3D"true"){return}this.timer=3Dthis._delay(function(){thi= s._close(),this._open(d)},this.delay)},_open:function(d){var e=3Db.extend({= of:this.active},this.options.position);clearTimeout(this.timer),this.elemen= t.find(".ui-menu").not(d.parents(".ui-menu")).hide().attr("aria-hidden","tr= ue"),d.show().removeAttr("aria-hidden").attr("aria-expanded","true").positi= on(e)},collapseAll:function(d,e){clearTimeout(this.timer),this.timer=3Dthis= ._delay(function(){var f=3De?this.element:b(d&&d.target).closest(this.eleme= nt.find(".ui-menu"));f.length||(f=3Dthis.element),this._close(f),this.blur(= d),this.activeMenu=3Df},this.delay)},_close:function(d){d||(d=3Dthis.active= ?this.active.parent():this.element),d.find(".ui-menu").hide().attr("aria-hi= dden","true").attr("aria-expanded","false").end().find("a.ui-state-active")= .removeClass("ui-state-active")},collapse:function(f){var d=3Dthis.active&&= this.active.parent().closest(".ui-menu-item",this.element);d&&d.length&&(th= is._close(),this.focus(f,d))},expand:function(f){var d=3Dthis.active&&this.= active.children(".ui-menu ").children(".ui-menu-item").first();d&&d.length&= &(this._open(d.parent()),this._delay(function(){this.focus(f,d)}))},next:fu= nction(d){this._move("next","first",d)},previous:function(d){this._move("pr= ev","last",d)},isFirstItem:function(){return this.active&&!this.active.prev= All(".ui-menu-item").length},isLastItem:function(){return this.active&&!thi= s.active.nextAll(".ui-menu-item").length},_move:function(g,d,h){var f;this.= active&&(g=3D=3D=3D"first"||g=3D=3D=3D"last"?f=3Dthis.active[g=3D=3D=3D"fir= st"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):f=3Dthis.active[g+"All"]("= .ui-menu-item").eq(0));if(!f||!f.length||!this.active){f=3Dthis.activeMenu.= children(".ui-menu-item")[d]()}this.focus(h,f)},nextPage:function(e){var g,= f,d;if(!this.active){this.next(e);return}if(this.isLastItem()){return}this.= _hasScroll()?(f=3Dthis.active.offset().top,d=3Dthis.element.height(),this.a= ctive.nextAll(".ui-menu-item").each(function(){return g=3Db(this),g.offset(= ).top-f-d<0}),this.focus(e,g)):this.focus(e,this.activeMenu.children(".ui-m= enu-item")[this.active?"last":"first"]())},previousPage:function(e){var g,f= ,d;if(!this.active){this.next(e);return}if(this.isFirstItem()){return}this.= _hasScroll()?(f=3Dthis.active.offset().top,d=3Dthis.element.height(),this.a= ctive.prevAll(".ui-menu-item").each(function(){return g=3Db(this),g.offset(= ).top-f+d>0}),this.focus(e,g)):this.focus(e,this.activeMenu.children(".ui-m= enu-item").first())},_hasScroll:function(){return this.element.outerHeight(= )<this.element.prop("scrollHeight")},select:function(d){this.active=3Dthis.= active||b(d.target).closest(".ui-menu-item");var e=3D{item:this.active};thi= s.active.has(".ui-menu").length||this.collapseAll(d,!0),this._trigger("sele= ct",d,e)}})})(jQuery);(function(b,a){var c=3D5;b.widget("ui.slider",b.ui.mo= use,{version:"1.9.1",widgetEventPrefix:"slide",options:{animate:!1,distance= :0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:nu= ll},_create:function(){var f,h,e=3Dthis.options,g=3Dthis.element.find(".ui-= slider-handle").addClass("ui-state-default ui-corner-all"),j=3D"<a class=3D= 'ui-slider-handle ui-state-default ui-corner-all' href=3D'#'></a>",d=3D[];t= his._keySliding=3D!1,this._mouseSliding=3D!1,this._animateOff=3D!0,this._ha= ndleIndex=3Dnull,this._detectOrientation(),this._mouseInit(),this.element.a= ddClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-conte= nt ui-corner-all"+(e.disabled?" ui-slider-disabled ui-disabled":"")),this.r= ange=3Db([]),e.range&&(e.range=3D=3D=3D!0&&(e.values||(e.values=3D[this._va= lueMin(),this._valueMin()]),e.values.length&&e.values.length!=3D=3D2&&(e.va= lues=3D[e.values[0],e.values[0]])),this.range=3Db("<div></div>").appendTo(t= his.element).addClass("ui-slider-range ui-widget-header"+(e.range=3D=3D=3D"= min"||e.range=3D=3D=3D"max"?" ui-slider-range-"+e.range:""))),h=3De.values&= &e.values.length||1;for(f=3Dg.length;f<h;f++){d.push(j)}this.handles=3Dg.ad= d(b(d.join("")).appendTo(this.element)),this.handle=3Dthis.handles.eq(0),th= is.handles.add(this.range).filter("a").click(function(i){i.preventDefault()= }).mouseenter(function(){e.disabled||b(this).addClass("ui-state-hover")}).m= ouseleave(function(){b(this).removeClass("ui-state-hover")}).focus(function= (){e.disabled?b(this).blur():(b(".ui-slider .ui-state-focus").removeClass("= ui-state-focus"),b(this).addClass("ui-state-focus"))}).blur(function(){b(th= is).removeClass("ui-state-focus")}),this.handles.each(function(i){b(this).d= ata("ui-slider-handle-index",i)}),this._on(this.handles,{keydown:function(m= ){var p,l,n,q,k=3Db(m.target).data("ui-slider-handle-index");switch(m.keyCo= de){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:= case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:ca= se b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:m.preventDefault();if(!this._ke= ySliding){this._keySliding=3D!0,b(m.target).addClass("ui-state-active"),p= =3Dthis._start(m,k);if(p=3D=3D=3D!1){return}}}q=3Dthis.options.step,this.op= tions.values&&this.options.values.length?l=3Dn=3Dthis.values(k):l=3Dn=3Dthi= s.value();switch(m.keyCode){case b.ui.keyCode.HOME:n=3Dthis._valueMin();bre= ak;case b.ui.keyCode.END:n=3Dthis._valueMax();break;case b.ui.keyCode.PAGE_= UP:n=3Dthis._trimAlignValue(l+(this._valueMax()-this._valueMin())/c);break;= case b.ui.keyCode.PAGE_DOWN:n=3Dthis._trimAlignValue(l-(this._valueMax()-th= is._valueMin())/c);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(l= =3D=3D=3Dthis._valueMax()){return}n=3Dthis._trimAlignValue(l+q);break;case = b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(l=3D=3D=3Dthis._valueMin()){ret= urn}n=3Dthis._trimAlignValue(l-q)}this._slide(m,k,n)},keyup:function(i){var= k=3Db(i.target).data("ui-slider-handle-index");this._keySliding&&(this._ke= ySliding=3D!1,this._stop(i,k),this._change(i,k),b(i.target).removeClass("ui= -state-active"))}}),this._refreshValue(),this._animateOff=3D!1},_destroy:fu= nction(){this.handles.remove(),this.range.remove(),this.element.removeClass= ("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-w= idget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture= :function(v){var g,d,j,w,e,q,p,k,h=3Dthis,m=3Dthis.options;return m.disable= d?!1:(this.elementSize=3D{width:this.element.outerWidth(),height:this.eleme= nt.outerHeight()},this.elementOffset=3Dthis.element.offset(),g=3D{x:v.pageX= ,y:v.pageY},d=3Dthis._normValueFromMouse(g),j=3Dthis._valueMax()-this._valu= eMin()+1,this.handles.each(function(f){var i=3DMath.abs(d-h.values(f));j>i&= &(j=3Di,w=3Db(this),e=3Df)}),m.range=3D=3D=3D!0&&this.values(1)=3D=3D=3Dm.m= in&&(e+=3D1,w=3Db(this.handles[e])),q=3Dthis._start(v,e),q=3D=3D=3D!1?!1:(t= his._mouseSliding=3D!0,this._handleIndex=3De,w.addClass("ui-state-active").= focus(),p=3Dw.offset(),k=3D!b(v.target).parents().andSelf().is(".ui-slider-= handle"),this._clickOffset=3Dk?{left:0,top:0}:{left:v.pageX-p.left-w.width(= )/2,top:v.pageY-p.top-w.height()/2-(parseInt(w.css("borderTopWidth"),10)||0= )-(parseInt(w.css("borderBottomWidth"),10)||0)+(parseInt(w.css("marginTop")= ,10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(v,e,d),this.= _animateOff=3D!0,!0))},_mouseStart:function(){return !0},_mouseDrag:functio= n(f){var d=3D{x:f.pageX,y:f.pageY},g=3Dthis._normValueFromMouse(d);return t= his._slide(f,this._handleIndex,g),!1},_mouseStop:function(d){return this.ha= ndles.removeClass("ui-state-active"),this._mouseSliding=3D!1,this._stop(d,t= his._handleIndex),this._change(d,this._handleIndex),this._handleIndex=3Dnul= l,this._clickOffset=3Dnull,this._animateOff=3D!1,!1},_detectOrientation:fun= ction(){this.orientation=3Dthis.options.orientation=3D=3D=3D"vertical"?"ver= tical":"horizontal"},_normValueFromMouse:function(j){var f,k,h,d,g;return t= his.orientation=3D=3D=3D"horizontal"?(f=3Dthis.elementSize.width,k=3Dj.x-th= is.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(f=3Dth= is.elementSize.height,k=3Dj.y-this.elementOffset.top-(this._clickOffset?thi= s._clickOffset.top:0)),h=3Dk/f,h>1&&(h=3D1),h<0&&(h=3D0),this.orientation= =3D=3D=3D"vertical"&&(h=3D1-h),d=3Dthis._valueMax()-this._valueMin(),g=3Dth= is._valueMin()+h*d,this._trimAlignValue(g)},_start:function(f,d){var g=3D{h= andle:this.handles[d],value:this.value()};return this.options.values&&this.= options.values.length&&(g.value=3Dthis.values(d),g.values=3Dthis.values()),= this._trigger("start",f,g)},_slide:function(j,f,k){var h,d,g;this.options.v= alues&&this.options.values.length?(h=3Dthis.values(f?0:1),this.options.valu= es.length=3D=3D=3D2&&this.options.range=3D=3D=3D!0&&(f=3D=3D=3D0&&k>h||f=3D= =3D=3D1&&k<h)&&(k=3Dh),k!=3D=3Dthis.values(f)&&(d=3Dthis.values(),d[f]=3Dk,= g=3Dthis._trigger("slide",j,{handle:this.handles[f],value:k,values:d}),h=3D= this.values(f?0:1),g!=3D=3D!1&&this.values(f,k,!0))):k!=3D=3Dthis.value()&&= (g=3Dthis._trigger("slide",j,{handle:this.handles[f],value:k}),g!=3D=3D!1&&= this.value(k))},_stop:function(f,d){var g=3D{handle:this.handles[d],value:t= his.value()};this.options.values&&this.options.values.length&&(g.value=3Dth= is.values(d),g.values=3Dthis.values()),this._trigger("stop",f,g)},_change:f= unction(f,d){if(!this._keySliding&&!this._mouseSliding){var g=3D{handle:thi= s.handles[d],value:this.value()};this.options.values&&this.options.values.l= ength&&(g.value=3Dthis.values(d),g.values=3Dthis.values()),this._trigger("c= hange",f,g)}},value:function(d){if(arguments.length){this.options.value=3Dt= his._trimAlignValue(d),this._refreshValue(),this._change(null,0);return}ret= urn this._value()},values:function(e,h){var g,d,f;if(arguments.length>1){th= is.options.values[e]=3Dthis._trimAlignValue(h),this._refreshValue(),this._c= hange(null,e);return}if(!arguments.length){return this._values()}if(!b.isAr= ray(arguments[0])){return this.options.values&&this.options.values.length?t= his._values(e):this.value()}g=3Dthis.options.values,d=3Darguments[0];for(f= =3D0;f<g.length;f+=3D1){g[f]=3Dthis._trimAlignValue(d[f]),this._change(null= ,f)}this._refreshValue()},_setOption:function(e,g){var f,d=3D0;b.isArray(th= is.options.values)&&(d=3Dthis.options.values.length),b.Widget.prototype._se= tOption.apply(this,arguments);switch(e){case"disabled":g?(this.handles.filt= er(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),thi= s.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.h= andles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;c= ase"orientation":this._detectOrientation(),this.element.removeClass("ui-sli= der-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation)= ,this._refreshValue();break;case"value":this._animateOff=3D!0,this._refresh= Value(),this._change(null,0),this._animateOff=3D!1;break;case"values":this.= _animateOff=3D!0,this._refreshValue();for(f=3D0;f<d;f+=3D1){this._change(nu= ll,f)}this._animateOff=3D!1;break;case"min":case"max":this._animateOff=3D!0= ,this._refreshValue(),this._animateOff=3D!1}},_value:function(){var d=3Dthi= s.options.value;return d=3Dthis._trimAlignValue(d),d},_values:function(g){v= ar d,h,f;if(arguments.length){return d=3Dthis.options.values[g],d=3Dthis._t= rimAlignValue(d),d}h=3Dthis.options.values.slice();for(f=3D0;f<h.length;f+= =3D1){h[f]=3Dthis._trimAlignValue(h[f])}return h},_trimAlignValue:function(= g){if(g<=3Dthis._valueMin()){return this._valueMin()}if(g>=3Dthis._valueMax= ()){return this._valueMax()}var d=3Dthis.options.step>0?this.options.step:1= ,h=3D(g-this._valueMin())%d,f=3Dg-h;return Math.abs(h)*2>=3Dd&&(f+=3Dh>0?d:= -d),parseFloat(f.toFixed(5))},_valueMin:function(){return this.options.min}= ,_valueMax:function(){return this.options.max},_refreshValue:function(){var= q,g,d,j,v,e=3Dthis.options.range,p=3Dthis.options,m=3Dthis,k=3Dthis._anima= teOff?!1:p.animate,h=3D{};this.options.values&&this.options.values.length?t= his.handles.each(function(f){g=3D(m.values(f)-m._valueMin())/(m._valueMax()= -m._valueMin())*100,h[m.orientation=3D=3D=3D"horizontal"?"left":"bottom"]= =3Dg+"%",b(this).stop(1,1)[k?"animate":"css"](h,p.animate),m.options.range= =3D=3D=3D!0&&(m.orientation=3D=3D=3D"horizontal"?(f=3D=3D=3D0&&m.range.stop= (1,1)[k?"animate":"css"]({left:g+"%"},p.animate),f=3D=3D=3D1&&m.range[k?"an= imate":"css"]({width:g-q+"%"},{queue:!1,duration:p.animate})):(f=3D=3D=3D0&= &m.range.stop(1,1)[k?"animate":"css"]({bottom:g+"%"},p.animate),f=3D=3D=3D1= &&m.range[k?"animate":"css"]({height:g-q+"%"},{queue:!1,duration:p.animate}= ))),q=3Dg}):(d=3Dthis.value(),j=3Dthis._valueMin(),v=3Dthis._valueMax(),g= =3Dv!=3D=3Dj?(d-j)/(v-j)*100:0,h[this.orientation=3D=3D=3D"horizontal"?"lef= t":"bottom"]=3Dg+"%",this.handle.stop(1,1)[k?"animate":"css"](h,p.animate),= e=3D=3D=3D"min"&&this.orientation=3D=3D=3D"horizontal"&&this.range.stop(1,1= )[k?"animate":"css"]({width:g+"%"},p.animate),e=3D=3D=3D"max"&&this.orienta= tion=3D=3D=3D"horizontal"&&this.range[k?"animate":"css"]({width:100-g+"%"},= {queue:!1,duration:p.animate}),e=3D=3D=3D"min"&&this.orientation=3D=3D=3D"v= ertical"&&this.range.stop(1,1)[k?"animate":"css"]({height:g+"%"},p.animate)= ,e=3D=3D=3D"max"&&this.orientation=3D=3D=3D"vertical"&&this.range[k?"animat= e":"css"]({height:100-g+"%"},{queue:!1,duration:p.animate}))}})})(jQuery); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/mvc/ui.js --- a/static/scripts/packed/mvc/ui.js +++ b/static/scripts/packed/mvc/ui.js @@ -1,1 +1,1 @@ -var IconButton=3DBackbone.Model.extend({defaults:{title:"",icon_class:"",o= n_click:null,tooltip_config:{},isMenuButton:true,id:null,href:null,target:n= ull,enabled:true,visible:true}});var IconButtonView=3DBackbone.View.extend(= {initialize:function(){this.model.attributes.tooltip_config=3D{placement:"b= ottom"};this.model.bind("change",this.render,this)},render:function(){this.= $el.tooltip("hide");var a=3D$(Handlebars.partials.iconButton(this.model.toJ= SON()));a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a)= ;this.setElement(a);return this},events:{click:"click"},click:function(a){i= f(this.model.attributes.on_click){this.model.attributes.on_click(a);return = false}return true}});IconButtonView.templates=3D{iconButton:Handlebars.part= ials.iconButton};var IconButtonCollection=3DBackbone.Collection.extend({mod= el:IconButton});var IconButtonMenuView=3DBackbone.View.extend({tagName:"div= ",initialize:function(){this.render()},render:function(){var a=3Dthis;this.= collection.each(function(c){var b=3D$("<a/>").attr("href","javascript:void(= 0)").attr("title",c.attributes.title).addClass("icon-button menu-button").a= ddClass(c.attributes.icon_class).appendTo(a.$el).click(c.attributes.on_clic= k);if(c.attributes.tooltip_config){b.tooltip(c.attributes.tooltip_config)}}= );return this}});var create_icon_buttons_menu=3Dfunction(b,a){if(!a){a=3D{}= }var c=3Dnew IconButtonCollection(_.map(b,function(d){return new IconButton= (_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid= =3DBackbone.Collection.extend({});var GridView=3DBackbone.View.extend({});v= ar GalaxyPaths=3DBackbone.Model.extend({defaults:{root_path:"",image_path:"= "}}); \ No newline at end of file +var IconButton=3DBackbone.Model.extend({defaults:{title:"",icon_class:"",o= n_click:null,menu_options:null,tooltip_config:{},isMenuButton:true,id:null,= href:null,target:null,enabled:true,visible:true}});var IconButtonView=3DBac= kbone.View.extend({initialize:function(){this.model.attributes.tooltip_conf= ig=3D{placement:"bottom"};this.model.bind("change",this.render,this)},rende= r:function(){this.$el.tooltip("hide");var a=3D$(Handlebars.partials.iconBut= ton(this.model.toJSON()));a.tooltip(this.model.get("tooltip_config"));this.= $el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},c= lick:function(a){if(this.model.attributes.on_click){this.model.attributes.o= n_click(a);return false}return true}});IconButtonView.templates=3D{iconButt= on:Handlebars.partials.iconButton};var IconButtonCollection=3DBackbone.Coll= ection.extend({model:IconButton});var IconButtonMenuView=3DBackbone.View.ex= tend({tagName:"div",initialize:function(){this.render()},render:function(){= var a=3Dthis;this.collection.each(function(d){var b=3D$("<a/>").attr("href"= ,"javascript:void(0)").attr("title",d.attributes.title).addClass("icon-butt= on menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.= attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes= .tooltip_config)}var c=3Dd.get("options");if(c){make_popupmenu(b,c)}});retu= rn this}});var create_icon_buttons_menu=3Dfunction(b,a){if(!a){a=3D{}}var c= =3Dnew IconButtonCollection(_.map(b,function(d){return new IconButton(_.ext= end(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=3DBack= bone.Collection.extend({});var GridView=3DBackbone.View.extend({});var Gala= xyPaths=3DBackbone.Model.extend({defaults:{root_path:"",image_path:""}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/circster.js --- a/static/scripts/packed/viz/circster.js +++ b/static/scripts/packed/viz/circster.js @@ -1,1 +1,1 @@ -define(["libs/underscore","libs/d3","viz/visualization"],function(g,j,h){v= ar k=3DBackbone.Model.extend({is_visible:function(o,l){var m=3Do.getBoundin= gClientRect(),n=3D$("svg")[0].getBoundingClientRect();if(m.right<0||m.left>= n.right||m.bottom<0||m.top>n.bottom){return false}return true}});var c=3DBa= ckbone.Model.extend({defaults:{prefs:{color:"#ccc"}}});var a=3DBackbone.Vie= w.extend({className:"circster",initialize:function(l){this.total_gap=3Dl.to= tal_gap;this.genome=3Dl.genome;this.dataset_arc_height=3Dl.dataset_arc_heig= ht;this.track_gap=3D5;this.label_arc_height=3D20;this.scale=3D1;this.track_= views=3Dnull;this.model.get("tracks").on("add",this.add_track,this);this.mo= del.get("tracks").on("remove",this.remove_track,this)},get_tracks_bounds:fu= nction(){var n=3Dthis.dataset_arc_height,l=3DMath.min(this.$el.width(),this= .$el.height()),p=3Dl/2-this.model.get("tracks").length*(this.dataset_arc_he= ight+this.track_gap)-(this.label_arc_height+this.track_gap),o=3Dj.range(p,l= /2,this.dataset_arc_height+this.track_gap);var m=3Dthis;return g.map(o,func= tion(q){return[q,q+m.dataset_arc_height]})},render:function(){var o=3Dthis,= q=3Dthis.dataset_arc_height,r=3Do.$el.width(),l=3Do.$el.height(),p=3Dthis.m= odel.get("tracks"),s=3Dthis.get_tracks_bounds(),n=3Dj.select(o.$el[0]).appe= nd("svg").attr("width",r).attr("height",l).attr("pointer-events","all").app= end("svg:g").call(j.behavior.zoom().on("zoom",function(){var t=3Dj.event.sc= ale;n.attr("transform","translate("+j.event.translate+") scale("+t+")");if(= o.scale!=3D=3Dt){if(o.zoom_drag_timeout){clearTimeout(o.zoom_drag_timeout)}= o.zoom_drag_timeout=3DsetTimeout(function(){g.each(o.track_views,function(u= ){u.update_scale(t)})},400)}})).attr("transform","translate("+r/2+","+l/2+"= )").append("svg:g").attr("class","tracks");this.track_views=3Dp.map(functio= n(t,u){track_view_class=3D(t.get("track_type")=3D=3D=3D"LineTrack"?d:e);ret= urn new track_view_class({el:n.append("g")[0],track:t,radius_bounds:s[u],ge= nome:o.genome,total_gap:o.total_gap})});g.each(this.track_views,function(t)= {t.render()});var m=3Ds[p.length];m[1]=3Dm[0];this.label_track_view=3Dnew b= ({el:n.append("g")[0],track:new c(),radius_bounds:m,genome:o.genome,total_g= ap:o.total_gap});this.label_track_view.render()},add_track:function(p){var = o=3Dthis.get_tracks_bounds();g.each(this.track_views,function(r,s){r.update= _radius_bounds(o[s])});var n=3Dthis.track_views.length,q=3D(p.get("track_ty= pe")=3D=3D=3D"LineTrack"?d:e),l=3Dnew q({el:j.select("g.tracks").append("g"= )[0],track:p,radius_bounds:o[n],genome:this.genome,total_gap:this.total_gap= });l.render();this.track_views.push(l);var m=3Do[o.length-1];m[1]=3Dm[0];th= is.label_track_view.update_radius_bounds(m)},remove_track:function(m,o,n){v= ar l=3Dthis.track_views[n.index];this.track_views.splice(n.index,1);l.$el.r= emove();var p=3Dthis.get_tracks_bounds();g.each(this.track_views,function(q= ,r){q.update_radius_bounds(p[r])})}});var i=3DBackbone.View.extend({tagName= :"g",initialize:function(l){this.bg_stroke=3D"ccc";this.loading_bg_fill=3D"= 000";this.bg_fill=3D"ccc";this.total_gap=3Dl.total_gap;this.track=3Dl.track= ;this.radius_bounds=3Dl.radius_bounds;this.genome=3Dl.genome;this.chroms_la= yout=3Dthis._chroms_layout();this.data_bounds=3D[];this.scale=3D1;this.pare= nt_elt=3Dj.select(this.$el[0])},render:function(){var p=3Dthis.parent_elt;i= f(!p){console.log("no parent elt")}var o=3Dthis.chroms_layout,r=3Dj.svg.arc= ().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1]),l= =3Dp.selectAll("g").data(o).enter().append("svg:g"),n=3Dl.append("path").at= tr("d",r).attr("class","chrom-background").style("stroke",this.bg_stroke).s= tyle("fill",this.loading_bg_fill);n.append("title").text(function(t){return= t.data.chrom});var m=3Dthis,q=3Dm.track.get("data_manager"),s=3D(q?q.data_= is_ready():true);$.when(s).then(function(){$.when(m._render_data(p)).then(f= unction(){n.style("fill",m.bg_fill)})})},update_radius_bounds:function(m){t= his.radius_bounds=3Dm;var l=3Dj.svg.arc().innerRadius(this.radius_bounds[0]= ).outerRadius(this.radius_bounds[1]);this.parent_elt.selectAll("g>path.chro= m-background").transition().duration(1000).attr("d",l);this._transition_chr= om_data()},update_scale:function(o){var n=3Dthis.scale;this.scale=3Do;if(o<= =3Dn){return}var m=3Dthis,l=3Dnew k();this.parent_elt.selectAll("path.chrom= -data").filter(function(q,p){return l.is_visible(this)}).each(function(v,r)= {var u=3Dj.select(this),q=3Du.attr("chrom"),t=3Dm.genome.get_chrom_region(q= ),s=3Dm.track.get("data_manager"),p;if(!s.can_get_more_detailed_data(t)){re= turn}p=3Dm.track.get("data_manager").get_more_detailed_data(t,"Coverage",0,= o);$.when(p).then(function(z){u.remove();m._update_data_bounds();var y=3Dg.= find(m.chroms_layout,function(A){return A.data.chrom=3D=3D=3Dq});var w=3Dm.= track.get("prefs"),x=3Dw.block_color;if(!x){x=3Dw.color}m._render_chrom_dat= a(m.parent_elt,y,z).style("stroke",x).style("fill",x)})});return m},_transi= tion_chrom_data:function(){var m=3Dthis.track,o=3Dthis.chroms_layout,l=3Dth= is.parent_elt.selectAll("g>path.chrom-data"),p=3Dl[0].length;if(p>0){var n= =3Dthis;$.when(m.get("data_manager").get_genome_wide_data(this.genome)).the= n(function(r){var q=3Dg.reject(g.map(r,function(s,t){var u=3Dnull,v=3Dn._ge= t_path_function(o[t],s);if(v){u=3Dv(s.data)}return u}),function(s){return s= =3D=3D=3Dnull});l.each(function(t,s){j.select(this).transition().duration(1= 000).attr("d",q[s])})})}},_update_data_bounds:function(){var l=3Dthis.data_= bounds;this.data_bounds=3Dthis.get_data_bounds(this.track.get("data_manager= ").get_genome_wide_data(this.genome));if(this.data_bounds[0]<l[0]||this.dat= a_bounds[1]>l[1]){this._transition_chrom_data()}},_render_data:function(o){= var n=3Dthis,m=3Dthis.chroms_layout,l=3Dthis.track,p=3D$.Deferred();$.when(= l.get("data_manager").get_genome_wide_data(this.genome)).then(function(s){n= .data_bounds=3Dn.get_data_bounds(s);layout_and_data=3Dg.zip(m,s),chroms_dat= a_layout=3Dg.map(layout_and_data,function(t){var u=3Dt[0],v=3Dt[1];return n= ._render_chrom_data(o,u,v)});var q=3Dl.get("config"),r=3Dq.get_value("block= _color");if(!r){r=3Dq.get_value("color")}n.parent_elt.selectAll("path.chrom= -data").style("stroke",r).style("fill",r);p.resolve(o)});return p},_render_= chrom_data:function(l,m,n){},_get_path_function:function(m,l){},_chroms_lay= out:function(){var m=3Dthis.genome.get_chroms_info(),o=3Dj.layout.pie().val= ue(function(q){return q.len}).sort(null),p=3Do(m),l=3Dthis.total_gap/m.leng= th,n=3Dg.map(p,function(s,r){var q=3Ds.endAngle-l;s.endAngle=3D(q>s.startAn= gle?q:s.startAngle);return s});return n}});var b=3Di.extend({initialize:fun= ction(l){i.prototype.initialize.call(this,l);this.bg_stroke=3D"fff";this.bg= _fill=3D"fff"},_render_data:function(m){var l=3Dm.selectAll("g");l.selectAl= l("path").attr("id",function(n){return"label-"+n.data.chrom});l.append("svg= :text").filter(function(n){return n.endAngle-n.startAngle>0.08}).attr("text= -anchor","middle").append("svg:textPath").attr("xlink:href",function(n){ret= urn"#label-"+n.data.chrom}).attr("startOffset","25%").text(function(n){retu= rn n.data.chrom})}});var f=3Di.extend({_render_chrom_data:function(l,o,m){v= ar p=3Dthis._get_path_function(o,m);if(!p){return null}var n=3Dl.datum(m.da= ta),q=3Dn.append("path").attr("class","chrom-data").attr("chrom",o.data.chr= om).attr("d",p);return q},_get_path_function:function(o,n){if(typeof n=3D= =3D=3D"string"||!n.data||n.data.length=3D=3D=3D0){return null}var l=3Dj.sca= le.linear().domain(this.data_bounds).range(this.radius_bounds);var p=3Dj.sc= ale.linear().domain([0,n.data.length]).range([o.startAngle,o.endAngle]);var= m=3Dj.svg.line.radial().interpolate("linear").radius(function(q){return l(= q[1])}).angle(function(r,q){return p(q)});return j.svg.area.radial().interp= olate(m.interpolate()).innerRadius(l(0)).outerRadius(m.radius()).angle(m.an= gle())},get_data_bounds:function(l){}});var e=3Df.extend({get_data_bounds:f= unction(m){var l=3Dg.map(m,function(n){if(typeof n=3D=3D=3D"string"||!n.max= ){return 0}return n.max});return[0,(l&&typeof l!=3D=3D"string"?g.max(l):0)]= }});var d=3Df.extend({get_data_bounds:function(m){var l=3Dg.flatten(g.map(m= ,function(n){if(n){return g.map(n.data,function(o){return o[1]})}else{retur= n 0}}));return[g.min(l),g.max(l)]}});return{CircsterView:a}}); \ No newline at end of file +define(["libs/underscore","libs/d3","viz/visualization"],function(g,k,h){v= ar l=3DBackbone.Model.extend({is_visible:function(p,m){var n=3Dp.getBoundin= gClientRect(),o=3D$("svg")[0].getBoundingClientRect();if(n.right<0||n.left>= o.right||n.bottom<0||n.top>o.bottom){return false}return true}});var c=3DBa= ckbone.Model.extend({defaults:{prefs:{color:"#ccc"}}});var a=3DBackbone.Vie= w.extend({className:"circster",initialize:function(m){this.total_gap=3Dm.to= tal_gap;this.genome=3Dm.genome;this.dataset_arc_height=3Dm.dataset_arc_heig= ht;this.track_gap=3D5;this.label_arc_height=3D20;this.scale=3D1;this.circul= ar_views=3Dnull;this.chords_views=3Dnull;this.model.get("tracks").on("add",= this.add_track,this);this.model.get("tracks").on("remove",this.remove_track= ,this);this.get_circular_tracks()},get_circular_tracks:function(){return th= is.model.get("tracks").filter(function(m){return m.get("track_type")!=3D=3D= "DiagonalHeatmapTrack"})},get_chord_tracks:function(){return this.model.get= ("tracks").filter(function(m){return m.get("track_type")=3D=3D=3D"DiagonalH= eatmapTrack"})},get_tracks_bounds:function(){var n=3Dthis.get_circular_trac= ks();dataset_arc_height=3Dthis.dataset_arc_height,min_dimension=3DMath.min(= this.$el.width(),this.$el.height()),radius_start=3Dmin_dimension/2-n.length= *(this.dataset_arc_height+this.track_gap)-(this.label_arc_height+this.track= _gap),tracks_start_radii=3Dk.range(radius_start,min_dimension/2,this.datase= t_arc_height+this.track_gap);var m=3Dthis;return g.map(tracks_start_radii,f= unction(o){return[o,o+m.dataset_arc_height]})},render:function(){var u=3Dth= is,p=3Dthis.dataset_arc_height,m=3Du.$el.width(),t=3Du.$el.height(),r=3Dthi= s.get_circular_tracks(),o=3Dthis.get_chord_tracks(),q=3Dthis.get_tracks_bou= nds(),n=3Dk.select(u.$el[0]).append("svg").attr("width",m).attr("height",t)= .attr("pointer-events","all").append("svg:g").call(k.behavior.zoom().on("zo= om",function(){var v=3Dk.event.scale;n.attr("transform","translate("+k.even= t.translate+") scale("+v+")");if(u.scale!=3D=3Dv){if(u.zoom_drag_timeout){c= learTimeout(u.zoom_drag_timeout)}u.zoom_drag_timeout=3DsetTimeout(function(= ){g.each(u.circular_views,function(w){w.update_scale(v)})},400)}})).attr("t= ransform","translate("+m/2+","+t/2+")").append("svg:g").attr("class","track= s");this.circular_views=3Dr.map(function(w,x){var y=3D(w.get("track_type")= =3D=3D=3D"LineTrack"?d:e),v=3Dnew y({el:n.append("g")[0],track:w,radius_bou= nds:q[x],genome:u.genome,total_gap:u.total_gap});v.render();return v});this= .chords_views=3Do.map(function(w){var v=3Dnew i({el:n.append("g")[0],track:= w,radius_bounds:q[0],genome:u.genome,total_gap:u.total_gap});v.render();ret= urn v});var s=3Dq[r.length];s[1]=3Ds[0];this.label_track_view=3Dnew b({el:n= .append("g")[0],track:new c(),radius_bounds:s,genome:u.genome,total_gap:u.t= otal_gap});this.label_track_view.render()},add_track:function(s){if(s.get("= track_type")=3D=3D=3D"DiagonalHeatmapTrack"){var o=3Dthis.circular_views[0]= .radius_bounds,r=3Dnew i({el:k.select("g.tracks").append("g")[0],track:s,ra= dius_bounds:o,genome:this.genome,total_gap:this.total_gap});r.render();this= .chords_views.push(r)}else{var q=3Dthis.get_tracks_bounds();g.each(this.cir= cular_views,function(u,v){u.update_radius_bounds(q[v])});g.each(this.chords= _views,function(u){u.update_radius_bounds(q[0])});var p=3Dthis.circular_vie= ws.length,t=3D(s.get("track_type")=3D=3D=3D"LineTrack"?d:e),m=3Dnew t({el:k= .select("g.tracks").append("g")[0],track:s,radius_bounds:q[p],genome:this.g= enome,total_gap:this.total_gap});m.render();this.circular_views.push(m);var= n=3Dq[q.length-1];n[1]=3Dn[0];this.label_track_view.update_radius_bounds(n= )}},remove_track:function(n,p,o){var m=3Dthis.circular_views[o.index];this.= circular_views.splice(o.index,1);m.$el.remove();var q=3Dthis.get_tracks_bou= nds();g.each(this.circular_views,function(r,s){r.update_radius_bounds(q[s])= })}});var j=3DBackbone.View.extend({tagName:"g",initialize:function(m){this= .bg_stroke=3D"ccc";this.loading_bg_fill=3D"000";this.bg_fill=3D"ccc";this.t= otal_gap=3Dm.total_gap;this.track=3Dm.track;this.radius_bounds=3Dm.radius_b= ounds;this.genome=3Dm.genome;this.chroms_layout=3Dthis._chroms_layout();thi= s.data_bounds=3D[];this.scale=3D1;this.parent_elt=3Dk.select(this.$el[0])},= get_fill_color:function(){var m=3Dthis.track.get("config").get_value("block= _color");if(!m){m=3Dthis.track.get("config").get_value("color")}return m},r= ender:function(){var q=3Dthis.parent_elt;if(!q){console.log("no parent elt"= )}var p=3Dthis.chroms_layout,s=3Dk.svg.arc().innerRadius(this.radius_bounds= [0]).outerRadius(this.radius_bounds[1]),m=3Dq.selectAll("g").data(p).enter(= ).append("svg:g"),o=3Dm.append("path").attr("d",s).attr("class","chrom-back= ground").style("stroke",this.bg_stroke).style("fill",this.loading_bg_fill);= o.append("title").text(function(u){return u.data.chrom});var n=3Dthis,r=3Dn= .track.get("data_manager"),t=3D(r?r.data_is_ready():true);$.when(t).then(fu= nction(){$.when(n._render_data(q)).then(function(){o.style("fill",n.bg_fill= )})})},update_radius_bounds:function(n){this.radius_bounds=3Dn;var m=3Dk.sv= g.arc().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1= ]);this.parent_elt.selectAll("g>path.chrom-background").transition().durati= on(1000).attr("d",m);this._transition_chrom_data()},update_scale:function(p= ){var o=3Dthis.scale;this.scale=3Dp;if(p<=3Do){return}var n=3Dthis,m=3Dnew = l();this.parent_elt.selectAll("path.chrom-data").filter(function(r,q){retur= n m.is_visible(this)}).each(function(w,s){var v=3Dk.select(this),r=3Dv.attr= ("chrom"),u=3Dn.genome.get_chrom_region(r),t=3Dn.track.get("data_manager"),= q;if(!t.can_get_more_detailed_data(u)){return}q=3Dn.track.get("data_manager= ").get_more_detailed_data(u,"Coverage",0,p);$.when(q).then(function(z){v.re= move();n._update_data_bounds();var y=3Dg.find(n.chroms_layout,function(A){r= eturn A.data.chrom=3D=3D=3Dr});var x=3Dn.get_fill_color();n._render_chrom_d= ata(n.parent_elt,y,z).style("stroke",x).style("fill",x)})});return n},_tran= sition_chrom_data:function(){var n=3Dthis.track,p=3Dthis.chroms_layout,m=3D= this.parent_elt.selectAll("g>path.chrom-data"),q=3Dm[0].length;if(q>0){var = o=3Dthis;$.when(n.get("data_manager").get_genome_wide_data(this.genome)).th= en(function(s){var r=3Dg.reject(g.map(s,function(t,u){var v=3Dnull,w=3Do._g= et_path_function(p[u],t);if(w){v=3Dw(t.data)}return v}),function(t){return = t=3D=3D=3Dnull});m.each(function(u,t){k.select(this).transition().duration(= 1000).attr("d",r[t])})})}},_update_data_bounds:function(){var m=3Dthis.data= _bounds;this.data_bounds=3Dthis.get_data_bounds(this.track.get("data_manage= r").get_genome_wide_data(this.genome));if(this.data_bounds[0]<m[0]||this.da= ta_bounds[1]>m[1]){this._transition_chrom_data()}},_render_data:function(p)= {var o=3Dthis,n=3Dthis.chroms_layout,m=3Dthis.track,q=3D$.Deferred();$.when= (m.get("data_manager").get_genome_wide_data(this.genome)).then(function(s){= o.data_bounds=3Do.get_data_bounds(s);layout_and_data=3Dg.zip(n,s),chroms_da= ta_layout=3Dg.map(layout_and_data,function(t){var u=3Dt[0],v=3Dt[1];return = o._render_chrom_data(p,u,v)});var r=3Do.get_fill_color();o.parent_elt.selec= tAll("path.chrom-data").style("stroke",r).style("fill",r);q.resolve(p)});re= turn q},_render_chrom_data:function(m,n,o){},_get_path_function:function(n,= m){},_chroms_layout:function(){var n=3Dthis.genome.get_chroms_info(),p=3Dk.= layout.pie().value(function(r){return r.len}).sort(null),q=3Dp(n),m=3Dthis.= total_gap/n.length,o=3Dg.map(q,function(t,s){var r=3Dt.endAngle-m;t.endAngl= e=3D(r>t.startAngle?r:t.startAngle);return t});return o}});var b=3Dj.extend= ({initialize:function(m){j.prototype.initialize.call(this,m);this.bg_stroke= =3D"fff";this.bg_fill=3D"fff"},_render_data:function(n){var m=3Dn.selectAll= ("g");m.selectAll("path").attr("id",function(o){return"label-"+o.data.chrom= });m.append("svg:text").filter(function(o){return o.endAngle-o.startAngle>0= .08}).attr("text-anchor","middle").append("svg:textPath").attr("xlink:href"= ,function(o){return"#label-"+o.data.chrom}).attr("startOffset","25%").text(= function(o){return o.data.chrom})}});var f=3Dj.extend({_render_chrom_data:f= unction(m,p,n){var q=3Dthis._get_path_function(p,n);if(!q){return null}var = o=3Dm.datum(n.data),r=3Do.append("path").attr("class","chrom-data").attr("c= hrom",p.data.chrom).attr("d",q);return r},_get_path_function:function(p,o){= if(typeof o=3D=3D=3D"string"||!o.data||o.data.length=3D=3D=3D0){return null= }var m=3Dk.scale.linear().domain(this.data_bounds).range(this.radius_bounds= );var q=3Dk.scale.linear().domain([0,o.data.length]).range([p.startAngle,p.= endAngle]);var n=3Dk.svg.line.radial().interpolate("linear").radius(functio= n(r){return m(r[1])}).angle(function(s,r){return q(r)});return k.svg.area.r= adial().interpolate(n.interpolate()).innerRadius(m(0)).outerRadius(n.radius= ()).angle(n.angle())},get_data_bounds:function(m){}});var e=3Df.extend({get= _data_bounds:function(n){var m=3Dg.map(n,function(o){if(typeof o=3D=3D=3D"s= tring"||!o.max){return 0}return o.max});return[0,(m&&typeof m!=3D=3D"string= "?g.max(m):0)]}});var d=3Df.extend({get_data_bounds:function(n){var m=3Dg.f= latten(g.map(n,function(o){if(o){return g.map(o.data,function(q){return q[1= ]})}else{return 0}}));return[g.min(m),g.max(m)]}});var i=3Dj.extend({render= :function(){var m=3Dthis;$.when(m.track.get("data_manager").data_is_ready()= ).then(function(){$.when(m.track.get("data_manager").get_genome_wide_data(m= .genome)).then(function(p){var o=3D[],n=3Dm.genome.get_chroms_info();g.each= (p,function(t,s){var q=3Dn[s].chrom;var r=3Dg.map(t.data,function(v){var u= =3Dm._get_region_angle(q,v[1]),w=3Dm._get_region_angle(v[3],v[4]);return{so= urce:{startAngle:u,endAngle:u+0.01},target:{startAngle:w,endAngle:w+0.01}}}= );o=3Do.concat(r)});m.parent_elt.append("g").attr("class","chord").selectAl= l("path").data(o).enter().append("path").style("fill",m.get_fill_color()).a= ttr("d",k.svg.chord().radius(m.radius_bounds[0])).style("opacity",1)})})},u= pdate_radius_bounds:function(m){this.radius_bounds=3Dm;this.parent_elt.sele= ctAll("path").transition().attr("d",k.svg.chord().radius(this.radius_bounds= [0]))},_get_region_angle:function(o,m){var n=3Dg.find(this.chroms_layout,fu= nction(p){return p.data.chrom=3D=3D=3Do});return n.endAngle-((n.endAngle-n.= startAngle)*(n.data.len-m)/n.data.len)}});return{CircsterView:a}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/scatterplot.js --- a/static/scripts/packed/viz/scatterplot.js +++ b/static/scripts/packed/viz/scatterplot.js @@ -1,1 +1,1 @@ -define(["../libs/underscore","../mvc/base-mvc","../utils/LazyDataLoader","= ../templates/compiled/template-visualization-scatterplotControlForm","../te= mplates/compiled/template-visualization-statsTable","../templates/compiled/= template-visualization-chartSettings","../libs/d3","../libs/bootstrap","../= libs/jquery/jquery-ui-1.8.23.custom.min"],function(){function a(f){var d=3D= 10,h=3D7,g=3D10,e=3D8,c=3D5;this.log=3Dfunction(){if(this.debugging&&consol= e&&console.debug){var i=3DArray.prototype.slice.call(arguments);i.unshift(t= his.toString());console.debug.apply(console,i)}};this.log("new TwoVarScatte= rplot:",f);this.defaults=3D{id:"TwoVarScatterplot",containerSelector:"body"= ,maxDataPoints:30000,datapointSize:4,animDuration:500,xNumTicks:10,yNumTick= s:10,xAxisLabelBumpY:40,yAxisLabelBumpX:-35,width:500,height:500,marginTop:= 50,marginRight:50,marginBottom:50,marginLeft:50,xMin:null,xMax:null,yMin:nu= ll,yMax:null,xLabel:"X",yLabel:"Y"};this.config=3D_.extend({},this.defaults= ,f);this.updateConfig=3Dfunction(i,j){_.extend(this.config,i)};this.toStrin= g=3Dfunction(){return this.config.id};this.translateStr=3Dfunction(i,j){ret= urn"translate("+i+","+j+")"};this.rotateStr=3Dfunction(j,i,k){return"rotate= ("+j+","+i+","+k+")"};this.svg=3Dd3.select(this.config.containerSelector).a= ppend("svg:svg").attr("class","chart");this.content=3Dthis.svg.append("svg:= g").attr("class","content").attr("id",this.config.id);this.xAxis=3Dthis.con= tent.append("g").attr("class","axis").attr("id","x-axis");this.xAxisLabel= =3Dthis.xAxis.append("text").attr("class","axis-label").attr("id","x-axis-l= abel");this.yAxis=3Dthis.content.append("g").attr("class","axis").attr("id"= ,"y-axis");this.yAxisLabel=3Dthis.yAxis.append("text").attr("class","axis-l= abel").attr("id","y-axis-label");this.adjustChartDimensions=3Dfunction(l,j,= i,k){l=3Dl||0;j=3Dj||0;i=3Di||0;k=3Dk||0;this.svg.attr("width",this.config.= width+(this.config.marginRight+j)+(this.config.marginLeft+k)).attr("height"= ,this.config.height+(this.config.marginTop+l)+(this.config.marginBottom+i))= .style("display","block");this.content=3Dthis.svg.select("g.content").attr(= "transform",this.translateStr(this.config.marginLeft+k,this.config.marginTo= p+l))};this.preprocessData=3Dfunction(k,j,i){return(k.length>this.config.ma= xDataPoints)?(k.slice(0,this.config.maxDataPoints)):(k)};this.setUpDomains= =3Dfunction(i,k,j){this.xMin=3Dthis.config.xMin||(j)?(j[0].min):(d3.min(i))= ;this.xMax=3Dthis.config.xMax||(j)?(j[0].max):(d3.max(i));this.yMin=3Dthis.= config.yMin||(j)?(j[1].min):(d3.min(k));this.yMax=3Dthis.config.yMax||(j)?(= j[1].max):(d3.max(k))};this.setUpScales=3Dfunction(){this.xScale=3Dd3.scale= .linear().domain([this.xMin,this.xMax]).range([0,this.config.width]),this.y= Scale=3Dd3.scale.linear().domain([this.yMin,this.yMax]).range([this.config.= height,0])};this.setUpXAxis=3Dfunction(){this.xAxisFn=3Dd3.svg.axis().scale= (this.xScale).ticks(this.config.xNumTicks).orient("bottom");this.xAxis.attr= ("transform",this.translateStr(0,this.config.height)).call(this.xAxisFn);th= is.xLongestLabel=3Dd3.max(_.map([this.xMin,this.xMax],function(i){return(St= ring(i)).length}));if(this.xLongestLabel>=3Dc){this.xAxis.selectAll("g").fi= lter(":nth-child(odd)").style("display","none")}this.xAxisLabel.attr("x",th= is.config.width/2).attr("y",this.config.xAxisLabelBumpY).attr("text-anchor"= ,"middle").text(this.config.xLabel)};this.setUpYAxis=3Dfunction(){this.yAxi= sFn=3Dd3.svg.axis().scale(this.yScale).ticks(this.config.yNumTicks).orient(= "left");this.yAxis.call(this.yAxisFn);var i=3Dthis.yAxis.selectAll("text").= filter(function(m,l){return l!=3D=3D0});this.yLongestLabel=3Dd3.max(i[0].ma= p(function(m,l){return(d3.select(m).text()).length}))||0;var j=3Dd+(this.yL= ongestLabel*h)+e+g;this.config.yAxisLabelBumpX=3D-(j-g);if(this.config.marg= inLeft<j){var k=3D(j)-this.config.marginLeft;k=3D(k<0)?(0):(k);this.adjustC= hartDimensions(0,0,0,k)}this.yAxisLabel.attr("x",this.config.yAxisLabelBump= X).attr("y",this.config.height/2).attr("text-anchor","middle").attr("transf= orm",this.rotateStr(-90,this.config.yAxisLabelBumpX,this.config.height/2)).= text(this.config.yLabel)};this.renderGrid=3Dfunction(){this.vGridLines=3Dth= is.content.selectAll("line.v-grid-line").data(this.xScale.ticks(this.xAxisF= n.ticks()[0]));this.vGridLines.enter().append("svg:line").classed("grid-lin= e v-grid-line",true);this.vGridLines.attr("x1",this.xScale).attr("y1",0).at= tr("x2",this.xScale).attr("y2",this.config.height);this.vGridLines.exit().r= emove();this.hGridLines=3Dthis.content.selectAll("line.h-grid-line").data(t= his.yScale.ticks(this.yAxisFn.ticks()[0]));this.hGridLines.enter().append("= svg:line").classed("grid-line h-grid-line",true);this.hGridLines.attr("x1",= 0).attr("y1",this.yScale).attr("x2",this.config.width).attr("y2",this.yScal= e);this.hGridLines.exit().remove()};this.glyphEnterState=3Dfunction(i){};th= is.glyphFinalState=3Dfunction(i){};this.glyphExitState=3Dfunction(i){};this= .renderDatapoints=3Dfunction(i,l,j){this.log(this+".renderDatapoints",argum= ents);var k=3D0;this.datapoints=3Dthis.addDatapoints(i,l,j,".glyph");this.d= atapoints.exit().each(function(){k+=3D1}).transition().duration(this.config= .animDuration).attr("cy",this.config.height).attr("r",0).remove();this.log(= k," glyphs removed")};this.addDatapoints=3Dfunction(m,k,i,l){this.log(this+= ".addDatapoints",arguments);var p=3Dthis,o=3D0,q=3Dfunction(s,r){return p.x= Scale(m[r])},j=3Dfunction(s,r){return p.yScale(k[r])};var n=3Dthis.content.= selectAll(l);this.log("existing datapoints:",n);n=3Dn.data(m);o=3D0;n.enter= ().append("svg:circle").each(function(){o+=3D1}).classed("glyph",true).attr= ("cx",q).attr("cy",j).attr("r",0);this.log(o," new glyphs created");o=3D0;n= .transition().duration(this.config.animDuration).each(function(){o+=3D1}).a= ttr("cx",q).attr("cy",j).attr("r",p.config.datapointSize);this.log(o," exis= ting glyphs transitioned");if(i){n.attr("data",function(s,r){return(i[r])})= }n.attr("title",function(s,r){return((i)?(i[r]+": "):(""))+m[r]+", "+k[r]})= ;n.on("mouseover",function(){var r=3Dd3.select(this);r.style("fill","red").= style("fill-opacity",1);p.content.append("line").attr("stroke","red").attr(= "stroke-width",1).attr("x1",r.attr("cx")).attr("y1",r.attr("cy")).attr("x2"= ,0).attr("y2",r.attr("cy")).classed("hoverline",true);p.content.append("lin= e").attr("stroke","red").attr("stroke-width",1).attr("x1",r.attr("cx")).att= r("y1",r.attr("cy")).attr("x2",r.attr("cx")).attr("y2",p.config.height).cla= ssed("hoverline",true)}).on("mouseout",function(){d3.select(this).style("fi= ll","black").style("fill-opacity",0.2);d3.selectAll(".hoverline").remove()}= );return n};this.render=3Dfunction(k,l){this.log(this+".render",arguments);= var i=3Dk[0],m=3Dk[1],j=3D(k.length>2)?(k[2]):(undefined);i=3Dthis.preproce= ssData(i);m=3Dthis.preprocessData(m);this.log("xCol len",i.length,"yCol len= ",m.length);this.setUpDomains(i,m,l);this.setUpScales();this.adjustChartDim= ensions();this.setUpXAxis();this.setUpYAxis();this.renderGrid();this.render= Datapoints(i,m,j)}}var b=3DBaseView.extend(LoggableMixin).extend({className= :"scatterplot-settings-form",dataLoadDelay:500,dataLoadSize:3001,loadingInd= icatorImage:"loading_large_white_bg.gif",initialize:function(c){if(this.log= ger){window.form=3Dthis}this.dataset=3Dnull;this.chartConfig=3Dnull;this.pl= ot=3Dnull;this.loader=3Dnull;this.$statsPanel=3Dnull;this.$chartSettingsPan= el=3Dnull;this.$dataSettingsPanel=3Dnull;this.dataFetch=3Dnull;this.initial= izeFromAttributes(c);this.initializeChart(c);this.initializeDataLoader(c)},= initializeFromAttributes:function(c){if(!c||!c.dataset){throw ("Scatterplot= View requires a dataset")}else{this.dataset=3Dc.dataset}if(jQuery.type(this= .dataset.metadata_column_types)=3D=3D=3D"string"){this.dataset.metadata_col= umn_types=3Dthis.dataset.metadata_column_types.split(", ")}this.log("datase= t:",this.dataset);if(!c.apiDatasetsURL){throw ("ScatterplotView requires a = apiDatasetsURL")}else{this.dataURL=3Dc.apiDatasetsURL+"/"+this.dataset.id+"= ?"}this.log("this.dataURL:",this.dataURL)},initializeChart:function(c){this= .chartConfig=3Dc.chartConfig||{};if(this.logger){this.chartConfig.debugging= =3Dtrue}this.log("initial chartConfig:",this.chartConfig);this.plot=3Dnew a= (this.chartConfig);this.chartConfig=3Dthis.plot.config},initializeDataLoade= r:function(d){var c=3Dthis;this.loader=3Dnew LazyDataLoader({logger:(this.l= ogger)?(this.logger):(null),url:null,start:d.start||0,total:d.total||this.d= ataset.metadata_data_lines,delay:this.dataLoadDelay,size:this.dataLoadSize,= buildUrl:function(f,e){return this.url+"&"+jQuery.param({start_val:f,max_va= ls:e})}});$(this.loader).bind("error",function(g,e,f){c.log("ERROR:",e,f);a= lert("ERROR fetching data:\n"+e+"\n"+f);c.hideLoadingIndicator()})},render:= function(){var c=3Dthis,d=3D{config:this.chartConfig,allColumns:[],numericC= olumns:[],loadingIndicatorImagePath:galaxy_paths.get("image_path")+"/"+this= .loadingIndicatorImage};_.each(this.dataset.metadata_column_types,function(= g,f){var e=3D"column "+(f+1);if(c.dataset.metadata_column_names){e=3Dc.data= set.metadata_column_names[f]}if(g=3D=3D=3D"int"||g=3D=3D=3D"float"){d.numer= icColumns.push({index:f,name:e})}d.allColumns.push({index:f,name:e})});this= .$el.append(b.templates.form(d));this.$dataSettingsPanel=3Dthis.$el.find(".= tab-pane#data-settings");this.$chartSettingsPanel=3Dthis._render_chartSetti= ngs();this.$statsPanel=3Dthis.$el.find(".tab-pane#chart-stats");return this= },_render_chartSettings:function(){var c=3Dthis,d=3Dthis.$el.find(".tab-pan= e#chart-settings"),e=3D{datapointSize:{min:2,max:10,step:1},width:{min:200,= max:800,step:20},height:{min:200,max:800,step:20}};d.append(b.templates.cha= rtSettings(this.chartConfig));d.find(".numeric-slider-input").each(function= (){var h=3D$(this),g=3Dh.find(".slider-output"),i=3Dh.find(".slider"),j=3Dh= .attr("id");function f(){var l=3D$(this),k=3Dl.slider("value");g.text(k)}i.= slider(_.extend(e[j],{value:c.chartConfig[j],change:f,slide:f}))});return d= },events:{"click #include-id-checkbox":"toggleThirdColumnSelector","click #= data-settings #render-button":"renderPlot","click #chart-settings #render-b= utton":"changeChartSettings"},toggleThirdColumnSelector:function(){this.$el= .find('select[name=3D"ID"]').parent().toggle()},showLoadingIndicator:functi= on(d,e){d=3Dd||"";var c=3Dthis.$el.find("div#loading-indicator");messageBox= =3Dc.find(".loading-message");if(c.is(":visible")){if(d){messageBox.fadeOut= ("fast",function(){messageBox.text(d);messageBox.fadeIn("fast",e)})}else{e(= )}}else{if(d){messageBox.text(d)}c.fadeIn("fast",e)}},hideLoadingIndicator:= function(c){this.$el.find("div#loading-indicator").fadeOut("fast",c)},rende= rPlot:function(){var c=3Dthis;c.data=3Dnull;c.meta=3Dnull;_.extend(this.cha= rtConfig,this.getGraphSettings());this.log("this.chartConfig:",this.chartCo= nfig);this.plot.updateConfig(this.chartConfig,false);this.loader.url=3Dthis= .dataURL+"&"+jQuery.param(this.getDataSettings());this.log("this.loader, ur= l:",this.loader.url,"total:",this.loader.total);$(this.loader).bind("loaded= .new",function(e,d){c.log(c+" loaded.new",d);c.postProcessDataFetchResponse= (d);c.log("postprocessed data:",c.data,"meta:",c.meta);c.showLoadingIndicat= or("Rendering...",function(){c.$el.find("ul.nav").find('a[href=3D"#chart-st= ats"]').tab("show");c.plot.render(c.data,c.meta);c.renderStats(c.data,c.met= a);c.hideLoadingIndicator()})});$(this.loader).bind("complete",function(d,e= ){c.log("complete",e);$(c.loader).unbind()});c.showLoadingIndicator("Fetchi= ng data...",function(){c.loader.load()})},renderStats:function(){this.$stat= sPanel.html(b.templates.statsTable({stats:[{name:"Count",xval:this.meta[0].= count,yval:this.meta[1].count},{name:"Min",xval:this.meta[0].min,yval:this.= meta[1].min},{name:"Max",xval:this.meta[0].max,yval:this.meta[1].max},{name= :"Sum",xval:this.meta[0].sum,yval:this.meta[1].sum},{name:"Mean",xval:this.= meta[0].mean,yval:this.meta[1].mean},{name:"Median",xval:this.meta[0].media= n,yval:this.meta[1].median}]}))},changeChartSettings:function(){var c=3Dthi= s;newGraphSettings=3Dthis.getGraphSettings();this.log("newGraphSettings:",n= ewGraphSettings);_.extend(this.chartConfig,newGraphSettings);this.log("this= .chartConfig:",this.chartConfig);this.plot.updateConfig(this.chartConfig,fa= lse);if(c.data&&c.meta){c.showLoadingIndicator("Rendering...",function(){c.= plot.render(c.data,c.meta);c.hideLoadingIndicator()})}else{this.renderPlot(= )}},postProcessDataFetchResponse:function(c){this.postProcessData(c.data);t= his.postProcessMeta(c.meta)},postProcessData:function(d){var c=3Dthis;if(c.= data){_.each(d,function(f,e){c.data[e]=3Dc.data[e].concat(f)})}else{c.data= =3Dd}},postProcessMeta:function(e){var c=3Dthis,d=3Dthis.dataset.metadata_c= olumn_types;if(c.meta){_.each(e,function(g,f){var k=3Dc.meta[f],i=3Dd[f];c.= log(f+" postprocessing meta:",g);k.count+=3D(g.count)?(g.count):(0);c.log(f= ,"count:",k.count);if((i=3D=3D=3D"int")||(i=3D=3D=3D"float")){k.min=3DMath.= min(g.min,k.min);k.max=3DMath.max(g.max,k.max);k.sum=3Dg.sum+k.sum;k.mean= =3D(k.count)?(k.sum/k.count):(null);var h=3Dc.data[f].slice().sort(),j=3DMa= th.floor(h.length/2);if(h.length%2=3D=3D=3D0){k.median=3D((h[j]+h[(j+1)])/2= )}else{k.median=3Dh[j]}}})}else{c.meta=3De;c.log("initial meta:",c.meta)}},= getDataSettings:function(){var d=3Dthis.getColumnSelections(),c=3D[];this.l= og("columnSelections:",d);c=3D[d.X.colIndex,d.Y.colIndex];if(this.$dataSett= ingsPanel.find("#include-id-checkbox").attr("checked")){c.push(d.ID.colInde= x)}var e=3D{data_type:"raw_data",columns:"["+c+"]"};this.log("params:",e);r= eturn e},getColumnSelections:function(){var c=3D{};this.$dataSettingsPanel.= find("div.column-select select").each(function(){var d=3D$(this),e=3Dd.val(= );c[d.attr("name")]=3D{colIndex:e,colName:d.children('[value=3D"'+e+'"]').t= ext()}});return c},getGraphSettings:function(){var e=3D{},f=3Dthis.getColum= nSelections();e.datapointSize=3Dthis.$chartSettingsPanel.find("#datapointSi= ze.numeric-slider-input").find(".slider").slider("value");e.width=3Dthis.$c= hartSettingsPanel.find("#width.numeric-slider-input").find(".slider").slide= r("value");e.height=3Dthis.$chartSettingsPanel.find("#height.numeric-slider= -input").find(".slider").slider("value");var d=3Dthis.$chartSettingsPanel.f= ind("input#X-axis-label").val(),c=3Dthis.$chartSettingsPanel.find("input#Y-= axis-label").val();e.xLabel=3D(d=3D=3D=3D"X")?(f.X.colName):(d);e.yLabel=3D= (c=3D=3D=3D"Y")?(f.Y.colName):(c);e.animDuration=3D10;if(this.$chartSetting= sPanel.find("#animDuration.checkbox-input").is(":checked")){e.animDuration= =3D500}this.log("graphSettings:",e);return e},toString:function(){return"Sc= atterplotControlForm("+this.dataset.id+")"}});b.templates=3D{form:Handlebar= s.templates["template-visualization-scatterplotControlForm"],statsTable:Han= dlebars.templates["template-visualization-statsTable"],chartSettings:Handle= bars.templates["template-visualization-chartSettings"]};return{LazyDataLoad= er:LazyDataLoader,TwoVarScatterplot:a,ScatterplotControlForm:b}}); \ No newline at end of file +define(["../libs/underscore","../mvc/base-mvc","../utils/LazyDataLoader","= ../templates/compiled/template-visualization-scatterplotControlForm","../te= mplates/compiled/template-visualization-statsTable","../templates/compiled/= template-visualization-chartSettings","../libs/d3","../libs/bootstrap","../= libs/jquery/jquery-ui"],function(){function a(f){var d=3D10,h=3D7,g=3D10,e= =3D8,c=3D5;this.log=3Dfunction(){if(this.debugging&&console&&console.debug)= {var i=3DArray.prototype.slice.call(arguments);i.unshift(this.toString());c= onsole.debug.apply(console,i)}};this.log("new TwoVarScatterplot:",f);this.d= efaults=3D{id:"TwoVarScatterplot",containerSelector:"body",maxDataPoints:30= 000,datapointSize:4,animDuration:500,xNumTicks:10,yNumTicks:10,xAxisLabelBu= mpY:40,yAxisLabelBumpX:-35,width:500,height:500,marginTop:50,marginRight:50= ,marginBottom:50,marginLeft:50,xMin:null,xMax:null,yMin:null,yMax:null,xLab= el:"X",yLabel:"Y"};this.config=3D_.extend({},this.defaults,f);this.updateCo= nfig=3Dfunction(i,j){_.extend(this.config,i)};this.toString=3Dfunction(){re= turn this.config.id};this.translateStr=3Dfunction(i,j){return"translate("+i= +","+j+")"};this.rotateStr=3Dfunction(j,i,k){return"rotate("+j+","+i+","+k+= ")"};this.svg=3Dd3.select(this.config.containerSelector).append("svg:svg").= attr("class","chart");this.content=3Dthis.svg.append("svg:g").attr("class",= "content").attr("id",this.config.id);this.xAxis=3Dthis.content.append("g").= attr("class","axis").attr("id","x-axis");this.xAxisLabel=3Dthis.xAxis.appen= d("text").attr("class","axis-label").attr("id","x-axis-label");this.yAxis= =3Dthis.content.append("g").attr("class","axis").attr("id","y-axis");this.y= AxisLabel=3Dthis.yAxis.append("text").attr("class","axis-label").attr("id",= "y-axis-label");this.adjustChartDimensions=3Dfunction(l,j,i,k){l=3Dl||0;j= =3Dj||0;i=3Di||0;k=3Dk||0;this.svg.attr("width",this.config.width+(this.con= fig.marginRight+j)+(this.config.marginLeft+k)).attr("height",this.config.he= ight+(this.config.marginTop+l)+(this.config.marginBottom+i)).style("display= ","block");this.content=3Dthis.svg.select("g.content").attr("transform",thi= s.translateStr(this.config.marginLeft+k,this.config.marginTop+l))};this.pre= processData=3Dfunction(k,j,i){return(k.length>this.config.maxDataPoints)?(k= .slice(0,this.config.maxDataPoints)):(k)};this.setUpDomains=3Dfunction(i,k,= j){this.xMin=3Dthis.config.xMin||(j)?(j[0].min):(d3.min(i));this.xMax=3Dthi= s.config.xMax||(j)?(j[0].max):(d3.max(i));this.yMin=3Dthis.config.yMin||(j)= ?(j[1].min):(d3.min(k));this.yMax=3Dthis.config.yMax||(j)?(j[1].max):(d3.ma= x(k))};this.setUpScales=3Dfunction(){this.xScale=3Dd3.scale.linear().domain= ([this.xMin,this.xMax]).range([0,this.config.width]),this.yScale=3Dd3.scale= .linear().domain([this.yMin,this.yMax]).range([this.config.height,0])};this= .setUpXAxis=3Dfunction(){this.xAxisFn=3Dd3.svg.axis().scale(this.xScale).ti= cks(this.config.xNumTicks).orient("bottom");this.xAxis.attr("transform",thi= s.translateStr(0,this.config.height)).call(this.xAxisFn);this.xLongestLabel= =3Dd3.max(_.map([this.xMin,this.xMax],function(i){return(String(i)).length}= ));if(this.xLongestLabel>=3Dc){this.xAxis.selectAll("g").filter(":nth-child= (odd)").style("display","none")}this.xAxisLabel.attr("x",this.config.width/= 2).attr("y",this.config.xAxisLabelBumpY).attr("text-anchor","middle").text(= this.config.xLabel)};this.setUpYAxis=3Dfunction(){this.yAxisFn=3Dd3.svg.axi= s().scale(this.yScale).ticks(this.config.yNumTicks).orient("left");this.yAx= is.call(this.yAxisFn);var i=3Dthis.yAxis.selectAll("text").filter(function(= m,l){return l!=3D=3D0});this.yLongestLabel=3Dd3.max(i[0].map(function(m,l){= return(d3.select(m).text()).length}))||0;var j=3Dd+(this.yLongestLabel*h)+e= +g;this.config.yAxisLabelBumpX=3D-(j-g);if(this.config.marginLeft<j){var k= =3D(j)-this.config.marginLeft;k=3D(k<0)?(0):(k);this.adjustChartDimensions(= 0,0,0,k)}this.yAxisLabel.attr("x",this.config.yAxisLabelBumpX).attr("y",thi= s.config.height/2).attr("text-anchor","middle").attr("transform",this.rotat= eStr(-90,this.config.yAxisLabelBumpX,this.config.height/2)).text(this.confi= g.yLabel)};this.renderGrid=3Dfunction(){this.vGridLines=3Dthis.content.sele= ctAll("line.v-grid-line").data(this.xScale.ticks(this.xAxisFn.ticks()[0]));= this.vGridLines.enter().append("svg:line").classed("grid-line v-grid-line",= true);this.vGridLines.attr("x1",this.xScale).attr("y1",0).attr("x2",this.xS= cale).attr("y2",this.config.height);this.vGridLines.exit().remove();this.hG= ridLines=3Dthis.content.selectAll("line.h-grid-line").data(this.yScale.tick= s(this.yAxisFn.ticks()[0]));this.hGridLines.enter().append("svg:line").clas= sed("grid-line h-grid-line",true);this.hGridLines.attr("x1",0).attr("y1",th= is.yScale).attr("x2",this.config.width).attr("y2",this.yScale);this.hGridLi= nes.exit().remove()};this.glyphEnterState=3Dfunction(i){};this.glyphFinalSt= ate=3Dfunction(i){};this.glyphExitState=3Dfunction(i){};this.renderDatapoin= ts=3Dfunction(i,l,j){this.log(this+".renderDatapoints",arguments);var k=3D0= ;this.datapoints=3Dthis.addDatapoints(i,l,j,".glyph");this.datapoints.exit(= ).each(function(){k+=3D1}).transition().duration(this.config.animDuration).= attr("cy",this.config.height).attr("r",0).remove();this.log(k," glyphs remo= ved")};this.addDatapoints=3Dfunction(m,k,i,l){this.log(this+".addDatapoints= ",arguments);var p=3Dthis,o=3D0,q=3Dfunction(s,r){return p.xScale(m[r])},j= =3Dfunction(s,r){return p.yScale(k[r])};var n=3Dthis.content.selectAll(l);t= his.log("existing datapoints:",n);n=3Dn.data(m);o=3D0;n.enter().append("svg= :circle").each(function(){o+=3D1}).classed("glyph",true).attr("cx",q).attr(= "cy",j).attr("r",0);this.log(o," new glyphs created");o=3D0;n.transition().= duration(this.config.animDuration).each(function(){o+=3D1}).attr("cx",q).at= tr("cy",j).attr("r",p.config.datapointSize);this.log(o," existing glyphs tr= ansitioned");if(i){n.attr("data",function(s,r){return(i[r])})}n.attr("title= ",function(s,r){return((i)?(i[r]+": "):(""))+m[r]+", "+k[r]});n.on("mouseov= er",function(){var r=3Dd3.select(this);r.style("fill","red").style("fill-op= acity",1);p.content.append("line").attr("stroke","red").attr("stroke-width"= ,1).attr("x1",r.attr("cx")).attr("y1",r.attr("cy")).attr("x2",0).attr("y2",= r.attr("cy")).classed("hoverline",true);p.content.append("line").attr("stro= ke","red").attr("stroke-width",1).attr("x1",r.attr("cx")).attr("y1",r.attr(= "cy")).attr("x2",r.attr("cx")).attr("y2",p.config.height).classed("hoverlin= e",true)}).on("mouseout",function(){d3.select(this).style("fill","black").s= tyle("fill-opacity",0.2);d3.selectAll(".hoverline").remove()});return n};th= is.render=3Dfunction(k,l){this.log(this+".render",arguments);var i=3Dk[0],m= =3Dk[1],j=3D(k.length>2)?(k[2]):(undefined);i=3Dthis.preprocessData(i);m=3D= this.preprocessData(m);this.log("xCol len",i.length,"yCol len",m.length);th= is.setUpDomains(i,m,l);this.setUpScales();this.adjustChartDimensions();this= .setUpXAxis();this.setUpYAxis();this.renderGrid();this.renderDatapoints(i,m= ,j)}}var b=3DBaseView.extend(LoggableMixin).extend({className:"scatterplot-= settings-form",dataLoadDelay:500,dataLoadSize:3001,loadingIndicatorImage:"l= oading_large_white_bg.gif",initialize:function(c){if(this.logger){window.fo= rm=3Dthis}this.dataset=3Dnull;this.chartConfig=3Dnull;this.plot=3Dnull;this= .loader=3Dnull;this.$statsPanel=3Dnull;this.$chartSettingsPanel=3Dnull;this= .$dataSettingsPanel=3Dnull;this.dataFetch=3Dnull;this.initializeFromAttribu= tes(c);this.initializeChart(c);this.initializeDataLoader(c)},initializeFrom= Attributes:function(c){if(!c||!c.dataset){throw ("ScatterplotView requires = a dataset")}else{this.dataset=3Dc.dataset}if(jQuery.type(this.dataset.metad= ata_column_types)=3D=3D=3D"string"){this.dataset.metadata_column_types=3Dth= is.dataset.metadata_column_types.split(", ")}this.log("dataset:",this.datas= et);if(!c.apiDatasetsURL){throw ("ScatterplotView requires a apiDatasetsURL= ")}else{this.dataURL=3Dc.apiDatasetsURL+"/"+this.dataset.id+"?"}this.log("t= his.dataURL:",this.dataURL)},initializeChart:function(c){this.chartConfig= =3Dc.chartConfig||{};if(this.logger){this.chartConfig.debugging=3Dtrue}this= .log("initial chartConfig:",this.chartConfig);this.plot=3Dnew a(this.chartC= onfig);this.chartConfig=3Dthis.plot.config},initializeDataLoader:function(d= ){var c=3Dthis;this.loader=3Dnew LazyDataLoader({logger:(this.logger)?(this= .logger):(null),url:null,start:d.start||0,total:d.total||this.dataset.metad= ata_data_lines,delay:this.dataLoadDelay,size:this.dataLoadSize,buildUrl:fun= ction(f,e){return this.url+"&"+jQuery.param({start_val:f,max_vals:e})}});$(= this.loader).bind("error",function(g,e,f){c.log("ERROR:",e,f);alert("ERROR = fetching data:\n"+e+"\n"+f);c.hideLoadingIndicator()})},render:function(){v= ar c=3Dthis,d=3D{config:this.chartConfig,allColumns:[],numericColumns:[],lo= adingIndicatorImagePath:galaxy_paths.get("image_path")+"/"+this.loadingIndi= catorImage};_.each(this.dataset.metadata_column_types,function(g,f){var e= =3D"column "+(f+1);if(c.dataset.metadata_column_names){e=3Dc.dataset.metada= ta_column_names[f]}if(g=3D=3D=3D"int"||g=3D=3D=3D"float"){d.numericColumns.= push({index:f,name:e})}d.allColumns.push({index:f,name:e})});this.$el.appen= d(b.templates.form(d));this.$dataSettingsPanel=3Dthis.$el.find(".tab-pane#d= ata-settings");this.$chartSettingsPanel=3Dthis._render_chartSettings();this= .$statsPanel=3Dthis.$el.find(".tab-pane#chart-stats");return this},_render_= chartSettings:function(){var c=3Dthis,d=3Dthis.$el.find(".tab-pane#chart-se= ttings"),e=3D{datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,st= ep:20},height:{min:200,max:800,step:20}};d.append(b.templates.chartSettings= (this.chartConfig));d.find(".numeric-slider-input").each(function(){var h= =3D$(this),g=3Dh.find(".slider-output"),i=3Dh.find(".slider"),j=3Dh.attr("i= d");function f(){var l=3D$(this),k=3Dl.slider("value");g.text(k)}i.slider(_= .extend(e[j],{value:c.chartConfig[j],change:f,slide:f}))});return d},events= :{"click #include-id-checkbox":"toggleThirdColumnSelector","click #data-set= tings #render-button":"renderPlot","click #chart-settings #render-button":"= changeChartSettings"},toggleThirdColumnSelector:function(){this.$el.find('s= elect[name=3D"ID"]').parent().toggle()},showLoadingIndicator:function(d,e){= d=3Dd||"";var c=3Dthis.$el.find("div#loading-indicator");messageBox=3Dc.fin= d(".loading-message");if(c.is(":visible")){if(d){messageBox.fadeOut("fast",= function(){messageBox.text(d);messageBox.fadeIn("fast",e)})}else{e()}}else{= if(d){messageBox.text(d)}c.fadeIn("fast",e)}},hideLoadingIndicator:function= (c){this.$el.find("div#loading-indicator").fadeOut("fast",c)},renderPlot:fu= nction(){var c=3Dthis;c.data=3Dnull;c.meta=3Dnull;_.extend(this.chartConfig= ,this.getGraphSettings());this.log("this.chartConfig:",this.chartConfig);th= is.plot.updateConfig(this.chartConfig,false);this.loader.url=3Dthis.dataURL= +"&"+jQuery.param(this.getDataSettings());this.log("this.loader, url:",this= .loader.url,"total:",this.loader.total);$(this.loader).bind("loaded.new",fu= nction(e,d){c.log(c+" loaded.new",d);c.postProcessDataFetchResponse(d);c.lo= g("postprocessed data:",c.data,"meta:",c.meta);c.showLoadingIndicator("Rend= ering...",function(){c.$el.find("ul.nav").find('a[href=3D"#chart-stats"]').= tab("show");c.plot.render(c.data,c.meta);c.renderStats(c.data,c.meta);c.hid= eLoadingIndicator()})});$(this.loader).bind("complete",function(d,e){c.log(= "complete",e);$(c.loader).unbind()});c.showLoadingIndicator("Fetching data.= ..",function(){c.loader.load()})},renderStats:function(){this.$statsPanel.h= tml(b.templates.statsTable({stats:[{name:"Count",xval:this.meta[0].count,yv= al:this.meta[1].count},{name:"Min",xval:this.meta[0].min,yval:this.meta[1].= min},{name:"Max",xval:this.meta[0].max,yval:this.meta[1].max},{name:"Sum",x= val:this.meta[0].sum,yval:this.meta[1].sum},{name:"Mean",xval:this.meta[0].= mean,yval:this.meta[1].mean},{name:"Median",xval:this.meta[0].median,yval:t= his.meta[1].median}]}))},changeChartSettings:function(){var c=3Dthis;newGra= phSettings=3Dthis.getGraphSettings();this.log("newGraphSettings:",newGraphS= ettings);_.extend(this.chartConfig,newGraphSettings);this.log("this.chartCo= nfig:",this.chartConfig);this.plot.updateConfig(this.chartConfig,false);if(= c.data&&c.meta){c.showLoadingIndicator("Rendering...",function(){c.plot.ren= der(c.data,c.meta);c.hideLoadingIndicator()})}else{this.renderPlot()}},post= ProcessDataFetchResponse:function(c){this.postProcessData(c.data);this.post= ProcessMeta(c.meta)},postProcessData:function(d){var c=3Dthis;if(c.data){_.= each(d,function(f,e){c.data[e]=3Dc.data[e].concat(f)})}else{c.data=3Dd}},po= stProcessMeta:function(e){var c=3Dthis,d=3Dthis.dataset.metadata_column_typ= es;if(c.meta){_.each(e,function(g,f){var k=3Dc.meta[f],i=3Dd[f];c.log(f+" p= ostprocessing meta:",g);k.count+=3D(g.count)?(g.count):(0);c.log(f,"count:"= ,k.count);if((i=3D=3D=3D"int")||(i=3D=3D=3D"float")){k.min=3DMath.min(g.min= ,k.min);k.max=3DMath.max(g.max,k.max);k.sum=3Dg.sum+k.sum;k.mean=3D(k.count= )?(k.sum/k.count):(null);var h=3Dc.data[f].slice().sort(),j=3DMath.floor(h.= length/2);if(h.length%2=3D=3D=3D0){k.median=3D((h[j]+h[(j+1)])/2)}else{k.me= dian=3Dh[j]}}})}else{c.meta=3De;c.log("initial meta:",c.meta)}},getDataSett= ings:function(){var d=3Dthis.getColumnSelections(),c=3D[];this.log("columnS= elections:",d);c=3D[d.X.colIndex,d.Y.colIndex];if(this.$dataSettingsPanel.f= ind("#include-id-checkbox").attr("checked")){c.push(d.ID.colIndex)}var e=3D= {data_type:"raw_data",columns:"["+c+"]"};this.log("params:",e);return e},ge= tColumnSelections:function(){var c=3D{};this.$dataSettingsPanel.find("div.c= olumn-select select").each(function(){var d=3D$(this),e=3Dd.val();c[d.attr(= "name")]=3D{colIndex:e,colName:d.children('[value=3D"'+e+'"]').text()}});re= turn c},getGraphSettings:function(){var e=3D{},f=3Dthis.getColumnSelections= ();e.datapointSize=3Dthis.$chartSettingsPanel.find("#datapointSize.numeric-= slider-input").find(".slider").slider("value");e.width=3Dthis.$chartSetting= sPanel.find("#width.numeric-slider-input").find(".slider").slider("value");= e.height=3Dthis.$chartSettingsPanel.find("#height.numeric-slider-input").fi= nd(".slider").slider("value");var d=3Dthis.$chartSettingsPanel.find("input#= X-axis-label").val(),c=3Dthis.$chartSettingsPanel.find("input#Y-axis-label"= ).val();e.xLabel=3D(d=3D=3D=3D"X")?(f.X.colName):(d);e.yLabel=3D(c=3D=3D=3D= "Y")?(f.Y.colName):(c);e.animDuration=3D10;if(this.$chartSettingsPanel.find= ("#animDuration.checkbox-input").is(":checked")){e.animDuration=3D500}this.= log("graphSettings:",e);return e},toString:function(){return"ScatterplotCon= trolForm("+this.dataset.id+")"}});b.templates=3D{form:Handlebars.templates[= "template-visualization-scatterplotControlForm"],statsTable:Handlebars.temp= lates["template-visualization-statsTable"],chartSettings:Handlebars.templat= es["template-visualization-chartSettings"]};return{LazyDataLoader:LazyDataL= oader,TwoVarScatterplot:a,ScatterplotControlForm:b}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/trackster/painters.js --- a/static/scripts/packed/viz/trackster/painters.js +++ b/static/scripts/packed/viz/trackster/painters.js @@ -1,1 +1,1 @@ -define(["libs/underscore"],function(_){var extend=3D_.extend;var BEFORE=3D= 1001,CONTAINS=3D1002,OVERLAP_START=3D1003,OVERLAP_END=3D1004,CONTAINED_BY= =3D1005,AFTER=3D1006;var compute_overlap=3Dfunction(first_region,second_reg= ion){var first_start=3Dfirst_region[0],first_end=3Dfirst_region[1],second_s= tart=3Dsecond_region[0],second_end=3Dsecond_region[1],overlap;if(first_star= t<second_start){if(first_end<second_start){overlap=3DBEFORE}else{if(first_e= nd<=3Dsecond_end){overlap=3DOVERLAP_START}else{overlap=3DCONTAINS}}}else{if= (first_start>second_end){overlap=3DAFTER}else{if(first_end<=3Dsecond_end){o= verlap=3DCONTAINED_BY}else{overlap=3DOVERLAP_END}}}return overlap};var is_o= verlap=3Dfunction(first_region,second_region){var overlap=3Dcompute_overlap= (first_region,second_region);return(overlap!=3D=3DBEFORE&&overlap!=3D=3DAFT= ER)};var dashedLine=3Dfunction(ctx,x1,y1,x2,y2,dashLen){if(dashLen=3D=3D=3D= undefined){dashLen=3D4}var dX=3Dx2-x1;var dY=3Dy2-y1;var dashes=3DMath.floo= r(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=3DdX/dashes;var dashY=3DdY/dash= es;var q;for(q=3D0;q<dashes;q++,x1+=3DdashX,y1+=3DdashY){if(q%2!=3D=3D0){co= ntinue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle= =3Dfunction(ctx,down_vertex_x,down_vertex_y,side_len){var x1=3Ddown_vertex_= x-side_len/2,x2=3Ddown_vertex_x+side_len/2,y=3Ddown_vertex_y-Math.sqrt(side= _len*3/2);ctx.beginPath();ctx.moveTo(x1,y);ctx.lineTo(x2,y);ctx.lineTo(down= _vertex_x,down_vertex_y);ctx.lineTo(x1,y);ctx.strokeStyle=3Dthis.fillStyle;= ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=3Dfunction(default_val)= {this.default_val=3D(default_val?default_val:1)};Scaler.prototype.gen_val= =3Dfunction(input){return this.default_val};var Painter=3Dfunction(data,vie= w_start,view_end,prefs,mode){this.data=3Ddata;this.view_start=3Dview_start;= this.view_end=3Dview_end;this.prefs=3Dextend({},this.default_prefs,prefs);t= his.mode=3Dmode};Painter.prototype.default_prefs=3D{};Painter.prototype.dra= w=3Dfunction(ctx,width,height,w_scale){};var SummaryTreePainter=3Dfunction(= data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view= _end,prefs,mode)};SummaryTreePainter.prototype.default_prefs=3D{show_counts= :false};SummaryTreePainter.prototype.draw=3Dfunction(ctx,width,height,w_sca= le){var view_start=3Dthis.view_start,points=3Dthis.data.data,max=3D(this.pr= efs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=3Dheight;d= elta_x_px=3DMath.ceil(this.data.delta*w_scale);ctx.save();for(var i=3D0,len= =3Dpoints.length;i<len;i++){var x=3DMath.floor((points[i][0]-view_start)*w_= scale);var y=3Dpoints[i][1];if(!y){continue}var y_px=3Dy/max*height;if(y!= =3D=3D0&&y_px<1){y_px=3D1}ctx.fillStyle=3Dthis.prefs.block_color;ctx.fillRe= ct(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=3D4;if(this.prefs.= show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.= fillStyle=3Dthis.prefs.label_color;ctx.textAlign=3D"center";ctx.fillText(y,= x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=3Dfunction(data,view_s= tart,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,= mode);var i,len;if(this.prefs.min_value=3D=3D=3Dundefined){var min_value=3D= Infinity;for(i=3D0,len=3Dthis.data.length;i<len;i++){min_value=3DMath.min(m= in_value,this.data[i][1])}this.prefs.min_value=3Dmin_value}if(this.prefs.ma= x_value=3D=3D=3Dundefined){var max_value=3D-Infinity;for(i=3D0,len=3Dthis.d= ata.length;i<len;i++){max_value=3DMath.max(max_value,this.data[i][1])}this.= prefs.max_value=3Dmax_value}};LinePainter.prototype.default_prefs=3D{min_va= lue:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_co= lor:"#F66"};LinePainter.prototype.draw=3Dfunction(ctx,width,height,w_scale)= {var in_path=3Dfalse,min_value=3Dthis.prefs.min_value,max_value=3Dthis.pref= s.max_value,vertical_range=3Dmax_value-min_value,height_px=3Dheight,view_st= art=3Dthis.view_start,mode=3Dthis.mode,data=3Dthis.data;ctx.save();var y_ze= ro=3DMath.round(height+min_value/vertical_range*height);if(mode!=3D=3D"Inte= nsity"){ctx.fillStyle=3D"#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath= ();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=3DMath.ceil((data= [1][0]-data[0][0])*w_scale)}else{delta_x_px=3D10}var pref_color=3DparseInt(= this.prefs.color.slice(1),16),pref_r=3D(pref_color&16711680)>>16,pref_g=3D(= pref_color&65280)>>8,pref_b=3Dpref_color&255;for(var i=3D0,len=3Ddata.lengt= h;i<len;i++){ctx.fillStyle=3Dctx.strokeStyle=3Dthis.prefs.color;x_scaled=3D= Math.round((data[i][0]-view_start-1)*w_scale);y=3Ddata[i][1];var top_overfl= ow=3Dfalse,bot_overflow=3Dfalse;if(y=3D=3D=3Dnull){if(in_path&&mode=3D=3D= =3D"Filled"){ctx.lineTo(x_scaled,height_px)}in_path=3Dfalse;continue}if(y<m= in_value){bot_overflow=3Dtrue;y=3Dmin_value}else{if(y>max_value){top_overfl= ow=3Dtrue;y=3Dmax_value}}if(mode=3D=3D=3D"Histogram"){y=3DMath.round(y/vert= ical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(m= ode=3D=3D=3D"Intensity"){var saturation=3D(y-min_value)/vertical_range,new_= r=3DMath.round(pref_r+(255-pref_r)*(1-saturation)),new_g=3DMath.round(pref_= g+(255-pref_g)*(1-saturation)),new_b=3DMath.round(pref_b+(255-pref_b)*(1-sa= turation));ctx.fillStyle=3D"rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRec= t(x_scaled,0,delta_x_px,height_px)}else{y=3DMath.round(height_px-(y-min_val= ue)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_pa= th=3Dtrue;if(mode=3D=3D=3D"Filled"){ctx.moveTo(x_scaled,height_px);ctx.line= To(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=3Dthis.prefs.ov= erflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode=3D=3D=3D= "Histogram"||mode=3D=3D=3D"Intensity"){overflow_x=3Ddelta_x_px}else{x_scale= d-=3D2;overflow_x=3D4}if(top_overflow){ctx.fillRect(x_scaled,0,overflow_x,3= )}if(bot_overflow){ctx.fillRect(x_scaled,height_px-3,overflow_x,3)}}ctx.fil= lStyle=3Dthis.prefs.color}if(mode=3D=3D=3D"Filled"){if(in_path){ctx.lineTo(= x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.rest= ore()};var FeaturePositionMapper=3Dfunction(slot_height){this.feature_posit= ions=3D{};this.slot_height=3Dslot_height;this.translation=3D0;this.y_transl= ation=3D0};FeaturePositionMapper.prototype.map_feature_data=3Dfunction(feat= ure_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature= _positions[slot]=3D[]}this.feature_positions[slot].push({data:feature_data,= x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_= data=3Dfunction(x,y){var slot=3DMath.floor((y-this.y_translation)/this.slot= _height),feature_dict;if(!this.feature_positions[slot]){return null}x+=3Dth= is.translation;for(var i=3D0;i<this.feature_positions[slot].length;i++){fea= ture_dict=3Dthis.feature_positions[slot][i];if(x>=3Dfeature_dict.x_start&&x= <=3Dfeature_dict.x_end){return feature_dict.data}}};var FeaturePainter=3Dfu= nction(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Pain= ter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=3D(alp= ha_scaler?alpha_scaler:new Scaler());this.height_scaler=3D(height_scaler?he= ight_scaler:new Scaler())};FeaturePainter.prototype.default_prefs=3D{block_= color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_r= equired_height:function(rows_required,width){var required_height=3Dthis.get= _row_height(),y_scale=3Drequired_height,mode=3Dthis.mode;if(mode=3D=3D=3D"n= o_detail"||mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Pack"){required_height=3Dro= ws_required*y_scale}return required_height+this.get_top_padding(width)+this= .get_bottom_padding(width)},get_top_padding:function(width){return 0},get_b= ottom_padding:function(width){return Math.max(Math.round(this.get_row_heigh= t()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=3Dthis.da= ta,view_start=3Dthis.view_start,view_end=3Dthis.view_end;ctx.save();ctx.fil= lStyle=3Dthis.prefs.block_color;ctx.textAlign=3D"right";var y_scale=3Dthis.= get_row_height(),feature_mapper=3Dnew FeaturePositionMapper(y_scale),x_draw= _coords;for(var i=3D0,len=3Ddata.length;i<len;i++){var feature=3Ddata[i],fe= ature_uid=3Dfeature[0],feature_start=3Dfeature[1],feature_end=3Dfeature[2],= slot=3D(slots&&slots[feature_uid]!=3D=3Dundefined?slots[feature_uid]:null);= if((feature_start<view_end&&feature_end>view_start)&&(this.mode=3D=3D=3D"De= nse"||slot!=3D=3Dnull)){x_draw_coords=3Dthis.draw_element(ctx,this.mode,fea= ture,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_fea= ture_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();fe= ature_mapper.y_translation=3Dthis.get_top_padding(width);return feature_map= per},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale= ,y_scale,width){console.log("WARNING: Unimplemented function.");return[0,0]= }});var DENSE_TRACK_HEIGHT=3D10,NO_DETAIL_TRACK_HEIGHT=3D3,SQUISH_TRACK_HEI= GHT=3D5,PACK_TRACK_HEIGHT=3D10,NO_DETAIL_FEATURE_HEIGHT=3D1,DENSE_FEATURE_H= EIGHT=3D9,SQUISH_FEATURE_HEIGHT=3D3,PACK_FEATURE_HEIGHT=3D9,LABEL_SPACING= =3D2,CONNECTOR_COLOR=3D"#ccc";var LinkedFeaturePainter=3Dfunction(data,view= _start,view_end,prefs,mode,alpha_scaler,height_scaler){FeaturePainter.call(= this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.d= raw_background_connector=3Dtrue;this.draw_individual_connectors=3Dfalse};ex= tend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_heigh= t:function(){var mode=3Dthis.mode,height;if(mode=3D=3D=3D"Dense"){height=3D= DENSE_TRACK_HEIGHT}else{if(mode=3D=3D=3D"no_detail"){height=3DNO_DETAIL_TRA= CK_HEIGHT}else{if(mode=3D=3D=3D"Squish"){height=3DSQUISH_TRACK_HEIGHT}else{= height=3DPACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,= feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=3Dfe= ature[0],feature_start=3Dfeature[1],feature_end=3Dfeature[2]-1,feature_name= =3Dfeature[3],feature_strand=3Dfeature[4],f_start=3DMath.floor(Math.max(0,(= feature_start-tile_low)*w_scale)),f_end=3DMath.ceil(Math.min(width,Math.max= (0,(feature_end-tile_low)*w_scale))),draw_start=3Df_start,draw_end=3Df_end,= y_center=3D(mode=3D=3D=3D"Dense"?0:(0+slot))*y_scale+this.get_top_padding(w= idth),thickness,y_start,thick_start=3Dnull,thick_end=3Dnull,block_color=3D(= !feature_strand||feature_strand=3D=3D=3D"+"||feature_strand=3D=3D=3D"."?thi= s.prefs.block_color:this.prefs.reverse_strand_color);label_color=3Dthis.pre= fs.label_color;ctx.globalAlpha=3Dthis.alpha_scaler.gen_val(feature);if(mode= =3D=3D=3D"Dense"){slot=3D1}if(mode=3D=3D=3D"no_detail"){ctx.fillStyle=3Dblo= ck_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HE= IGHT)}else{var feature_ts=3Dfeature[5],feature_te=3Dfeature[6],feature_bloc= ks=3Dfeature[7],full_height=3Dtrue;if(feature_ts&&feature_te){thick_start= =3DMath.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=3DMath.c= eil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_hei= ght,thick_height;if(mode=3D=3D=3D"Squish"){thin_height=3D1;thick_height=3DS= QUISH_FEATURE_HEIGHT;full_height=3Dfalse}else{if(mode=3D=3D=3D"Dense"){thin= _height=3D5;thick_height=3DDENSE_FEATURE_HEIGHT}else{thin_height=3D5;thick_= height=3DPACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=3Dblock_col= or;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_s= trand&&full_height){if(feature_strand=3D=3D=3D"+"){ctx.fillStyle=3Dctx.canv= as.manager.get_pattern("right_strand_inv")}else{if(feature_strand=3D=3D=3D"= -"){ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.= fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_cen= ter,cur_height;if(mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Dense"){cur_y_center= =3Dy_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=3D1}else{if(fe= ature_strand){cur_y_center=3Dy_center;cur_height=3Dthick_height}else{cur_y_= center+=3D(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=3D1}}if(this.draw_backgrou= nd_connector){if(mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Dense"){ctx.fillStyle= =3DCONNECTOR_COLOR}else{if(feature_strand){if(feature_strand=3D=3D=3D"+"){c= tx.fillStyle=3Dctx.canvas.manager.get_pattern("right_strand")}else{if(featu= re_strand=3D=3D=3D"-"){ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left= _strand")}}}else{ctx.fillStyle=3DCONNECTOR_COLOR}}ctx.fillRect(f_start,cur_= y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=3D0,k_len= =3Dfeature_blocks.length;k<k_len;k++){var block=3Dfeature_blocks[k],block_s= tart=3DMath.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=3DMath= .ceil(Math.min(width,Math.max((block[1]-1-tile_low)*w_scale))),last_block_s= tart,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=3Dbloc= k_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,bl= ock_end-block_start,thin_height);if(thick_start!=3D=3Dundefined&&feature_te= this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_e= nd,y_center)}last_block_start=3Dblock_start;last_block_end=3Dblock_end}if(m= ode=3D=3D=3D"Pack"){ctx.globalAlpha=3D1;ctx.fillStyle=3D"white";var hscale_= factor=3Dthis.height_scaler.gen_val(feature),new_height=3DMath.ceil(thick_h= eight*hscale_factor),ws_height=3DMath.round((thick_height-new_height)/2);if= (hscale_factor!=3D=3D1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,w= s_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-= f_start,ws_height)}}}ctx.globalAlpha=3D1;if(feature_name&&mode=3D=3D=3D"Pac= k"&&feature_start>tile_low){ctx.fillStyle=3Dlabel_color;if(tile_low=3D=3D= =3D0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign=3D"left"= ;ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=3Dctx.= measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign=3D"right";= ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=3Dc= tx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=3D1;retu= rn[draw_start,draw_end]}});var ReadPainter=3Dfunction(data,view_start,view_= end,prefs,mode,alpha_scaler,height_scaler,ref_seq){FeaturePainter.call(this= ,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.ref_s= eq=3D(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePaint= er.prototype,{get_row_height:function(){var height,mode=3Dthis.mode;if(mode= =3D=3D=3D"Dense"){height=3DDENSE_TRACK_HEIGHT}else{if(mode=3D=3D=3D"Squish"= ){height=3DSQUISH_TRACK_HEIGHT}else{height=3DPACK_TRACK_HEIGHT;if(this.pref= s.show_insertions){height*=3D2}}}return height},draw_read:function(ctx,mode= ,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,ref_seq){ct= x.textAlign=3D"center";var tile_region=3D[tile_low,tile_high],base_offset= =3D0,seq_offset=3D0,gap=3D0,char_width_px=3Dctx.canvas.manager.char_width_p= x,block_color=3D(strand=3D=3D=3D"+"?this.prefs.block_color:this.prefs.rever= se_strand_color);var draw_last=3D[];if((mode=3D=3D=3D"Pack"||this.mode=3D= =3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w_scale>char_width_px){gap=3DMath.r= ound(w_scale/2)}if(!cigar){cigar=3D[[0,ref_seq.length]]}for(var cig_id=3D0,= len=3Dcigar.length;cig_id<len;cig_id++){var cig=3Dcigar[cig_id],cig_op=3D"M= IDNSHP=3DX"[cig[0]],cig_len=3Dcig[1];if(cig_op=3D=3D=3D"H"||cig_op=3D=3D=3D= "S"){base_offset-=3Dcig_len}var seq_start=3D(feature_start-1)+base_offset,s= _start=3DMath.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=3DMath.= floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start=3D=3D=3D= s_end){s_end+=3D1}switch(cig_op){case"H":break;case"S":case"M":case"=3D":if= (is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=3Dref_seq.s= lice(seq_offset-1,seq_offset+cig_len);if(gap>0){ctx.fillStyle=3Dblock_color= ;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=3DCONNE= CTOR_COLOR;for(var c=3D0,str_len=3Dseq.length;c<str_len;c++){if(this.prefs.= show_differences){if(this.ref_seq){var ref_char=3Dthis.ref_seq[seq_start-ti= le_low+c];if(!ref_char||ref_char.toLowerCase()=3D=3D=3Dseq[c].toLowerCase()= ){continue}}else{continue}}if(seq_start+c>=3Dtile_low&&seq_start+c<=3Dtile_= high){var c_start=3DMath.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));= ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=3Dblock_color;= ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_o= ffset+=3Dcig_len;base_offset+=3Dcig_len;break;case"N":ctx.fillStyle=3DCONNE= CTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset= +=3Dcig_len;break;case"D":ctx.fillStyle=3D"red";ctx.fillRect(s_start-gap,y_= center+4,s_end-s_start,3);base_offset+=3Dcig_len;break;case"P":break;case"I= ":var insert_x_coord=3Ds_start-gap;if(is_overlap([seq_start,seq_start+cig_l= en],tile_region)){var seq=3Dref_seq.slice(seq_offset-1,seq_offset+cig_len);= if(this.prefs.show_insertions){var x_center=3Ds_start-(s_end-s_start)/2;if(= (mode=3D=3D=3D"Pack"||this.mode=3D=3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w= _scale>char_width_px){ctx.fillStyle=3D"yellow";ctx.fillRect(x_center-gap,y_= center-9,s_end-s_start,9);draw_last[draw_last.length]=3D{type:"triangle",da= ta:[insert_x_coord,y_center+4,5]};ctx.fillStyle=3DCONNECTOR_COLOR;switch(co= mpute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_STA= RT):seq=3Dseq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=3Dseq.= slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS= ):seq=3Dseq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c= =3D0,str_len=3Dseq.length;c<str_len;c++){var c_start=3DMath.floor(Math.max(= 0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_sta= rt)/2,y_center)}}else{ctx.fillStyle=3D"yellow";ctx.fillRect(x_center,y_cent= er+(this.mode!=3D=3D"Dense"?2:5),s_end-s_start,(mode!=3D=3D"Dense"?SQUISH_F= EATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode=3D=3D=3D"Pack"||this.mo= de=3D=3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w_scale>char_width_px){draw_la= st.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}= seq_offset+=3Dcig_len;break;case"X":seq_offset+=3Dcig_len;break}}ctx.fillSt= yle=3D"yellow";var item,type,data;for(var i=3D0;i<draw_last.length;i++){ite= m=3Ddraw_last[i];type=3Ditem.type;data=3Ditem.data;if(type=3D=3D=3D"text"){= ctx.save();ctx.font=3D"bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]= );ctx.restore()}else{if(type=3D=3D=3D"triangle"){drawDownwardEquilateralTri= angle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,featu= re,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=3Dfeature= [0],feature_start=3Dfeature[1],feature_end=3Dfeature[2],feature_name=3Dfeat= ure[3],f_start=3DMath.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f= _end=3DMath.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))= ),y_center=3D(mode=3D=3D=3D"Dense"?0:(0+slot))*y_scale,label_color=3Dthis.p= refs.label_color,gap=3D0;if((mode=3D=3D=3D"Pack"||this.mode=3D=3D=3D"Auto")= &&w_scale>ctx.canvas.manager.char_width_px){var gap=3DMath.round(w_scale/2)= }if(feature[5] instanceof Array){var b1_start=3DMath.floor(Math.max(0,(feat= ure[4][0]-tile_low)*w_scale)),b1_end=3DMath.ceil(Math.min(width,Math.max(0,= (feature[4][1]-tile_low)*w_scale))),b2_start=3DMath.floor(Math.max(0,(featu= re[5][0]-tile_low)*w_scale)),b2_end=3DMath.ceil(Math.min(width,Math.max(0,(= feature[5][1]-tile_low)*w_scale))),connector=3Dtrue;if(feature[4][1]>=3Dtil= e_low&&feature[4][0]<=3Dtile_high&&feature[4][2]){this.draw_read(ctx,mode,w= _scale,y_center,tile_low,tile_high,feature[4][0],feature[4][2],feature[4][3= ],feature[4][4])}else{connector=3Dfalse}if(feature[5][1]>=3Dtile_low&&featu= re[5][0]<=3Dtile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_cen= ter,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5]= [4])}else{connector=3Dfalse}if(connector&&b2_start>b1_end){ctx.fillStyle=3D= CONNECTOR_COLOR;dashedLine(ctx,b1_end-gap,y_center+5,b2_start-gap,y_center+= 5)}}else{this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,featur= e_start,feature[4],feature[5],feature[6])}if(mode=3D=3D=3D"Pack"&&feature_s= tart>tile_low&&feature_name!=3D=3D"."){ctx.fillStyle=3Dthis.prefs.label_col= or;var tile_index=3D1;if(tile_index=3D=3D=3D0&&f_start-ctx.measureText(feat= ure_name).width<0){ctx.textAlign=3D"left";ctx.fillText(feature_name,f_end+L= ABEL_SPACING-gap,y_center+8)}else{ctx.textAlign=3D"right";ctx.fillText(feat= ure_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinke= dFeaturePainter=3Dfunction(data,view_start,view_end,prefs,mode,alpha_scaler= ,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,pre= fs,mode,alpha_scaler,height_scaler);this.longest_feature_length=3Dthis.calc= ulate_longest_feature_length();this.draw_background_connector=3Dfalse;this.= draw_individual_connectors=3Dtrue};extend(ArcLinkedFeaturePainter.prototype= ,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest= _feature_length:function(){var longest_feature_length=3D0;for(var i=3D0,len= =3Dthis.data.length;i<len;i++){var feature=3Dthis.data[i],feature_start=3Df= eature[1],feature_end=3Dfeature[2];longest_feature_length=3DMath.max(longes= t_feature_length,feature_end-feature_start)}return longest_feature_length},= get_top_padding:function(width){var view_range=3Dthis.view_end-this.view_st= art,w_scale=3Dwidth/view_range;return Math.min(128,Math.ceil((this.longest_= feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block= 1_end,block2_start,block2_end,y_center){var x_center=3D(block1_end+block2_s= tart)/2,radius=3Dblock2_start-x_center;var angle1=3DMath.PI,angle2=3D0;if(r= adius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Ma= th.PI,0);ctx.stroke()}}});var Color=3Dfunction(rgb,a){if(Array.isArray(rgb)= ){this.rgb=3Drgb}else{if(rgb.length=3D=3D6){this.rgb=3Drgb.match(/.{2}/g).m= ap(function(c){return parseInt(c,16)})}else{this.rgb=3Drgb.split("").map(fu= nction(c){return parseInt(c+c,16)})}}this.alpha=3Dtypeof(a)=3D=3D=3D"number= "?a:1};Color.prototype=3D{eval:function(){return this},toCSS:function(){if(= this.alpha<1){return"rgba("+this.rgb.map(function(c){return Math.round(c)})= .concat(this.alpha).join(", ")+")"}else{return"#"+this.rgb.map(function(i){= i=3DMath.round(i);i=3D(i>255?255:(i<0?0:i)).toString(16);return i.length=3D= =3D=3D1?"0"+i:i}).join("")}},toHSL:function(){var r=3Dthis.rgb[0]/255,g=3Dt= his.rgb[1]/255,b=3Dthis.rgb[2]/255,a=3Dthis.alpha;var max=3DMath.max(r,g,b)= ,min=3DMath.min(r,g,b);var h,s,l=3D(max+min)/2,d=3Dmax-min;if(max=3D=3D=3Dm= in){h=3Ds=3D0}else{s=3Dl>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h= =3D(g-b)/d+(g<b?6:0);break;case g:h=3D(b-r)/d+2;break;case b:h=3D(r-g)/d+4;= break}h/=3D6}return{h:h*360,s:s,l:l,a:a}},toARGB:function(){var argb=3D[Mat= h.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i= =3DMath.round(i);i=3D(i>255?255:(i<0?0:i)).toString(16);return i.length=3D= =3D=3D1?"0"+i:i}).join("")},mix:function(color2,weight){color1=3Dthis;var p= =3Dweight;var w=3Dp*2-1;var a=3Dcolor1.toHSL().a-color2.toHSL().a;var w1=3D= (((w*a=3D=3D-1)?w:(w+a)/(1+w*a))+1)/2;var w2=3D1-w1;var rgb=3D[color1.rgb[0= ]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+co= lor2.rgb[2]*w2];var alpha=3Dcolor1.alpha*p+color2.alpha*(1-p);return new Co= lor(rgb,alpha)}};var LinearRamp=3Dfunction(start_color,end_color,start_valu= e,end_value){this.start_color=3Dnew Color(start_color);this.end_color=3Dnew= Color(end_color);this.start_value=3Dstart_value;this.end_value=3Dend_value= ;this.value_range=3Dend_value-start_value};LinearRamp.prototype.map_value= =3Dfunction(value){value=3DMath.max(value,this.start_value);value=3DMath.mi= n(value,this.end_value);value=3D(value-this.start_value)/this.value_range;r= eturn this.start_color.mix(this.end_color,1-value).toCSS()};var SplitRamp= =3Dfunction(start_color,middle_color,end_color,start_value,end_value){this.= positive_ramp=3Dnew LinearRamp(middle_color,end_color,0,end_value);this.neg= ative_ramp=3Dnew LinearRamp(middle_color,start_color,0,-start_value);this.s= tart_value=3Dstart_value;this.end_value=3Dend_value};SplitRamp.prototype.ma= p_value=3Dfunction(value){value=3DMath.max(value,this.start_value);value=3D= Math.min(value,this.end_value);if(value>=3D0){return this.positive_ramp.map= _value(value)}else{return this.negative_ramp.map_value(-value)}};var Diagon= alHeatmapPainter=3Dfunction(data,view_start,view_end,prefs,mode){Painter.ca= ll(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_va= lue=3D=3D=3Dundefined){var min_value=3DInfinity;for(i=3D0,len=3Dthis.data.l= ength;i<len;i++){min_value=3DMath.min(min_value,this.data[i][5])}this.prefs= .min_value=3Dmin_value}if(this.prefs.max_value=3D=3D=3Dundefined){var max_v= alue=3D-Infinity;for(i=3D0,len=3Dthis.data.length;i<len;i++){max_value=3DMa= th.max(max_value,this.data[i][5])}this.prefs.max_value=3Dmax_value}};Diagon= alHeatmapPainter.prototype.default_prefs=3D{min_value:undefined,max_value:u= ndefined,mode:"Heatmap",pos_color:"#FF8C00",neg_color:"#4169E1"};DiagonalHe= atmapPainter.prototype.draw=3Dfunction(ctx,width,height,w_scale){var min_va= lue=3Dthis.prefs.min_value,max_value=3Dthis.prefs.max_value,value_range=3Dm= ax_value-min_value,height_px=3Dheight,view_start=3Dthis.view_start,mode=3Dt= his.mode,data=3Dthis.data,invsqrt2=3D1/Math.sqrt(2);var ramp=3D(new SplitRa= mp(this.prefs.neg_color,"FFFFFF",this.prefs.pos_color,min_value,max_value))= ;var d,s1,e1,s2,e2,value;var scale=3Dfunction(p){return(p-view_start)*w_sca= le};ctx.save();ctx.rotate(-45*Math.PI/180);ctx.scale(invsqrt2,invsqrt2);for= (var i=3D0,len=3Ddata.length;i<len;i++){d=3Ddata[i];s1=3Dscale(d[1]);e1=3Ds= cale(d[2]);s2=3Dscale(d[4]);e2=3Dscale(d[5]);value=3Dd[6];ctx.fillStyle=3D(= ramp.map_value(value));ctx.fillRect(s1,s2,(e1-s1),(e2-s2))}ctx.restore()};r= eturn{Scaler:Scaler,SummaryTreePainter:SummaryTreePainter,LinePainter:LineP= ainter,LinkedFeaturePainter:LinkedFeaturePainter,ReadPainter:ReadPainter,Ar= cLinkedFeaturePainter:ArcLinkedFeaturePainter,DiagonalHeatmapPainter:Diagon= alHeatmapPainter}}); \ No newline at end of file +define(["libs/underscore"],function(_){var extend=3D_.extend;var BEFORE=3D= 1001,CONTAINS=3D1002,OVERLAP_START=3D1003,OVERLAP_END=3D1004,CONTAINED_BY= =3D1005,AFTER=3D1006;var compute_overlap=3Dfunction(first_region,second_reg= ion){var first_start=3Dfirst_region[0],first_end=3Dfirst_region[1],second_s= tart=3Dsecond_region[0],second_end=3Dsecond_region[1],overlap;if(first_star= t<second_start){if(first_end<second_start){overlap=3DBEFORE}else{if(first_e= nd<=3Dsecond_end){overlap=3DOVERLAP_START}else{overlap=3DCONTAINS}}}else{if= (first_start>second_end){overlap=3DAFTER}else{if(first_end<=3Dsecond_end){o= verlap=3DCONTAINED_BY}else{overlap=3DOVERLAP_END}}}return overlap};var is_o= verlap=3Dfunction(first_region,second_region){var overlap=3Dcompute_overlap= (first_region,second_region);return(overlap!=3D=3DBEFORE&&overlap!=3D=3DAFT= ER)};var dashedLine=3Dfunction(ctx,x1,y1,x2,y2,dashLen){if(dashLen=3D=3D=3D= undefined){dashLen=3D4}var dX=3Dx2-x1;var dY=3Dy2-y1;var dashes=3DMath.floo= r(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=3DdX/dashes;var dashY=3DdY/dash= es;var q;for(q=3D0;q<dashes;q++,x1+=3DdashX,y1+=3DdashY){if(q%2!=3D=3D0){co= ntinue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle= =3Dfunction(ctx,down_vertex_x,down_vertex_y,side_len){var x1=3Ddown_vertex_= x-side_len/2,x2=3Ddown_vertex_x+side_len/2,y=3Ddown_vertex_y-Math.sqrt(side= _len*3/2);ctx.beginPath();ctx.moveTo(x1,y);ctx.lineTo(x2,y);ctx.lineTo(down= _vertex_x,down_vertex_y);ctx.lineTo(x1,y);ctx.strokeStyle=3Dthis.fillStyle;= ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=3Dfunction(default_val)= {this.default_val=3D(default_val?default_val:1)};Scaler.prototype.gen_val= =3Dfunction(input){return this.default_val};var Painter=3Dfunction(data,vie= w_start,view_end,prefs,mode){this.data=3Ddata;this.view_start=3Dview_start;= this.view_end=3Dview_end;this.prefs=3Dextend({},this.default_prefs,prefs);t= his.mode=3Dmode};Painter.prototype.default_prefs=3D{};Painter.prototype.dra= w=3Dfunction(ctx,width,height,w_scale){};var SummaryTreePainter=3Dfunction(= data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view= _end,prefs,mode)};SummaryTreePainter.prototype.default_prefs=3D{show_counts= :false};SummaryTreePainter.prototype.draw=3Dfunction(ctx,width,height,w_sca= le){var view_start=3Dthis.view_start,points=3Dthis.data.data,max=3D(this.pr= efs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=3Dheight;d= elta_x_px=3DMath.ceil(this.data.delta*w_scale);ctx.save();for(var i=3D0,len= =3Dpoints.length;i<len;i++){var x=3DMath.floor((points[i][0]-view_start)*w_= scale);var y=3Dpoints[i][1];if(!y){continue}var y_px=3Dy/max*height;if(y!= =3D=3D0&&y_px<1){y_px=3D1}ctx.fillStyle=3Dthis.prefs.block_color;ctx.fillRe= ct(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=3D4;if(this.prefs.= show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.= fillStyle=3Dthis.prefs.label_color;ctx.textAlign=3D"center";ctx.fillText(y,= x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=3Dfunction(data,view_s= tart,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,= mode);var i,len;if(this.prefs.min_value=3D=3D=3Dundefined){var min_value=3D= Infinity;for(i=3D0,len=3Dthis.data.length;i<len;i++){min_value=3DMath.min(m= in_value,this.data[i][1])}this.prefs.min_value=3Dmin_value}if(this.prefs.ma= x_value=3D=3D=3Dundefined){var max_value=3D-Infinity;for(i=3D0,len=3Dthis.d= ata.length;i<len;i++){max_value=3DMath.max(max_value,this.data[i][1])}this.= prefs.max_value=3Dmax_value}};LinePainter.prototype.default_prefs=3D{min_va= lue:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_co= lor:"#F66"};LinePainter.prototype.draw=3Dfunction(ctx,width,height,w_scale)= {var in_path=3Dfalse,min_value=3Dthis.prefs.min_value,max_value=3Dthis.pref= s.max_value,vertical_range=3Dmax_value-min_value,height_px=3Dheight,view_st= art=3Dthis.view_start,mode=3Dthis.mode,data=3Dthis.data;ctx.save();var y_ze= ro=3DMath.round(height+min_value/vertical_range*height);if(mode!=3D=3D"Inte= nsity"){ctx.fillStyle=3D"#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath= ();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=3DMath.ceil((data= [1][0]-data[0][0])*w_scale)}else{delta_x_px=3D10}var pref_color=3DparseInt(= this.prefs.color.slice(1),16),pref_r=3D(pref_color&16711680)>>16,pref_g=3D(= pref_color&65280)>>8,pref_b=3Dpref_color&255;for(var i=3D0,len=3Ddata.lengt= h;i<len;i++){ctx.fillStyle=3Dctx.strokeStyle=3Dthis.prefs.color;x_scaled=3D= Math.round((data[i][0]-view_start-1)*w_scale);y=3Ddata[i][1];var top_overfl= ow=3Dfalse,bot_overflow=3Dfalse;if(y=3D=3D=3Dnull){if(in_path&&mode=3D=3D= =3D"Filled"){ctx.lineTo(x_scaled,height_px)}in_path=3Dfalse;continue}if(y<m= in_value){bot_overflow=3Dtrue;y=3Dmin_value}else{if(y>max_value){top_overfl= ow=3Dtrue;y=3Dmax_value}}if(mode=3D=3D=3D"Histogram"){y=3DMath.round(y/vert= ical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(m= ode=3D=3D=3D"Intensity"){var saturation=3D(y-min_value)/vertical_range,new_= r=3DMath.round(pref_r+(255-pref_r)*(1-saturation)),new_g=3DMath.round(pref_= g+(255-pref_g)*(1-saturation)),new_b=3DMath.round(pref_b+(255-pref_b)*(1-sa= turation));ctx.fillStyle=3D"rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRec= t(x_scaled,0,delta_x_px,height_px)}else{y=3DMath.round(height_px-(y-min_val= ue)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_pa= th=3Dtrue;if(mode=3D=3D=3D"Filled"){ctx.moveTo(x_scaled,height_px);ctx.line= To(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=3Dthis.prefs.ov= erflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode=3D=3D=3D= "Histogram"||mode=3D=3D=3D"Intensity"){overflow_x=3Ddelta_x_px}else{x_scale= d-=3D2;overflow_x=3D4}if(top_overflow){ctx.fillRect(x_scaled,0,overflow_x,3= )}if(bot_overflow){ctx.fillRect(x_scaled,height_px-3,overflow_x,3)}}ctx.fil= lStyle=3Dthis.prefs.color}if(mode=3D=3D=3D"Filled"){if(in_path){ctx.lineTo(= x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.rest= ore()};var FeaturePositionMapper=3Dfunction(slot_height){this.feature_posit= ions=3D{};this.slot_height=3Dslot_height;this.translation=3D0;this.y_transl= ation=3D0};FeaturePositionMapper.prototype.map_feature_data=3Dfunction(feat= ure_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature= _positions[slot]=3D[]}this.feature_positions[slot].push({data:feature_data,= x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_= data=3Dfunction(x,y){var slot=3DMath.floor((y-this.y_translation)/this.slot= _height),feature_dict;if(!this.feature_positions[slot]){return null}x+=3Dth= is.translation;for(var i=3D0;i<this.feature_positions[slot].length;i++){fea= ture_dict=3Dthis.feature_positions[slot][i];if(x>=3Dfeature_dict.x_start&&x= <=3Dfeature_dict.x_end){return feature_dict.data}}};var FeaturePainter=3Dfu= nction(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Pain= ter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=3D(alp= ha_scaler?alpha_scaler:new Scaler());this.height_scaler=3D(height_scaler?he= ight_scaler:new Scaler())};FeaturePainter.prototype.default_prefs=3D{block_= color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_r= equired_height:function(rows_required,width){var required_height=3Dthis.get= _row_height(),y_scale=3Drequired_height,mode=3Dthis.mode;if(mode=3D=3D=3D"n= o_detail"||mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Pack"){required_height=3Dro= ws_required*y_scale}return required_height+this.get_top_padding(width)+this= .get_bottom_padding(width)},get_top_padding:function(width){return 0},get_b= ottom_padding:function(width){return Math.max(Math.round(this.get_row_heigh= t()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=3Dthis.da= ta,view_start=3Dthis.view_start,view_end=3Dthis.view_end;ctx.save();ctx.fil= lStyle=3Dthis.prefs.block_color;ctx.textAlign=3D"right";var y_scale=3Dthis.= get_row_height(),feature_mapper=3Dnew FeaturePositionMapper(y_scale),x_draw= _coords;for(var i=3D0,len=3Ddata.length;i<len;i++){var feature=3Ddata[i],fe= ature_uid=3Dfeature[0],feature_start=3Dfeature[1],feature_end=3Dfeature[2],= slot=3D(slots&&slots[feature_uid]!=3D=3Dundefined?slots[feature_uid]:null);= if((feature_start<view_end&&feature_end>view_start)&&(this.mode=3D=3D=3D"De= nse"||slot!=3D=3Dnull)){x_draw_coords=3Dthis.draw_element(ctx,this.mode,fea= ture,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_fea= ture_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();fe= ature_mapper.y_translation=3Dthis.get_top_padding(width);return feature_map= per},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale= ,y_scale,width){console.log("WARNING: Unimplemented function.");return[0,0]= }});var DENSE_TRACK_HEIGHT=3D10,NO_DETAIL_TRACK_HEIGHT=3D3,SQUISH_TRACK_HEI= GHT=3D5,PACK_TRACK_HEIGHT=3D10,NO_DETAIL_FEATURE_HEIGHT=3D1,DENSE_FEATURE_H= EIGHT=3D9,SQUISH_FEATURE_HEIGHT=3D3,PACK_FEATURE_HEIGHT=3D9,LABEL_SPACING= =3D2,CONNECTOR_COLOR=3D"#ccc";var LinkedFeaturePainter=3Dfunction(data,view= _start,view_end,prefs,mode,alpha_scaler,height_scaler){FeaturePainter.call(= this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.d= raw_background_connector=3Dtrue;this.draw_individual_connectors=3Dfalse};ex= tend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_heigh= t:function(){var mode=3Dthis.mode,height;if(mode=3D=3D=3D"Dense"){height=3D= DENSE_TRACK_HEIGHT}else{if(mode=3D=3D=3D"no_detail"){height=3DNO_DETAIL_TRA= CK_HEIGHT}else{if(mode=3D=3D=3D"Squish"){height=3DSQUISH_TRACK_HEIGHT}else{= height=3DPACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,= feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=3Dfe= ature[0],feature_start=3Dfeature[1],feature_end=3Dfeature[2]-1,feature_name= =3Dfeature[3],feature_strand=3Dfeature[4],f_start=3DMath.floor(Math.max(0,(= feature_start-tile_low)*w_scale)),f_end=3DMath.ceil(Math.min(width,Math.max= (0,(feature_end-tile_low)*w_scale))),draw_start=3Df_start,draw_end=3Df_end,= y_center=3D(mode=3D=3D=3D"Dense"?0:(0+slot))*y_scale+this.get_top_padding(w= idth),thickness,y_start,thick_start=3Dnull,thick_end=3Dnull,block_color=3D(= !feature_strand||feature_strand=3D=3D=3D"+"||feature_strand=3D=3D=3D"."?thi= s.prefs.block_color:this.prefs.reverse_strand_color);label_color=3Dthis.pre= fs.label_color;ctx.globalAlpha=3Dthis.alpha_scaler.gen_val(feature);if(mode= =3D=3D=3D"Dense"){slot=3D1}if(mode=3D=3D=3D"no_detail"){ctx.fillStyle=3Dblo= ck_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HE= IGHT)}else{var feature_ts=3Dfeature[5],feature_te=3Dfeature[6],feature_bloc= ks=3Dfeature[7],full_height=3Dtrue;if(feature_ts&&feature_te){thick_start= =3DMath.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=3DMath.c= eil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_hei= ght,thick_height;if(mode=3D=3D=3D"Squish"){thin_height=3D1;thick_height=3DS= QUISH_FEATURE_HEIGHT;full_height=3Dfalse}else{if(mode=3D=3D=3D"Dense"){thin= _height=3D5;thick_height=3DDENSE_FEATURE_HEIGHT}else{thin_height=3D5;thick_= height=3DPACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=3Dblock_col= or;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_s= trand&&full_height){if(feature_strand=3D=3D=3D"+"){ctx.fillStyle=3Dctx.canv= as.manager.get_pattern("right_strand_inv")}else{if(feature_strand=3D=3D=3D"= -"){ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.= fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_cen= ter,cur_height;if(mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Dense"){cur_y_center= =3Dy_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=3D1}else{if(fe= ature_strand){cur_y_center=3Dy_center;cur_height=3Dthick_height}else{cur_y_= center+=3D(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=3D1}}if(this.draw_backgrou= nd_connector){if(mode=3D=3D=3D"Squish"||mode=3D=3D=3D"Dense"){ctx.fillStyle= =3DCONNECTOR_COLOR}else{if(feature_strand){if(feature_strand=3D=3D=3D"+"){c= tx.fillStyle=3Dctx.canvas.manager.get_pattern("right_strand")}else{if(featu= re_strand=3D=3D=3D"-"){ctx.fillStyle=3Dctx.canvas.manager.get_pattern("left= _strand")}}}else{ctx.fillStyle=3DCONNECTOR_COLOR}}ctx.fillRect(f_start,cur_= y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=3D0,k_len= =3Dfeature_blocks.length;k<k_len;k++){var block=3Dfeature_blocks[k],block_s= tart=3DMath.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=3DMath= .ceil(Math.min(width,Math.max((block[1]-1-tile_low)*w_scale))),last_block_s= tart,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=3Dbloc= k_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,bl= ock_end-block_start,thin_height);if(thick_start!=3D=3Dundefined&&feature_te= this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_e= nd,y_center)}last_block_start=3Dblock_start;last_block_end=3Dblock_end}if(m= ode=3D=3D=3D"Pack"){ctx.globalAlpha=3D1;ctx.fillStyle=3D"white";var hscale_= factor=3Dthis.height_scaler.gen_val(feature),new_height=3DMath.ceil(thick_h= eight*hscale_factor),ws_height=3DMath.round((thick_height-new_height)/2);if= (hscale_factor!=3D=3D1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,w= s_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-= f_start,ws_height)}}}ctx.globalAlpha=3D1;if(feature_name&&mode=3D=3D=3D"Pac= k"&&feature_start>tile_low){ctx.fillStyle=3Dlabel_color;if(tile_low=3D=3D= =3D0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign=3D"left"= ;ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=3Dctx.= measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign=3D"right";= ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=3Dc= tx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=3D1;retu= rn[draw_start,draw_end]}});var ReadPainter=3Dfunction(data,view_start,view_= end,prefs,mode,alpha_scaler,height_scaler,ref_seq){FeaturePainter.call(this= ,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.ref_s= eq=3D(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePaint= er.prototype,{get_row_height:function(){var height,mode=3Dthis.mode;if(mode= =3D=3D=3D"Dense"){height=3DDENSE_TRACK_HEIGHT}else{if(mode=3D=3D=3D"Squish"= ){height=3DSQUISH_TRACK_HEIGHT}else{height=3DPACK_TRACK_HEIGHT;if(this.pref= s.show_insertions){height*=3D2}}}return height},draw_read:function(ctx,mode= ,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,ref_seq){ct= x.textAlign=3D"center";var tile_region=3D[tile_low,tile_high],base_offset= =3D0,seq_offset=3D0,gap=3D0,char_width_px=3Dctx.canvas.manager.char_width_p= x,block_color=3D(strand=3D=3D=3D"+"?this.prefs.block_color:this.prefs.rever= se_strand_color);var draw_last=3D[];if((mode=3D=3D=3D"Pack"||this.mode=3D= =3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w_scale>char_width_px){gap=3DMath.r= ound(w_scale/2)}if(!cigar){cigar=3D[[0,ref_seq.length]]}for(var cig_id=3D0,= len=3Dcigar.length;cig_id<len;cig_id++){var cig=3Dcigar[cig_id],cig_op=3D"M= IDNSHP=3DX"[cig[0]],cig_len=3Dcig[1];if(cig_op=3D=3D=3D"H"||cig_op=3D=3D=3D= "S"){base_offset-=3Dcig_len}var seq_start=3D(feature_start-1)+base_offset,s= _start=3DMath.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=3DMath.= floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start=3D=3D=3D= s_end){s_end+=3D1}switch(cig_op){case"H":break;case"S":case"M":case"=3D":if= (is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=3Dref_seq.s= lice(seq_offset-1,seq_offset+cig_len);if(gap>0){ctx.fillStyle=3Dblock_color= ;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=3DCONNE= CTOR_COLOR;for(var c=3D0,str_len=3Dseq.length;c<str_len;c++){if(this.prefs.= show_differences){if(this.ref_seq){var ref_char=3Dthis.ref_seq[seq_start-ti= le_low+c];if(!ref_char||ref_char.toLowerCase()=3D=3D=3Dseq[c].toLowerCase()= ){continue}}else{continue}}if(seq_start+c>=3Dtile_low&&seq_start+c<=3Dtile_= high){var c_start=3DMath.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));= ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=3Dblock_color;= ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_o= ffset+=3Dcig_len;base_offset+=3Dcig_len;break;case"N":ctx.fillStyle=3DCONNE= CTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset= +=3Dcig_len;break;case"D":ctx.fillStyle=3D"red";ctx.fillRect(s_start-gap,y_= center+4,s_end-s_start,3);base_offset+=3Dcig_len;break;case"P":break;case"I= ":var insert_x_coord=3Ds_start-gap;if(is_overlap([seq_start,seq_start+cig_l= en],tile_region)){var seq=3Dref_seq.slice(seq_offset-1,seq_offset+cig_len);= if(this.prefs.show_insertions){var x_center=3Ds_start-(s_end-s_start)/2;if(= (mode=3D=3D=3D"Pack"||this.mode=3D=3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w= _scale>char_width_px){ctx.fillStyle=3D"yellow";ctx.fillRect(x_center-gap,y_= center-9,s_end-s_start,9);draw_last[draw_last.length]=3D{type:"triangle",da= ta:[insert_x_coord,y_center+4,5]};ctx.fillStyle=3DCONNECTOR_COLOR;switch(co= mpute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_STA= RT):seq=3Dseq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=3Dseq.= slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS= ):seq=3Dseq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c= =3D0,str_len=3Dseq.length;c<str_len;c++){var c_start=3DMath.floor(Math.max(= 0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_sta= rt)/2,y_center)}}else{ctx.fillStyle=3D"yellow";ctx.fillRect(x_center,y_cent= er+(this.mode!=3D=3D"Dense"?2:5),s_end-s_start,(mode!=3D=3D"Dense"?SQUISH_F= EATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode=3D=3D=3D"Pack"||this.mo= de=3D=3D=3D"Auto")&&ref_seq!=3D=3Dundefined&&w_scale>char_width_px){draw_la= st.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}= seq_offset+=3Dcig_len;break;case"X":seq_offset+=3Dcig_len;break}}ctx.fillSt= yle=3D"yellow";var item,type,data;for(var i=3D0;i<draw_last.length;i++){ite= m=3Ddraw_last[i];type=3Ditem.type;data=3Ditem.data;if(type=3D=3D=3D"text"){= ctx.save();ctx.font=3D"bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]= );ctx.restore()}else{if(type=3D=3D=3D"triangle"){drawDownwardEquilateralTri= angle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,featu= re,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=3Dfeature= [0],feature_start=3Dfeature[1],feature_end=3Dfeature[2],feature_name=3Dfeat= ure[3],f_start=3DMath.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f= _end=3DMath.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))= ),y_center=3D(mode=3D=3D=3D"Dense"?0:(0+slot))*y_scale,label_color=3Dthis.p= refs.label_color,gap=3D0;if((mode=3D=3D=3D"Pack"||this.mode=3D=3D=3D"Auto")= &&w_scale>ctx.canvas.manager.char_width_px){var gap=3DMath.round(w_scale/2)= }if(feature[5] instanceof Array){var b1_start=3DMath.floor(Math.max(0,(feat= ure[4][0]-tile_low)*w_scale)),b1_end=3DMath.ceil(Math.min(width,Math.max(0,= (feature[4][1]-tile_low)*w_scale))),b2_start=3DMath.floor(Math.max(0,(featu= re[5][0]-tile_low)*w_scale)),b2_end=3DMath.ceil(Math.min(width,Math.max(0,(= feature[5][1]-tile_low)*w_scale))),connector=3Dtrue;if(feature[4][1]>=3Dtil= e_low&&feature[4][0]<=3Dtile_high&&feature[4][2]){this.draw_read(ctx,mode,w= _scale,y_center,tile_low,tile_high,feature[4][0],feature[4][2],feature[4][3= ],feature[4][4])}else{connector=3Dfalse}if(feature[5][1]>=3Dtile_low&&featu= re[5][0]<=3Dtile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_cen= ter,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5]= [4])}else{connector=3Dfalse}if(connector&&b2_start>b1_end){ctx.fillStyle=3D= CONNECTOR_COLOR;dashedLine(ctx,b1_end-gap,y_center+5,b2_start-gap,y_center+= 5)}}else{this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,featur= e_start,feature[4],feature[5],feature[6])}if(mode=3D=3D=3D"Pack"&&feature_s= tart>tile_low&&feature_name!=3D=3D"."){ctx.fillStyle=3Dthis.prefs.label_col= or;var tile_index=3D1;if(tile_index=3D=3D=3D0&&f_start-ctx.measureText(feat= ure_name).width<0){ctx.textAlign=3D"left";ctx.fillText(feature_name,f_end+L= ABEL_SPACING-gap,y_center+8)}else{ctx.textAlign=3D"right";ctx.fillText(feat= ure_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinke= dFeaturePainter=3Dfunction(data,view_start,view_end,prefs,mode,alpha_scaler= ,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,pre= fs,mode,alpha_scaler,height_scaler);this.longest_feature_length=3Dthis.calc= ulate_longest_feature_length();this.draw_background_connector=3Dfalse;this.= draw_individual_connectors=3Dtrue};extend(ArcLinkedFeaturePainter.prototype= ,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest= _feature_length:function(){var longest_feature_length=3D0;for(var i=3D0,len= =3Dthis.data.length;i<len;i++){var feature=3Dthis.data[i],feature_start=3Df= eature[1],feature_end=3Dfeature[2];longest_feature_length=3DMath.max(longes= t_feature_length,feature_end-feature_start)}return longest_feature_length},= get_top_padding:function(width){var view_range=3Dthis.view_end-this.view_st= art,w_scale=3Dwidth/view_range;return Math.min(128,Math.ceil((this.longest_= feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block= 1_end,block2_start,block2_end,y_center){var x_center=3D(block1_end+block2_s= tart)/2,radius=3Dblock2_start-x_center;var angle1=3DMath.PI,angle2=3D0;if(r= adius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Ma= th.PI,0);ctx.stroke()}}});var Color=3Dfunction(rgb,a){if(Array.isArray(rgb)= ){this.rgb=3Drgb}else{if(rgb.length=3D=3D6){this.rgb=3Drgb.match(/.{2}/g).m= ap(function(c){return parseInt(c,16)})}else{if(rgb.length=3D=3D7){this.rgb= =3Drgb.substring(1,7).match(/.{2}/g).map(function(c){return parseInt(c,16)}= )}else{this.rgb=3Drgb.split("").map(function(c){return parseInt(c+c,16)})}}= }this.alpha=3Dtypeof(a)=3D=3D=3D"number"?a:1};Color.prototype=3D{eval:funct= ion(){return this},toCSS:function(){if(this.alpha<1){return"rgba("+this.rgb= .map(function(c){return Math.round(c)}).concat(this.alpha).join(", ")+")"}e= lse{return"#"+this.rgb.map(function(i){i=3DMath.round(i);i=3D(i>255?255:(i<= 0?0:i)).toString(16);return i.length=3D=3D=3D1?"0"+i:i}).join("")}},toHSL:f= unction(){var r=3Dthis.rgb[0]/255,g=3Dthis.rgb[1]/255,b=3Dthis.rgb[2]/255,a= =3Dthis.alpha;var max=3DMath.max(r,g,b),min=3DMath.min(r,g,b);var h,s,l=3D(= max+min)/2,d=3Dmax-min;if(max=3D=3D=3Dmin){h=3Ds=3D0}else{s=3Dl>0.5?d/(2-ma= x-min):d/(max+min);switch(max){case r:h=3D(g-b)/d+(g<b?6:0);break;case g:h= =3D(b-r)/d+2;break;case b:h=3D(r-g)/d+4;break}h/=3D6}return{h:h*360,s:s,l:l= ,a:a}},toARGB:function(){var argb=3D[Math.round(this.alpha*255)].concat(thi= s.rgb);return"#"+argb.map(function(i){i=3DMath.round(i);i=3D(i>255?255:(i<0= ?0:i)).toString(16);return i.length=3D=3D=3D1?"0"+i:i}).join("")},mix:funct= ion(color2,weight){color1=3Dthis;var p=3Dweight;var w=3Dp*2-1;var a=3Dcolor= 1.toHSL().a-color2.toHSL().a;var w1=3D(((w*a=3D=3D-1)?w:(w+a)/(1+w*a))+1)/2= ;var w2=3D1-w1;var rgb=3D[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w= 1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=3Dcolor1.al= pha*p+color2.alpha*(1-p);return new Color(rgb,alpha)}};var LinearRamp=3Dfun= ction(start_color,end_color,start_value,end_value){this.start_color=3Dnew C= olor(start_color);this.end_color=3Dnew Color(end_color);this.start_value=3D= start_value;this.end_value=3Dend_value;this.value_range=3Dend_value-start_v= alue};LinearRamp.prototype.map_value=3Dfunction(value){value=3DMath.max(val= ue,this.start_value);value=3DMath.min(value,this.end_value);value=3D(value-= this.start_value)/this.value_range;return this.start_color.mix(this.end_col= or,1-value).toCSS()};var SplitRamp=3Dfunction(start_color,middle_color,end_= color,start_value,end_value){this.positive_ramp=3Dnew LinearRamp(middle_col= or,end_color,0,end_value);this.negative_ramp=3Dnew LinearRamp(middle_color,= start_color,0,-start_value);this.start_value=3Dstart_value;this.end_value= =3Dend_value};SplitRamp.prototype.map_value=3Dfunction(value){value=3DMath.= max(value,this.start_value);value=3DMath.min(value,this.end_value);if(value= prefs.max_value=3Dmax_value}};DiagonalHeatmapPainter.prototype.default_pref= s=3D{min_value:undefined,max_value:undefined,mode:"Heatmap",pos_color:"#FF8= C00",neg_color:"#4169E1"};DiagonalHeatmapPainter.prototype.draw=3Dfunction(= ctx,width,height,w_scale){var min_value=3Dthis.prefs.min_value,max_value=3D= this.prefs.max_value,value_range=3Dmax_value-min_value,height_px=3Dheight,v= iew_start=3Dthis.view_start,mode=3Dthis.mode,data=3Dthis.data,invsqrt2=3D1/= Math.sqrt(2);var ramp=3D(new SplitRamp(this.prefs.neg_color,"#FFFFFF",this.= prefs.pos_color,min_value,max_value));var d,s1,e1,s2,e2,value;var scale=3Df= unction(p){return(p-view_start)*w_scale};ctx.save();ctx.rotate(-45*Math.PI/= 180);ctx.scale(invsqrt2,invsqrt2);for(var i=3D0,len=3Ddata.length;i<len;i++= ){d=3Ddata[i];s1=3Dscale(d[1]);e1=3Dscale(d[2]);s2=3Dscale(d[4]);e2=3Dscale= (d[5]);value=3Dd[6];ctx.fillStyle=3D(ramp.map_value(value));ctx.fillRect(s1= ,s2,(e1-s1),(e2-s2))}ctx.restore()};return{Scaler:Scaler,SummaryTreePainter= :SummaryTreePainter,LinePainter:LinePainter,LinkedFeaturePainter:LinkedFeat= urePainter,ReadPainter:ReadPainter,ArcLinkedFeaturePainter:ArcLinkedFeature= Painter,DiagonalHeatmapPainter:DiagonalHeatmapPainter}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/trackster/tracks.js --- a/static/scripts/packed/viz/trackster/tracks.js +++ b/static/scripts/packed/viz/trackster/tracks.js @@ -1,1 +1,1 @@ -define(["libs/underscore","viz/visualization","viz/trackster/util","viz/tr= ackster/slotting","viz/trackster/painters","mvc/data","viz/trackster/filter= s"],function(ab,x,l,u,L,Z,i){var q=3Dab.extend;var V=3Dfunction(ac){return(= "isResolved" in ac)};var n=3D{};var k=3Dfunction(ac,ad){n[ac.attr("id")]=3D= ad};var m=3Dfunction(ac,ae,ag,af){ag=3D".group";var ad=3D{};n[ac.attr("id")= ]=3Daf;ac.bind("drag",{handle:"."+ae,relative:true},function(ao,ap){var an= =3D$(this),at=3D$(this).parent(),ak=3Dat.children(),am=3Dn[$(this).attr("id= ")],aj,ai,aq,ah,al;ai=3D$(this).parents(ag);if(ai.length!=3D=3D0){aq=3Dai.p= osition().top;ah=3Daq+ai.outerHeight();if(ap.offsetY<aq){$(this).insertBefo= re(ai);var ar=3Dn[ai.attr("id")];ar.remove_drawable(am);ar.container.add_dr= awable_before(am,ar);return}else{if(ap.offsetY>ah){$(this).insertAfter(ai);= var ar=3Dn[ai.attr("id")];ar.remove_drawable(am);ar.container.add_drawable(= am);return}}}ai=3Dnull;for(al=3D0;al<ak.length;al++){aj=3D$(ak.get(al));aq= =3Daj.position().top;ah=3Daq+aj.outerHeight();if(aj.is(ag)&&this!=3D=3Daj.g= et(0)&&ap.offsetY>=3Daq&&ap.offsetY<=3Dah){if(ap.offsetY-aq<ah-ap.offsetY){= aj.find(".content-div").prepend(this)}else{aj.find(".content-div").append(t= his)}if(am.container){am.container.remove_drawable(am)}n[aj.attr("id")].add= _drawable(am);return}}for(al=3D0;al<ak.length;al++){aj=3D$(ak.get(al));if(a= p.offsetY<aj.position().top&&!(aj.hasClass("reference-track")||aj.hasClass(= "intro"))){break}}if(al=3D=3D=3Dak.length){if(this!=3D=3Dak.get(al-1)){at.a= ppend(this);n[at.attr("id")].move_drawable(am,al)}}else{if(this!=3D=3Dak.ge= t(al)){$(this).insertBefore(ak.get(al));n[at.attr("id")].move_drawable(am,(= ap.deltaY>0?al-1:al))}}}).bind("dragstart",function(){ad["border-top"]=3Dac= .css("border-top");ad["border-bottom"]=3Dac.css("border-bottom");$(this).cs= s({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind(= "dragend",function(){$(this).css(ad)})};exports.moveable=3Dm;var aa=3D16,G= =3D9,D=3D20,A=3D100,I=3D12000,S=3D400,K=3D5000,w=3D100,o=3D"There was an er= ror in indexing this dataset. ",J=3D"A converter for this dataset is not in= stalled. Please check your datatypes_conf.xml file.",E=3D"No data for this = chrom/contig.",v=3D"Preparing data. This can take a while for a large datas= et. If the visualization is saved and closed, preparation will continue in = the background.",y=3D"Tool cannot be rerun: ",a=3D"Loading data...",U=3D"Re= ady for display",Q=3D10,H=3D20;function W(ad,ac){if(!ac){ac=3D0}var ae=3DMa= th.pow(10,ac);return Math.round(ad*ae)/ae}var r=3Dfunction(ad,ac,af){if(!r.= id_counter){r.id_counter=3D0}this.id=3Dr.id_counter++;this.name=3Daf.name;t= his.view=3Dad;this.container=3Dac;this.config=3Dnew F({track:this,params:[{= key:"name",label:"Name",type:"text",default_value:this.name}],saved_values:= af.prefs,onchange:function(){this.track.set_name(this.track.config.values.n= ame)}});this.prefs=3Dthis.config.values;this.drag_handle_class=3Daf.drag_ha= ndle_class;this.is_overview=3Dfalse;this.action_icons=3D{};this.content_vis= ible=3Dtrue;this.container_div=3Dthis.build_container_div();this.header_div= =3Dthis.build_header_div();if(this.header_div){this.container_div.append(th= is.header_div);this.icons_div=3D$("<div/>").css("float","left").hide().appe= ndTo(this.header_div);this.build_action_icons(this.action_icons_def);this.h= eader_div.append($("<div style=3D'clear: both'/>"));this.header_div.dblclic= k(function(ag){ag.stopPropagation()});var ae=3Dthis;this.container_div.hove= r(function(){ae.icons_div.show()},function(){ae.icons_div.hide()});$("<div = style=3D'clear: both'/>").appendTo(this.container_div)}};r.prototype.action= _icons_def=3D[{name:"toggle_icon",title:"Hide/show content",css_class:"togg= le",on_click_fn:function(ac){if(ac.content_visible){ac.action_icons.toggle_= icon.addClass("toggle-expand").removeClass("toggle");ac.hide_contents();ac.= content_visible=3Dfalse}else{ac.action_icons.toggle_icon.addClass("toggle")= .removeClass("toggle-expand");ac.content_visible=3Dtrue;ac.show_contents()}= }},{name:"settings_icon",title:"Edit settings",css_class:"settings-icon",on= _click_fn:function(ad){var af=3Dfunction(){hide_modal();$(window).unbind("k= eypress.check_enter_esc")},ac=3Dfunction(){ad.config.update_from_form($(".d= ialog-box"));hide_modal();$(window).unbind("keypress.check_enter_esc")},ae= =3Dfunction(ag){if((ag.keyCode||ag.which)=3D=3D=3D27){af()}else{if((ag.keyC= ode||ag.which)=3D=3D=3D13){ac()}}};$(window).bind("keypress.check_enter_esc= ",ae);show_modal("Configure",ad.config.build_form(),{Cancel:af,OK:ac})}},{n= ame:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:functi= on(ac){$(".bs-tooltip").remove();ac.remove()}}];q(r.prototype,{init:functio= n(){},changed:function(){this.view.changed()},can_draw:function(){if(this.e= nabled&&this.content_visible){return true}return false},request_draw:functi= on(){},_draw:function(){},to_dict:function(){},set_name:function(ac){this.o= ld_name=3Dthis.name;this.name=3Dac;this.name_div.text(this.name)},revert_na= me:function(){if(this.old_name){this.name=3Dthis.old_name;this.name_div.tex= t(this.name)}},remove:function(){this.changed();this.container.remove_drawa= ble(this);var ac=3Dthis.view;this.container_div.hide(0,function(){$(this).r= emove();ac.update_intro_div()})},build_container_div:function(){},build_hea= der_div:function(){},add_action_icon:function(ad,ai,ah,ag,ac,af){var ae=3Dt= his;this.action_icons[ad]=3D$("<a/>").attr("href","javascript:void(0);").at= tr("title",ai).addClass("icon-button").addClass(ah).tooltip().click(functio= n(){ag(ae)}).appendTo(this.icons_div);if(af){this.action_icons[ad].hide()}}= ,build_action_icons:function(ac){var ae;for(var ad=3D0;ad<ac.length;ad++){a= e=3Dac[ad];this.add_action_icon(ae.name,ae.title,ae.css_class,ae.on_click_f= n,ae.prepend,ae.hide)}},update_icons:function(){},hide_contents:function(){= },show_contents:function(){},get_drawables:function(){}});var z=3Dfunction(= ad,ac,ae){r.call(this,ad,ac,ae);this.obj_type=3Dae.obj_type;this.drawables= =3D[]};q(z.prototype,r.prototype,{unpack_drawables:function(ae){this.drawab= les=3D[];var ad;for(var ac=3D0;ac<ae.length;ac++){ad=3Dp(ae[ac],this.view,t= his);this.add_drawable(ad)}},init:function(){for(var ac=3D0;ac<this.drawabl= es.length;ac++){this.drawables[ac].init()}},_draw:function(){for(var ac=3D0= ;ac<this.drawables.length;ac++){this.drawables[ac]._draw()}},to_dict:functi= on(){var ad=3D[];for(var ac=3D0;ac<this.drawables.length;ac++){ad.push(this= .drawables[ac].to_dict())}return{name:this.name,prefs:this.prefs,obj_type:t= his.obj_type,drawables:ad}},add_drawable:function(ac){this.drawables.push(a= c);ac.container=3Dthis;this.changed()},add_drawable_before:function(ae,ac){= this.changed();var ad=3Dthis.drawables.indexOf(ac);if(ad!=3D=3D-1){this.dra= wables.splice(ad,0,ae);return true}return false},replace_drawable:function(= ae,ac,ad){var af=3Dthis.drawables.indexOf(ae);if(af!=3D=3D-1){this.drawable= s[af]=3Dac;if(ad){ae.container_div.replaceWith(ac.container_div)}this.chang= ed()}return af},remove_drawable:function(ad){var ac=3Dthis.drawables.indexO= f(ad);if(ac!=3D=3D-1){this.drawables.splice(ac,1);ad.container=3Dnull;this.= changed();return true}return false},move_drawable:function(ad,ae){var ac=3D= this.drawables.indexOf(ad);if(ac!=3D=3D-1){this.drawables.splice(ac,1);this= .drawables.splice(ae,0,ad);this.changed();return true}return false},get_dra= wables:function(){return this.drawables}});var P=3Dfunction(ad,ac,af){q(af,= {obj_type:"DrawableGroup",drag_handle_class:"group-handle"});z.call(this,ad= ,ac,af);this.content_div=3D$("<div/>").addClass("content-div").attr("id","g= roup_"+this.id+"_content_div").appendTo(this.container_div);k(this.containe= r_div,this);k(this.content_div,this);m(this.container_div,this.drag_handle_= class,".group",this);this.filters_manager=3Dnew i.FiltersManager(this);this= .header_div.after(this.filters_manager.parent_div);this.saved_filters_manag= ers=3D[];if("drawables" in af){this.unpack_drawables(af.drawables)}if("filt= ers" in af){var ae=3Dthis.filters_manager;this.filters_manager=3Dnew i.Filt= ersManager(this,af.filters);ae.parent_div.replaceWith(this.filters_manager.= parent_div);if(af.filters.visible){this.setup_multitrack_filtering()}}};q(P= .prototype,r.prototype,z.prototype,{action_icons_def:[r.prototype.action_ic= ons_def[0],r.prototype.action_icons_def[1],{name:"composite_icon",title:"Sh= ow composite track",css_class:"layers-stack",on_click_fn:function(ac){$(".b= s-tooltip").remove();ac.show_composite_track()}},{name:"filters_icon",title= :"Filters",css_class:"filters-icon",on_click_fn:function(ac){if(ac.filters_= manager.visible()){ac.filters_manager.clear_filters();ac._restore_filter_ma= nagers()}else{ac.setup_multitrack_filtering();ac.request_draw(true)}ac.filt= ers_manager.toggle()}},r.prototype.action_icons_def[2]],build_container_div= :function(){var ac=3D$("<div/>").addClass("group").attr("id","group_"+this.= id);if(this.container){this.container.content_div.append(ac)}return ac},bui= ld_header_div:function(){var ac=3D$("<div/>").addClass("track-header");ac.a= ppend($("<div/>").addClass(this.drag_handle_class));this.name_div=3D$("<div= />").addClass("track-name").text(this.name).appendTo(ac);return ac},hide_co= ntents:function(){this.tiles_div.hide()},show_contents:function(){this.tile= s_div.show();this.request_draw()},update_icons:function(){var ae=3Dthis.dra= wables.length;if(ae=3D=3D=3D0){this.action_icons.composite_icon.hide();this= .action_icons.filters_icon.hide()}else{if(ae=3D=3D=3D1){if(this.drawables[0= ] instanceof f){this.action_icons.composite_icon.show()}this.action_icons.f= ilters_icon.hide()}else{var al,ak,ai,ao=3Dtrue,ag=3Dthis.drawables[0].get_t= ype(),ac=3D0;for(al=3D0;al<ae;al++){ai=3Dthis.drawables[al];if(ai.get_type(= )!=3D=3Dag){can_composite=3Dfalse;break}if(ai instanceof c){ac++}}if(ao||ac= =3D=3D=3D1){this.action_icons.composite_icon.show()}else{this.action_icons.= composite_icon.hide();$(".bs-tooltip").remove()}if(ac>1&&ac=3D=3D=3Dthis.dr= awables.length){var ap=3D{},ad;ai=3Dthis.drawables[0];for(ak=3D0;ak<ai.filt= ers_manager.filters.length;ak++){ad=3Dai.filters_manager.filters[ak];ap[ad.= name]=3D[ad]}for(al=3D1;al<this.drawables.length;al++){ai=3Dthis.drawables[= al];for(ak=3D0;ak<ai.filters_manager.filters.length;ak++){ad=3Dai.filters_m= anager.filters[ak];if(ad.name in ap){ap[ad.name].push(ad)}}}this.filters_ma= nager.remove_all();var af,ah,aj,am;for(var an in ap){af=3Dap[an];if(af.leng= th=3D=3D=3Dac){ah=3Dnew i.NumberFilter({name:af[0].name,index:af[0].index})= ;this.filters_manager.add_filter(ah)}}if(this.filters_manager.filters.lengt= h>0){this.action_icons.filters_icon.show()}else{this.action_icons.filters_i= con.hide()}}else{this.action_icons.filters_icon.hide()}}}},_restore_filter_= managers:function(){for(var ac=3D0;ac<this.drawables.length;ac++){this.draw= ables[ac].filters_manager=3Dthis.saved_filters_managers[ac]}this.saved_filt= ers_managers=3D[]},setup_multitrack_filtering:function(){if(this.filters_ma= nager.filters.length>0){this.saved_filters_managers=3D[];for(var ac=3D0;ac<= this.drawables.length;ac++){drawable=3Dthis.drawables[ac];this.saved_filter= s_managers.push(drawable.filters_manager);drawable.filters_manager=3Dthis.f= ilters_manager}}this.filters_manager.init_filters()},show_composite_track:f= unction(){var ag=3D[];for(var ad=3D0;ad<this.drawables.length;ad++){ag.push= (this.drawables[ad].name)}var ae=3D"Composite Track of "+this.drawables.len= gth+" tracks ("+ag.join(", ")+")";var af=3Dnew f(this.view,this.view,{name:= ae,drawables:this.drawables});var ac=3Dthis.container.replace_drawable(this= ,af,true);af.request_draw()},add_drawable:function(ac){z.prototype.add_draw= able.call(this,ac);this.update_icons()},remove_drawable:function(ac){z.prot= otype.remove_drawable.call(this,ac);this.update_icons()},to_dict:function()= {if(this.filters_manager.visible()){this._restore_filter_managers()}var ac= =3Dq(z.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()= });if(this.filters_manager.visible()){this.setup_multitrack_filtering()}ret= urn ac},request_draw:function(ac,ae){for(var ad=3D0;ad<this.drawables.lengt= h;ad++){this.drawables[ad].request_draw(ac,ae)}}});var Y=3Dfunction(ac){q(a= c,{obj_type:"View"});z.call(this,"View",ac.container,ac);this.chrom=3Dnull;= this.vis_id=3Dac.vis_id;this.dbkey=3Dac.dbkey;this.label_tracks=3D[];this.t= racks_to_be_redrawn=3D[];this.max_low=3D0;this.max_high=3D0;this.zoom_facto= r=3D3;this.min_separation=3D30;this.has_changes=3Dfalse;this.load_chroms_de= ferred=3Dnull;this.init();this.canvas_manager=3Dnew x.CanvasManager(this.co= ntainer.get(0).ownerDocument);this.reset()};ab.extend(Y.prototype,Backbone.= Events);q(Y.prototype,z.prototype,{init:function(){this.requested_redraw=3D= false;var ae=3Dthis.container,ac=3Dthis;this.top_container=3D$("<div/>").ad= dClass("top-container").appendTo(ae);this.browser_content_div=3D$("<div/>")= .addClass("content").css("position","relative").appendTo(ae);this.bottom_co= ntainer=3D$("<div/>").addClass("bottom-container").appendTo(ae);this.top_la= beltrack=3D$("<div/>").addClass("top-labeltrack").appendTo(this.top_contain= er);this.viewport_container=3D$("<div/>").addClass("viewport-container").at= tr("id","viewport-container").appendTo(this.browser_content_div);this.conte= nt_div=3Dthis.viewport_container;k(this.viewport_container,ac);this.intro_d= iv=3D$("<div/>").addClass("intro").appendTo(this.viewport_container).hide()= ;var af=3D$("<div/>").text("Add Datasets to Visualization").addClass("actio= n-button").appendTo(this.intro_div).click(function(){x.select_datasets(sele= ct_datasets_url,add_track_async_url,ac.dbkey,function(ag){ab.each(ag,functi= on(ah){ac.add_drawable(p(ah,ac,ac))})})});this.nav_labeltrack=3D$("<div/>")= .addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_contai= ner=3D$("<div/>").addClass("trackster-nav-container").prependTo(this.top_co= ntainer);this.nav=3D$("<div/>").addClass("trackster-nav").appendTo(this.nav= _container);this.overview=3D$("<div/>").addClass("overview").appendTo(this.= bottom_container);this.overview_viewport=3D$("<div/>").addClass("overview-v= iewport").appendTo(this.overview);this.overview_close=3D$("<a/>").attr("hre= f","javascript:void(0);").attr("title","Close overview").addClass("icon-but= ton overview-close tooltip").hide().appendTo(this.overview_viewport);this.o= verview_highlight=3D$("<div/>").addClass("overview-highlight").hide().appen= dTo(this.overview_viewport);this.overview_box_background=3D$("<div/>").addC= lass("overview-boxback").appendTo(this.overview_viewport);this.overview_box= =3D$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);th= is.default_overview_height=3Dthis.overview_box.height();this.nav_controls= =3D$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_selec= t=3D$("<select/>").attr({name:"chrom"}).css("width","15em").append("<option= value=3D''>Loading</option>").appendTo(this.nav_controls);var ad=3Dfunctio= n(ag){if(ag.type=3D=3D=3D"focusout"||(ag.keyCode||ag.which)=3D=3D=3D13||(ag= .keyCode||ag.which)=3D=3D=3D27){if((ag.keyCode||ag.which)!=3D=3D27){ac.go_t= o($(this).val())}$(this).hide();$(this).val("");ac.location_span.show();ac.= chrom_select.show()}};this.nav_input=3D$("<input/>").addClass("nav-input").= hide().bind("keyup focusout",ad).appendTo(this.nav_controls);this.location_= span=3D$("<span/>").addClass("location").attr("original-title","Click to ch= ange location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);t= his.location_span.click(function(){ac.location_span.hide();ac.chrom_select.= hide();ac.nav_input.val(ac.chrom+":"+ac.low+"-"+ac.high);ac.nav_input.css("= display","inline-block");ac.nav_input.select();ac.nav_input.focus();ac.nav_= input.autocomplete({source:function(ai,ag){var aj=3D[],ah=3D$.map(ac.get_dr= awables(),function(ak){return ak.data_manager.search_features(ai.term).succ= ess(function(al){aj=3Daj.concat(al)})});$.when.apply($,ah).done(function(){= ag($.map(aj,function(ak){return{label:ak[0],value:ak[1]}}))})}})});if(this.= vis_id!=3D=3Dundefined){this.hidden_input=3D$("<input/>").attr("type","hidd= en").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=3D$("<a/>").= attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}= ).click(function(){ac.zoom_out();ac.request_redraw()}).appendTo(this.nav_co= ntrols);this.zi_link=3D$("<a/>").attr("id","zoom-in").attr("title","Zoom in= ").tooltip({placement:"bottom"}).click(function(){ac.zoom_in();ac.request_r= edraw()}).appendTo(this.nav_controls);this.load_chroms_deferred=3Dthis.load= _chroms({low:0});this.chrom_select.bind("change",function(){ac.change_chrom= (ac.chrom_select.val())});this.browser_content_div.click(function(ag){$(thi= s).find("input").trigger("blur")});this.browser_content_div.bind("dblclick"= ,function(ag){ac.zoom_in(ag.pageX,this.viewport_container)});this.overview_= box.bind("dragstart",function(ag,ah){this.current_x=3Dah.offsetX}).bind("dr= ag",function(ag,ai){var aj=3Dai.offsetX-this.current_x;this.current_x=3Dai.= offsetX;var ah=3DMath.round(aj/ac.viewport_container.width()*(ac.max_high-a= c.max_low));ac.move_delta(-ah)});this.overview_close.click(function(){ac.re= set_overview()});this.viewport_container.bind("draginit",function(ag,ah){if= (ag.clientX>ac.viewport_container.width()-16){return false}}).bind("dragsta= rt",function(ag,ah){ah.original_low=3Dac.low;ah.current_height=3Dag.clientY= ;ah.current_x=3Dah.offsetX}).bind("drag",function(ai,ak){var ag=3D$(this);v= ar al=3Dak.offsetX-ak.current_x;var ah=3Dag.scrollTop()-(ai.clientY-ak.curr= ent_height);ag.scrollTop(ah);ak.current_height=3Dai.clientY;ak.current_x=3D= ak.offsetX;var aj=3DMath.round(al/ac.viewport_container.width()*(ac.high-ac= .low));ac.move_delta(aj)}).bind("mousewheel",function(ai,ak,ah,ag){if(ah){a= h*=3D50;var aj=3DMath.round(-ah/ac.viewport_container.width()*(ac.high-ac.l= ow));ac.move_delta(aj)}});this.top_labeltrack.bind("dragstart",function(ag,= ah){return $("<div />").css({height:ac.browser_content_div.height()+ac.top_= labeltrack.height()+ac.nav_labeltrack.height()+1,top:"0px",position:"absolu= te","background-color":"#ccf",opacity:0.5,"z-index":1000}).appendTo($(this)= )}).bind("drag",function(ak,al){$(al.proxy).css({left:Math.min(ak.pageX,al.= startX)-ac.container.offset().left,width:Math.abs(ak.pageX-al.startX)});var= ah=3DMath.min(ak.pageX,al.startX)-ac.container.offset().left,ag=3DMath.max= (ak.pageX,al.startX)-ac.container.offset().left,aj=3D(ac.high-ac.low),ai=3D= ac.viewport_container.width();ac.update_location(Math.round(ah/ai*aj)+ac.lo= w,Math.round(ag/ai*aj)+ac.low)}).bind("dragend",function(al,am){var ah=3DMa= th.min(al.pageX,am.startX),ag=3DMath.max(al.pageX,am.startX),aj=3D(ac.high-= ac.low),ai=3Dac.viewport_container.width(),ak=3Dac.low;ac.low=3DMath.round(= ah/ai*aj)+ak;ac.high=3DMath.round(ag/ai*aj)+ak;$(am.proxy).remove();ac.requ= est_redraw()});this.add_label_track(new X(this,{content_div:this.top_labelt= rack}));this.add_label_track(new X(this,{content_div:this.nav_labeltrack}))= ;$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this= .resize_timer)}this.resize_timer=3DsetTimeout(function(){ac.resize_window()= },500)});$(document).bind("redraw",function(){ac.redraw()});this.reset();$(= window).trigger("resize")},changed:function(){this.has_changes=3Dtrue},upda= te_intro_div:function(){if(this.drawables.length=3D=3D=3D0){this.intro_div.= show()}else{this.intro_div.hide()}},trigger_navigate:function(ad,af,ac,ag){= if(this.timer){clearTimeout(this.timer)}if(ag){var ae=3Dthis;this.timer=3Ds= etTimeout(function(){ae.trigger("navigate",ad+":"+af+"-"+ac)},500)}else{vie= w.trigger("navigate",ad+":"+af+"-"+ac)}},update_location:function(ac,ae){th= is.location_span.text(commatize(ac)+" - "+commatize(ae));this.nav_input.val= (this.chrom+":"+commatize(ac)+"-"+commatize(ae));var ad=3Dview.chrom_select= .val();if(ad!=3D=3D""){this.trigger_navigate(ad,view.low,view.high,true)}},= load_chroms:function(ae){ae.num=3Dw;var ac=3Dthis,ad=3D$.Deferred();$.ajax(= {url:chrom_url+"/"+this.dbkey,data:ae,dataType:"json",success:function(ag){= if(ag.chrom_info.length=3D=3D=3D0){return}if(ag.reference){ac.add_label_tra= ck(new B(ac))}ac.chrom_data=3Dag.chrom_info;var aj=3D'<option value=3D"">Se= lect Chrom/Contig</option>';for(var ai=3D0,af=3Dac.chrom_data.length;ai<af;= ai++){var ah=3Dac.chrom_data[ai].chrom;aj+=3D'<option value=3D"'+ah+'">'+ah= +"</option>"}if(ag.prev_chroms){aj+=3D'<option value=3D"previous">Previous = '+w+"</option>"}if(ag.next_chroms){aj+=3D'<option value=3D"next">Next '+w+"= </option>"}ac.chrom_select.html(aj);ac.chrom_start_index=3Dag.start_index;a= d.resolve(ag)},error:function(){alert("Could not load chroms for this dbkey= :",ac.dbkey)}});return ad},change_chrom:function(ah,ad,aj){var ae=3Dthis;if= (!ae.chrom_data){ae.load_chroms_deferred.then(function(){ae.change_chrom(ah= ,ad,aj)});return}if(!ah||ah=3D=3D=3D"None"){return}if(ah=3D=3D=3D"previous"= ){ae.load_chroms({low:this.chrom_start_index-w});return}if(ah=3D=3D=3D"next= "){ae.load_chroms({low:this.chrom_start_index+w});return}var ai=3D$.grep(ae= .chrom_data,function(ak,al){return ak.chrom=3D=3D=3Dah})[0];if(ai=3D=3D=3Du= ndefined){ae.load_chroms({chrom:ah},function(){ae.change_chrom(ah,ad,aj)});= return}else{if(ah!=3D=3Dae.chrom){ae.chrom=3Dah;ae.chrom_select.val(ae.chro= m);ae.max_high=3Dai.len-1;ae.reset();ae.request_redraw(true);for(var ag=3D0= ,ac=3Dae.drawables.length;ag<ac;ag++){var af=3Dae.drawables[ag];if(af.init)= {af.init()}}if(ae.reference_track){ae.reference_track.init()}}if(ad!=3D=3Du= ndefined&&aj!=3D=3Dundefined){ae.low=3DMath.max(ad,0);ae.high=3DMath.min(aj= ,ae.max_high)}else{ae.low=3D0;ae.high=3Dae.max_high}ae.reset_overview();ae.= request_redraw()}},go_to:function(ag){ag=3Dag.replace(/ |,/g,"");var ak=3Dt= his,ac,af,ad=3Dag.split(":"),ai=3Dad[0],aj=3Dad[1];if(aj!=3D=3Dundefined){t= ry{var ah=3Daj.split("-");ac=3DparseInt(ah[0],10);af=3DparseInt(ah[1],10)}c= atch(ae){return false}}ak.change_chrom(ai,ac,af)},move_fraction:function(ae= ){var ac=3Dthis;var ad=3Dac.high-ac.low;this.move_delta(ae*ad)},move_delta:= function(af){var ac=3Dthis;var ae=3Dac.high-ac.low;if(ac.low-af<ac.max_low)= {ac.low=3Dac.max_low;ac.high=3Dac.max_low+ae}else{if(ac.high-af>ac.max_high= ){ac.high=3Dac.max_high;ac.low=3Dac.max_high-ae}else{ac.high-=3Daf;ac.low-= =3Daf}}ac.request_redraw();var ad=3Dac.chrom_select.val();this.trigger_navi= gate(ad,ac.low,ac.high,true)},add_drawable:function(ac){z.prototype.add_dra= wable.call(this,ac);ac.init();this.changed();this.update_intro_div()},add_l= abel_track:function(ac){ac.view=3Dthis;ac.init();this.label_tracks.push(ac)= },remove_drawable:function(ae,ad){z.prototype.remove_drawable.call(this,ae)= ;if(ad){var ac=3Dthis;ae.container_div.hide(0,function(){$(this).remove();a= c.update_intro_div()})}},reset:function(){this.low=3Dthis.max_low;this.high= =3Dthis.max_high;this.viewport_container.find(".yaxislabel").remove()},requ= est_redraw:function(ak,ac,aj,al){var ai=3Dthis,ah=3D(al?[al]:ai.drawables),= ae;var ad;for(var ag=3D0;ag<ah.length;ag++){ad=3Dah[ag];ae=3D-1;for(var af= =3D0;af<ai.tracks_to_be_redrawn.length;af++){if(ai.tracks_to_be_redrawn[af]= [0]=3D=3D=3Dad){ae=3Daf;break}}if(ae<0){ai.tracks_to_be_redrawn.push([ad,ac= ,aj])}else{ai.tracks_to_be_redrawn[ag][1]=3Dac;ai.tracks_to_be_redrawn[ag][= 2]=3Daj}}if(!this.requested_redraw){requestAnimationFrame(function(){ai._re= draw(ak)});this.requested_redraw=3Dtrue}},_redraw:function(am){this.request= ed_redraw=3Dfalse;var aj=3Dthis.low,af=3Dthis.high;if(aj<this.max_low){aj= =3Dthis.max_low}if(af>this.max_high){af=3Dthis.max_high}var al=3Dthis.high-= this.low;if(this.high!=3D=3D0&&al<this.min_separation){af=3Daj+this.min_sep= aration}this.low=3DMath.floor(aj);this.high=3DMath.ceil(af);this.update_loc= ation(this.low,this.high);this.resolution_b_px=3D(this.high-this.low)/this.= viewport_container.width();this.resolution_px_b=3Dthis.viewport_container.w= idth()/(this.high-this.low);var ac=3D(this.low/(this.max_high-this.max_low)= *this.overview_viewport.width())||0;var ai=3D((this.high-this.low)/(this.ma= x_high-this.max_low)*this.overview_viewport.width())||0;var an=3D13;this.ov= erview_box.css({left:ac,width:Math.max(an,ai)}).show();if(ai<an){this.overv= iew_box.css("left",ac-(an-ai)/2)}if(this.overview_highlight){this.overview_= highlight.css({left:ac,width:ai})}if(!am){var ae,ad,ak;for(var ag=3D0,ah=3D= this.tracks_to_be_redrawn.length;ag<ah;ag++){ae=3Dthis.tracks_to_be_redrawn= [ag][0];ad=3Dthis.tracks_to_be_redrawn[ag][1];ak=3Dthis.tracks_to_be_redraw= n[ag][2];if(ae){ae._draw(ad,ak)}}this.tracks_to_be_redrawn=3D[];for(ag=3D0,= ah=3Dthis.label_tracks.length;ag<ah;ag++){this.label_tracks[ag]._draw()}}},= zoom_in:function(ad,ae){if(this.max_high=3D=3D=3D0||this.high-this.low<=3Dt= his.min_separation){return}var af=3Dthis.high-this.low,ag=3Daf/2+this.low,a= c=3D(af/this.zoom_factor)/2;if(ad){ag=3Dad/this.viewport_container.width()*= (this.high-this.low)+this.low}this.low=3DMath.round(ag-ac);this.high=3DMath= .round(ag+ac);this.changed();this.request_redraw()},zoom_out:function(){if(= this.max_high=3D=3D=3D0){return}var ad=3Dthis.high-this.low,ae=3Dad/2+this.= low,ac=3D(ad*this.zoom_factor)/2;this.low=3DMath.round(ae-ac);this.high=3DM= ath.round(ae+ac);this.changed();this.request_redraw()},resize_window:functi= on(){this.viewport_container.height(this.container.height()-this.top_contai= ner.height()-this.bottom_container.height());this.request_redraw()},set_ove= rview:function(ae){if(this.overview_drawable){if(this.overview_drawable.dat= aset_id=3D=3D=3Dae.dataset_id){return}this.overview_viewport.find(".track")= .remove()}var ad=3Dae.copy({content_div:this.overview_viewport}),ac=3Dthis;= ad.header_div.hide();ad.is_overview=3Dtrue;ac.overview_drawable=3Dad;this.o= verview_drawable.postdraw_actions=3Dfunction(){ac.overview_highlight.show()= .height(ac.overview_drawable.content_div.height());ac.overview_viewport.hei= ght(ac.overview_drawable.content_div.height()+ac.overview_box.outerHeight()= );ac.overview_close.show();ac.resize_window()};ac.overview_drawable.request= _draw();this.changed()},reset_overview:function(){$(".bs-tooltip").remove()= ;this.overview_viewport.find(".track-tile").remove();this.overview_viewport= .height(this.default_overview_height);this.overview_box.height(this.default= _overview_height);this.overview_close.hide();this.overview_highlight.hide()= ;view.resize_window();view.overview_drawable=3Dnull}});var s=3Dfunction(ae,= aj,af){this.track=3Dae;this.name=3Daj.name;this.params=3D[];var aq=3Daj.par= ams;for(var ag=3D0;ag<aq.length;ag++){var al=3Daq[ag],ad=3Dal.name,ap=3Dal.= label,ah=3Dunescape(al.html),ar=3Dal.value,an=3Dal.type;if(an=3D=3D=3D"numb= er"){this.params.push(new e(ad,ap,ah,(ad in af?af[ad]:ar),al.min,al.max))}e= lse{if(an=3D=3D=3D"select"){this.params.push(new N(ad,ap,ah,(ad in af?af[ad= ]:ar)))}else{console.log("WARNING: unrecognized tool parameter type:",ad,an= )}}}this.parent_div=3D$("<div/>").addClass("dynamic-tool").hide();this.pare= nt_div.bind("drag",function(au){au.stopPropagation()}).click(function(au){a= u.stopPropagation()}).bind("dblclick",function(au){au.stopPropagation()});v= ar ao=3D$("<div class=3D'tool-name'>").appendTo(this.parent_div).text(this.= name);var am=3Dthis.params;var ak=3Dthis;$.each(this.params,function(av,ay)= {var ax=3D$("<div>").addClass("param-row").appendTo(ak.parent_div);var au= =3D$("<div>").addClass("param-label").text(ay.label).appendTo(ax);var aw=3D= $("<div/>").addClass("param-input").html(ay.html).appendTo(ax);aw.find(":in= put").val(ay.value);$("<div style=3D'clear: both;'/>").appendTo(ax)});this.= parent_div.find("input").click(function(){$(this).select()});var at=3D$("<d= iv>").addClass("param-row").appendTo(this.parent_div);var ai=3D$("<input ty= pe=3D'submit'>").attr("value","Run on complete dataset").appendTo(at);var a= c=3D$("<input type=3D'submit'>").attr("value","Run on visible region").css(= "margin-left","3em").appendTo(at);ac.click(function(){ak.run_on_region()});= ai.click(function(){ak.run_on_dataset()});if("visible" in af&&af.visible){t= his.parent_div.show()}};q(s.prototype,{update_params:function(){for(var ac= =3D0;ac<this.params.length;ac++){this.params[ac].update_value()}},state_dic= t:function(){var ad=3D{};for(var ac=3D0;ac<this.params.length;ac++){ad[this= .params[ac].name]=3Dthis.params[ac].value}ad.visible=3Dthis.parent_div.is("= :visible");return ad},get_param_values_dict:function(){var ac=3D{};this.par= ent_div.find(":input").each(function(){var ad=3D$(this).attr("name"),ae=3D$= (this).val();ac[ad]=3Dae});return ac},get_param_values:function(){var ac=3D= [];this.parent_div.find(":input").each(function(){var ad=3D$(this).attr("na= me"),ae=3D$(this).val();if(ad){ac[ac.length]=3Dae}});return ac},run_on_data= set:function(){var ac=3Dthis;ac.run({target_dataset_id:this.track.original_= dataset_id,tool_id:ac.name},null,function(ad){show_modal(ac.name+" is Runni= ng",ac.name+" is running on the complete dataset. Tool outputs are in datas= et's history.",{Close:hide_modal})})},run_on_region:function(){var ad=3D{ta= rget_dataset_id:this.track.original_dataset_id,action:"rerun",tool_id:this.= name,regions:[{chrom:this.track.view.chrom,start:this.track.view.low,end:th= is.track.view.high}]},ah=3Dthis.track,ae=3Dad.tool_id+ah.tool_region_and_pa= rameters_str(ad.chrom,ad.low,ad.high),ac;if(ah.container=3D=3D=3Dview){var = ag=3Dnew P(view,view,{name:this.name});var af=3Dah.container.replace_drawab= le(ah,ag,false);ag.container_div.insertBefore(ah.view.content_div.children(= )[af]);ag.add_drawable(ah);ah.container_div.appendTo(ag.content_div);ac=3Da= g}else{ac=3Dah.container}var ai=3Dnew ah.constructor(view,ac,{name:ae,hda_l= dda:"hda"});ai.init_for_tool_data();ai.change_mode(ah.mode);ai.set_filters_= manager(ah.filters_manager.copy(ai));ai.update_icons();ac.add_drawable(ai);= ai.tiles_div.text("Starting job.");this.update_params();this.run(ad,ai,func= tion(aj){ai.set_dataset(new Z.Dataset(aj));ai.tiles_div.text("Running job."= );ai.init()})},run:function(ac,ae,af){ac.inputs=3Dthis.get_param_values_dic= t();var ad=3Dnew l.ServerStateDeferred({ajax_settings:{url:galaxy_paths.get= ("tool_url"),data:JSON.stringify(ac),dataType:"json",contentType:"applicati= on/json",type:"POST"},interval:2000,success_fn:function(ag){return ag!=3D= =3D"pending"}});$.when(ad.go()).then(function(ag){if(ag=3D=3D=3D"no convert= er"){ae.container_div.addClass("error");ae.content_div.text(J)}else{if(ag.e= rror){ae.container_div.addClass("error");ae.content_div.text(y+ag.message)}= else{af(ag)}}})}});var N=3Dfunction(ad,ac,ae,af){this.name=3Dad;this.label= =3Dac;this.html=3D$(ae);this.value=3Daf};q(N.prototype,{update_value:functi= on(){this.value=3D$(this.html).val()}});var e=3Dfunction(ae,ad,ag,ah,af,ac)= {N.call(this,ae,ad,ag,ah);this.min=3Daf;this.max=3Dac};q(e.prototype,N.prot= otype,{update_value:function(){N.prototype.update_value.call(this);this.val= ue=3DparseFloat(this.value)}});var C=3Dfunction(ac,ad){L.Scaler.call(this,a= d);this.filter=3Dac};C.prototype.gen_val=3Dfunction(ac){if(this.filter.high= =3D=3D=3DNumber.MAX_VALUE||this.filter.low=3D=3D=3D-Number.MAX_VALUE||this.= filter.low=3D=3D=3Dthis.filter.high){return this.default_val}return((parseF= loat(ac[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.= low))};var F=3Dfunction(ac){this.track=3Dac.track;this.params=3Dac.params;t= his.values=3D{};this.restore_values((ac.saved_values?ac.saved_values:{}));t= his.onchange=3Dac.onchange};q(F.prototype,{restore_values:function(ac){var = ad=3Dthis;$.each(this.params,function(ae,af){if(ac[af.key]!=3D=3Dundefined)= {ad.values[af.key]=3Dac[af.key]}else{ad.values[af.key]=3Daf.default_value}}= )},build_form:function(){var af=3Dthis;var ac=3D$("<div />");var ae;functio= n ad(ak,ag){for(var ao=3D0;ao<ak.length;ao++){ae=3Dak[ao];if(ae.hidden){con= tinue}var ai=3D"param_"+ao;var at=3Daf.values[ae.key];var av=3D$("<div clas= s=3D'form-row' />").appendTo(ag);av.append($("<label />").attr("for",ai).te= xt(ae.label+":"));if(ae.type=3D=3D=3D"bool"){av.append($('<input type=3D"ch= eckbox" />').attr("id",ai).attr("name",ai).attr("checked",at))}else{if(ae.t= ype=3D=3D=3D"text"){av.append($('<input type=3D"text"/>').attr("id",ai).val= (at).click(function(){$(this).select()}))}else{if(ae.type=3D=3D=3D"select")= {var aq=3D$("<select />").attr("id",ai);for(var am=3D0;am<ae.options.length= ;am++){$("<option/>").text(ae.options[am].label).attr("value",ae.options[am= ].value).appendTo(aq)}aq.val(at);av.append(aq)}else{if(ae.type=3D=3D=3D"col= or"){var au=3D$("<div/>").appendTo(av),ap=3D$("<input />").attr("id",ai).at= tr("name",ai).val(at).css("float","left").appendTo(au).click(function(ax){$= (".bs-tooltip").removeClass("in");var aw=3D$(this).siblings(".bs-tooltip").= addClass("in");aw.css({left:$(this).position().left+$(this).width()+5,top:$= (this).position().top-($(aw).height()/2)+($(this).height()/2)}).show();aw.c= lick(function(ay){ay.stopPropagation()});$(document).bind("click.color-pick= er",function(){aw.hide();$(document).unbind("click.color-picker")});ax.stop= Propagation()}),an=3D$("<a href=3D'javascript:void(0)'/>").addClass("icon-b= utton arrow-circle").appendTo(au).attr("title","Set new random color").tool= tip(),ar=3D$("<div class=3D'bs-tooltip right' style=3D'position: absolute;'= />").appendTo(au).hide(),aj=3D$("<div class=3D'tooltip-inner' style=3D'tex= t-align: inherit'></div>").appendTo(ar),ah=3D$("<div class=3D'tooltip-arrow= '></div>").appendTo(ar),al=3D$.farbtastic(aj,{width:100,height:100,callback= :ap,color:at});au.append($("<div/>").css("clear","both"));(function(aw){an.= click(function(){aw.setColor(l.get_random_color())})})(al)}else{av.append($= ("<input />").attr("id",ai).attr("name",ai).val(at))}}}}if(ae.help){av.appe= nd($("<div class=3D'help'/>").text(ae.help))}}}ad(this.params,ac);return ac= },update_from_form:function(ac){var ae=3Dthis;var ad=3Dfalse;$.each(this.pa= rams,function(af,ah){if(!ah.hidden){var ai=3D"param_"+af;var ag=3Dac.find("= #"+ai).val();if(ah.type=3D=3D=3D"float"){ag=3DparseFloat(ag)}else{if(ah.typ= e=3D=3D=3D"int"){ag=3DparseInt(ag)}else{if(ah.type=3D=3D=3D"bool"){ag=3Dac.= find("#"+ai).is(":checked")}}}if(ag!=3D=3Dae.values[ah.key]){ae.values[ah.k= ey]=3Dag;ad=3Dtrue}}});if(ad){this.onchange();this.track.changed()}}});var = b=3Dfunction(ac,ag,ae,ad,af){this.track=3Dac;this.region=3Dag;this.low=3Dag= .get("start");this.high=3Dag.get("end");this.resolution=3Dae;this.html_elt= =3D$("<div class=3D'track-tile'/>").append(ad).height($(ad).attr("height"))= ;this.data=3Daf;this.stale=3Dfalse};b.prototype.predisplay_actions=3Dfuncti= on(){};var j=3Dfunction(ac,ah,ae,ad,af,ag){b.call(this,ac,ah,ae,ad,af);this= .max_val=3Dag};q(j.prototype,b.prototype);var O=3Dfunction(af,an,ag,ae,ai,a= p,aj,aq,ad,am){b.call(this,af,an,ag,ae,ai);this.mode=3Daj;this.all_slotted= =3Dad;this.feature_mapper=3Dam;this.has_icons=3Dfalse;if(aq){this.has_icons= =3Dtrue;var ak=3Dthis;ae=3Dthis.html_elt.children()[0],message_div=3D$("<di= v/>").addClass("tile-message").css({height:D-1,width:ae.width}).prependTo(t= his.html_elt);var al=3Dnew x.GenomeRegion({chrom:af.view.chrom,start:this.l= ow,end:this.high}),ao=3Dai.length,ah=3D$("<a href=3D'javascript:void(0);'/>= ").addClass("icon more-down").attr("title","For speed, only the first "+ao+= " features in this region were obtained from server. Click to get more data= including depth").tooltip().appendTo(message_div),ac=3D$("<a href=3D'javas= cript:void(0);'/>").addClass("icon more-across").attr("title","For speed, o= nly the first "+ao+" features in this region were obtained from server. Cli= ck to get more data excluding depth").tooltip().appendTo(message_div);ah.cl= ick(function(){ak.stale=3Dtrue;af.data_manager.get_more_data(al,af.mode,ak.= resolution,{},af.data_manager.DEEP_DATA_REQ);$(".bs-tooltip").hide();af.req= uest_draw(true)}).dblclick(function(ar){ar.stopPropagation()});ac.click(fun= ction(){ak.stale=3Dtrue;af.data_manager.get_more_data(al,af.mode,ak.resolut= ion,{},af.data_manager.BROAD_DATA_REQ);$(".bs-tooltip").hide();af.request_d= raw(true)}).dblclick(function(ar){ar.stopPropagation()})}};q(O.prototype,b.= prototype);O.prototype.predisplay_actions=3Dfunction(){var ad=3Dthis,ac=3D{= };if(ad.mode!=3D=3D"Pack"){return}$(this.html_elt).hover(function(){this.ho= vered=3Dtrue;$(this).mousemove()},function(){this.hovered=3Dfalse;$(this).p= arents(".track-content").children(".overlay").children(".feature-popup").re= move()}).mousemove(function(ao){if(!this.hovered){return}var aj=3D$(this).o= ffset(),an=3Dao.pageX-aj.left,am=3Dao.pageY-aj.top,at=3Dad.feature_mapper.g= et_feature_data(an,am),ak=3D(at?at[0]:null);$(this).parents(".track-content= ").children(".overlay").children(".feature-popup").each(function(){if(!ak||= $(this).attr("id")!=3D=3Dak.toString()){$(this).remove()}});if(at){var af= =3Dac[ak];if(!af){var ak=3Dat[0],ap=3D{name:at[3],start:at[1],end:at[2],str= and:at[4]},ai=3Dad.track.filters_manager.filters,ah;for(var al=3D0;al<ai.le= ngth;al++){ah=3Dai[al];ap[ah.name]=3Dat[ah.index]}var af=3D$("<div/>").attr= ("id",ak).addClass("feature-popup"),au=3D$("<table/>"),ar,aq,av;for(ar in a= p){aq=3Dap[ar];av=3D$("<tr/>").appendTo(au);$("<th/>").appendTo(av).text(ar= );$("<td/>").attr("align","left").appendTo(av).text(typeof(aq)=3D=3D=3D"num= ber"?W(aq,2):aq)}af.append($("<div class=3D'feature-popup-inner'>").append(= au));ac[ak]=3Daf}af.appendTo($(this).parents(".track-content").children(".o= verlay"));var ag=3Dan+parseInt(ad.html_elt.css("left"))-af.width()/2,ae=3Da= m+parseInt(ad.html_elt.css("top"))+7;af.css("left",ag+"px").css("top",ae+"p= x")}else{if(!ao.isPropagationStopped()){ao.stopPropagation();$(this).siblin= gs().each(function(){$(this).trigger(ao)})}}}).mouseleave(function(){$(this= ).parents(".track-content").children(".overlay").children(".feature-popup")= .remove()})};var g=3Dfunction(ad,ac,ae){q(ae,{drag_handle_class:"draghandle= "});r.call(this,ad,ac,ae);this.dataset=3Dnew Z.Dataset({id:ae.dataset_id,hd= a_ldda:ae.hda_ldda});this.dataset_check_type=3D"converted_datasets_state";t= his.data_url_extra_params=3D{};this.data_query_wait=3D("data_query_wait" in= ae?ae.data_query_wait:K);this.data_manager=3D("data_manager" in ae?ae.data= _manager:new x.GenomeDataManager({dataset:this.dataset,data_mode_compatible= :this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_heigh= t_px=3D16;this.max_height_px=3D800;this.visible_height_px=3D0;this.content_= div=3D$("<div class=3D'track-content'>").appendTo(this.container_div);if(th= is.container){this.container.content_div.append(this.container_div);if(!("r= esize" in ae)||ae.resize){this.add_resize_handle()}}};q(g.prototype,r.proto= type,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_clas= s:"chevron-expand",on_click_fn:function(){}},r.prototype.action_icons_def[0= ],{name:"overview_icon",title:"Set as overview",css_class:"overview-icon",o= n_click_fn:function(ac){ac.view.set_overview(ac)}},r.prototype.action_icons= _def[1],{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_cl= ick_fn:function(ac){if(ac.filters_manager.visible()){ac.filters_manager.cle= ar_filters()}else{ac.filters_manager.init_filters()}ac.filters_manager.togg= le()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:funct= ion(ac){ac.dynamic_tool_div.toggle();if(ac.dynamic_tool_div.is(":visible"))= {ac.set_name(ac.name+ac.tool_region_and_parameters_str())}else{ac.revert_na= me()}$(".bs-tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool p= arameter space visualization",css_class:"arrow-split",on_click_fn:function(= ac){var af=3D'<strong>Tool</strong>: <%=3D track.tool.name %><br/><strong>D= ataset</strong>: <%=3D track.name %><br/><strong>Region(s)</strong>: <selec= t name=3D"regions"><option value=3D"cur">current viewing area</option><opti= on value=3D"bookmarks">bookmarks</option><option value=3D"both">current vie= wing area and bookmarks</option></select>',ae=3Dab.template(af,{track:ac});= var ah=3Dfunction(){hide_modal();$(window).unbind("keypress.check_enter_esc= ")},ad=3Dfunction(){var aj=3D$('select[name=3D"regions"] option:selected').= val(),al,ai=3Dnew x.GenomeRegion({chrom:view.chrom,start:view.low,end:view.= high}),ak=3Dab.map($(".bookmark"),function(am){return new x.GenomeRegion({f= rom_str:$(am).children(".position").text()})});if(aj=3D=3D=3D"cur"){al=3D[a= i]}else{if(aj=3D=3D=3D"bookmarks"){al=3Dak}else{al=3D[ai].concat(ak)}}hide_= modal();window.location.href=3Dgalaxy_paths.get("sweepster_url")+"?"+$.para= m({dataset_id:ac.dataset_id,hda_ldda:ac.hda_ldda,regions:JSON.stringify(new= Backbone.Collection(al).toJSON())})},ag=3Dfunction(ai){if((ai.keyCode||ai.= which)=3D=3D=3D27){ah()}else{if((ai.keyCode||ai.which)=3D=3D=3D13){ad()}}};= show_modal("Visualize tool parameter space and output from different parame= ter settings?",ae,{No:ah,Yes:ad})}},r.prototype.action_icons_def[2]],can_dr= aw:function(){if(this.dataset_id&&r.prototype.can_draw.call(this)){return t= rue}return false},build_container_div:function(){return $("<div/>").addClas= s("track").attr("id","track_"+this.id).css("position","relative")},build_he= ader_div:function(){var ac=3D$("<div class=3D'track-header'/>");if(this.vie= w.editor){this.drag_div=3D$("<div/>").addClass(this.drag_handle_class).appe= ndTo(ac)}this.name_div=3D$("<div/>").addClass("track-name").appendTo(ac).te= xt(this.name).attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\= -]/g,"").toLowerCase());return ac},on_resize:function(){},add_resize_handle= :function(){var ac=3Dthis;var af=3Dfalse;var ae=3Dfalse;var ad=3D$("<div cl= ass=3D'track-resize'>");$(ac.container_div).hover(function(){if(ac.content_= visible){af=3Dtrue;ad.show()}},function(){af=3Dfalse;if(!ae){ad.hide()}});a= d.hide().bind("dragstart",function(ag,ah){ae=3Dtrue;ah.original_height=3D$(= ac.content_div).height()}).bind("drag",function(ah,ai){var ag=3DMath.min(Ma= th.max(ai.original_height+ai.deltaY,ac.min_height_px),ac.max_height_px);$(a= c.tiles_div).css("height",ag);ac.visible_height_px=3D(ac.max_height_px=3D= =3D=3Dag?0:ag);ac.on_resize()}).bind("dragend",function(ag,ah){ac.tile_cach= e.clear();ae=3Dfalse;if(!af){ad.hide()}ac.config.values.height=3Dac.visible= _height_px;ac.changed()}).appendTo(ac.container_div)},set_display_modes:fun= ction(af,ai){this.display_modes=3Daf;this.mode=3D(ai?ai:(this.config&&this.= config.values.mode?this.config.values.mode:this.display_modes[0]));this.act= ion_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");v= ar ad=3Dthis,ag=3D{};for(var ae=3D0,ac=3Dad.display_modes.length;ae<ac;ae++= ){var ah=3Dad.display_modes[ae];ag[ah]=3Dfunction(aj){return function(){ad.= change_mode(aj);ad.icons_div.show();ad.container_div.mouseleave(function(){= ad.icons_div.hide()})}}(ah)}make_popupmenu(this.action_icons.mode_icon,ag)}= ,build_action_icons:function(){r.prototype.build_action_icons.call(this,thi= s.action_icons_def);if(this.display_modes!=3D=3Dundefined){this.set_display= _modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide()= ;this.container_div.find(".yaxislabel, .track-resize").hide()},show_content= s:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .t= rack-resize").show();this.request_draw()},get_type:function(){if(this insta= nceof X){return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrac= k"}else{if(this instanceof h){return"LineTrack"}else{if(this instanceof T){= return"ReadTrack"}else{if(this instanceof R){return"VcfTrack"}else{if(this = instanceof f){return"CompositeTrack"}else{if(this instanceof c){return"Feat= ureTrack"}}}}}}}return""},init:function(){var ad=3Dthis;ad.enabled=3Dfalse;= ad.tile_cache.clear();ad.data_manager.clear();ad.content_div.css("height","= auto");ad.tiles_div.children().remove();ad.container_div.removeClass("nodat= a error pending");if(!ad.dataset_id){return}var ac=3D$.Deferred(),ae=3D{hda= _ldda:ad.hda_ldda,data_type:this.dataset_check_type,chrom:ad.view.chrom};$.= getJSON(this.dataset.url(),ae,function(af){if(!af||af=3D=3D=3D"error"||af.k= ind=3D=3D=3D"error"){ad.container_div.addClass("error");ad.tiles_div.text(o= );if(af.message){var ag=3D$(" <a href=3D'javascript:void(0);'></a>").text("= View error").click(function(){show_modal("Trackster Error","<pre>"+af.messa= ge+"</pre>",{Close:hide_modal})});ad.tiles_div.append(ag)}}else{if(af=3D=3D= =3D"no converter"){ad.container_div.addClass("error");ad.tiles_div.text(J)}= else{if(af=3D=3D=3D"no data"||(af.data!=3D=3Dundefined&&(af.data=3D=3D=3Dnu= ll||af.data.length=3D=3D=3D0))){ad.container_div.addClass("nodata");ad.tile= s_div.text(E)}else{if(af=3D=3D=3D"pending"){ad.container_div.addClass("pend= ing");ad.tiles_div.html(v);setTimeout(function(){ad.init()},ad.data_query_w= ait)}else{if(af=3D=3D=3D"data"||af.status=3D=3D=3D"data"){if(af.valid_chrom= s){ad.valid_chroms=3Daf.valid_chroms;ad.update_icons()}ad.tiles_div.text(U)= ;if(ad.view.chrom){ad.tiles_div.text("");ad.tiles_div.css("height",ad.visib= le_height_px+"px");ad.enabled=3Dtrue;$.when(ad.predraw_init()).done(functio= n(){ac.resolve();ad.container_div.removeClass("nodata error pending");ad.re= quest_draw()})}else{ac.resolve()}}}}}}});this.update_icons();return ac},pre= draw_init:function(){},get_drawables:function(){return this}});var M=3Dfunc= tion(ae,ad,af){g.call(this,ae,ad,af);var ac=3Dthis;m(ac.container_div,ac.dr= ag_handle_class,".group",ac);this.filters_manager=3Dnew i.FiltersManager(th= is,("filters" in af?af.filters:null));this.data_manager.set("filters_manage= r",this.filters_manager);this.filters_available=3Dfalse;this.tool=3D("tool"= in af&&af.tool?new s(this,af.tool,af.tool_state):null);this.tile_cache=3Dn= ew x.Cache(Q);if(this.header_div){this.set_filters_manager(this.filters_man= ager);if(this.tool){this.dynamic_tool_div=3Dthis.tool.parent_div;this.heade= r_div.after(this.dynamic_tool_div)}}this.tiles_div=3D$("<div/>").addClass("= tiles").appendTo(this.content_div);this.overlay_div=3D$("<div/>").addClass(= "overlay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)= }};q(M.prototype,r.prototype,g.prototype,{action_icons_def:g.prototype.acti= on_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track h= eight, not all feature rows are displayed. Click to display more rows.",css= _class:"exclamation",on_click_fn:function(ac){$(".bs-tooltip").remove();ac.= slotters[ac.view.resolution_px_b].max_rows*=3D2;ac.request_draw(true)},hide= :true}]),copy:function(ac){var ad=3Dthis.to_dict();q(ad,{data_manager:this.= data_manager});var ae=3Dnew this.constructor(this.view,ac,ad);ae.change_mod= e(this.mode);ae.enabled=3Dthis.enabled;return ae},set_filters_manager:funct= ion(ac){this.filters_manager=3Dac;this.header_div.after(this.filters_manage= r.parent_div)},to_dict:function(){return{track_type:this.get_type(),name:th= is.name,hda_ldda:this.hda_ldda,dataset_id:this.dataset_id,prefs:this.prefs,= mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool= ?this.tool.state_dict():{})}},change_mode:function(ad){var ac=3Dthis;ac.mod= e=3Dad;ac.config.values.mode=3Dad;ac.tile_cache.clear();ac.request_draw();t= his.action_icons.mode_icon.attr("title","Set display mode (now: "+ac.mode+"= )");return ac},update_icons:function(){var ac=3Dthis;if(ac.filters_availabl= e){ac.action_icons.filters_icon.show()}else{ac.action_icons.filters_icon.hi= de()}if(ac.tool){ac.action_icons.tools_icon.show();ac.action_icons.param_sp= ace_viz_icon.show()}else{ac.action_icons.tools_icon.hide();ac.action_icons.= param_space_viz_icon.hide()}},_gen_tile_cache_key:function(ad,ae,ac){return= ad+"_"+ae+"_"+ac},request_draw:function(ad,ac){this.view.request_redraw(fa= lse,ad,ac,this)},before_draw:function(){},_draw:function(ad,an){if(!this.ca= n_draw()){return}var al=3Dthis.view.low,ah=3Dthis.view.high,aj=3Dah-al,ae= =3Dthis.view.container.width(),ap=3Dthis.view.resolution_px_b,ag=3Dthis.vie= w.resolution_b_px;if(this.is_overview){al=3Dthis.view.max_low;ah=3Dthis.vie= w.max_high;ag=3D(view.max_high-view.max_low)/ae;ap=3D1/ag}this.before_draw(= );this.tiles_div.children().addClass("remove");var ac=3DMath.floor(al/(ag*S= )),ak=3Dtrue,ao=3D[],ai=3Dfunction(aq){return(aq&&"track" in aq)};while((ac= *S*ag)<ah){var am=3Dthis.draw_helper(ad,ae,ac,ag,this.tiles_div,ap);if(ai(a= m)){ao.push(am)}else{ak=3Dfalse}ac+=3D1}if(!an){this.tiles_div.children(".r= emove").removeClass("remove").remove()}var af=3Dthis;if(ak){this.tiles_div.= children(".remove").remove();af.postdraw_actions(ao,ae,ap,an)}},postdraw_ac= tions:function(ae,af,ah,ac){var ag=3Dfalse;for(var ad=3D0;ad<ae.length;ad++= ){if(ae[ad].has_icons){ag=3Dtrue;break}}if(ag){for(var ad=3D0;ad<ae.length;= ad++){tile=3Dae[ad];if(!tile.has_icons){tile.html_elt.css("padding-top",D)}= }}},draw_helper:function(ac,ao,au,ar,ah,ai,ap){var an=3Dthis,ax=3Dthis._gen= _tile_cache_key(ao,ai,au),af=3Dthis._get_tile_bounds(au,ar);if(!ap){ap=3D{}= }var aw=3D(ac?undefined:an.tile_cache.get_elt(ax));if(aw){an.show_tile(aw,a= h,ai);return aw}var al=3Dtrue;var at=3Dan.data_manager.get_data(af,an.mode,= ar,an.data_url_extra_params);if(V(at)){al=3Dfalse}var aj;if(view.reference_= track&&ai>view.canvas_manager.char_width_px){aj=3Dview.reference_track.data= _manager.get_data(af,an.mode,ar,view.reference_track.data_url_extra_params)= ;if(V(aj)){al=3Dfalse}}if(al){q(at,ap.more_tile_data);var ak=3Dan.mode;if(a= k=3D=3D=3D"Auto"){ak=3Dan.get_mode(at);an.update_auto_mode(ak)}var ae=3Dan.= view.canvas_manager.new_canvas(),av=3Daf.get("start"),ad=3Daf.get("end"),ao= =3DMath.ceil((ad-av)*ai)+an.left_offset,am=3Dan.get_canvas_height(at,ak,ai,= ao);ae.width=3Dao;ae.height=3Dam;var aq=3Dae.getContext("2d");aq.translate(= this.left_offset,0);var aw=3Dan.draw_tile(at,aq,ak,ar,af,ai,aj);if(aw!=3D= =3Dundefined){an.tile_cache.set_elt(ax,aw);an.show_tile(aw,ah,ai)}return aw= }var ag=3D$.Deferred();$.when(at,aj).then(function(){view.request_redraw(fa= lse,false,false,an);ag.resolve()});return ag},get_canvas_height:function(ac= ,ae,af,ad){return this.visible_height_px},draw_tile:function(ac,ad,ah,af,ag= ,ai,ae){console.log("Warning: TiledTrack.draw_tile() not implemented.")},sh= ow_tile:function(ae,ah,ai){var ad=3Dthis,ac=3Dae.html_elt;ae.predisplay_act= ions();var ag=3D(ae.low-(this.is_overview?this.view.max_low:this.view.low))= *ai;if(this.left_offset){ag-=3Dthis.left_offset}ac.css({position:"absolute"= ,top:0,left:ag});if(ac.hasClass("remove")){ac.removeClass("remove")}else{ah= .append(ac)}ae.html_elt.height("auto");this.max_height_px=3DMath.max(this.m= ax_height_px,ae.html_elt.height());ae.html_elt.parent().children().css("hei= ght",this.max_height_px+"px");var af=3Dthis.max_height_px;if(this.visible_h= eight_px!=3D=3D0){af=3DMath.min(this.max_height_px,this.visible_height_px)}= this.tiles_div.css("height",af+"px")},_get_tile_bounds:function(ac,ad){var = af=3DMath.floor(ac*S*ad),ag=3DMath.ceil(S*ad),ae=3D(af+ag<=3Dthis.view.max_= high?af+ag:this.view.max_high);return new x.GenomeRegion({chrom:this.view.c= hrom,start:af,end:ae})},tool_region_and_parameters_str:function(ae,ac,af){v= ar ad=3Dthis,ag=3D(ae!=3D=3Dundefined&&ac!=3D=3Dundefined&&af!=3D=3Dundefin= ed?ae+":"+ac+"-"+af:"all");return" - region=3D["+ag+"], parameters=3D["+ad.= tool.get_param_values().join(", ")+"]"},data_and_mode_compatible:function(a= c,ad){return true},can_subset:function(ac){return false},init_for_tool_data= :function(){this.data_manager.set("data_type","raw_data");this.data_query_w= ait=3D1000;this.dataset_check_type=3D"state";this.normal_postdraw_actions= =3Dthis.postdraw_actions;this.postdraw_actions=3Dfunction(ae,af,ah,ac){var = ad=3Dthis;ad.normal_postdraw_actions(ae,af,ah,ac);ad.dataset_check_type=3D"= converted_datasets_state";ad.data_query_wait=3DK;var ag=3Dnew l.ServerState= Deferred({url:ad.dataset_state_url,url_params:{dataset_id:ad.dataset_id,hda= _ldda:ad.hda_ldda},interval:ad.data_query_wait,success_fn:function(ai){retu= rn ai!=3D=3D"pending"}});$.when(ag.go()).then(function(){ad.data_manager.se= t("data_type","data")});ad.postdraw_actions=3Dad.normal_postdraw_actions}}}= );var X=3Dfunction(ad,ac){var ae=3D{resize:false};g.call(this,ad,ac,ae);thi= s.container_div.addClass("label-track")};q(X.prototype,g.prototype,{build_h= eader_div:function(){},init:function(){this.enabled=3Dtrue},_draw:function(= ){var ae=3Dthis.view,af=3Dae.high-ae.low,ai=3DMath.floor(Math.pow(10,Math.f= loor(Math.log(af)/Math.log(10)))),ac=3DMath.floor(ae.low/ai)*ai,ag=3Dthis.v= iew.container.width(),ad=3D$("<div style=3D'position: relative; height: 1.3= em;'></div>");while(ac<ae.high){var ah=3D(ac-ae.low)/af*ag;ad.append($("<di= v class=3D'label'>"+commatize(ac)+"</div>").css({position:"absolute",left:a= h-1}));ac+=3Dai}this.content_div.children(":first").remove();this.content_d= iv.append(ad)}});var f=3Dfunction(ad,ac,ag){M.call(this,ad,ac,ag);this.draw= ables=3D[];this.left_offset=3D0;if("drawables" in ag){var af;for(var ae=3D0= ;ae<ag.drawables.length;ae++){af=3Dag.drawables[ae];this.drawables[ae]=3Dp(= af,ad,null);if(af.left_offset>this.left_offset){this.left_offset=3Daf.left_= offset}}this.enabled=3Dtrue}if(this.drawables.length!=3D=3D0){this.set_disp= lay_modes(this.drawables[0].display_modes,this.drawables[0].mode)}this.upda= te_icons();this.obj_type=3D"CompositeTrack"};q(f.prototype,M.prototype,{act= ion_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_cl= ass:"layers-stack",on_click_fn:function(ac){$(".bs-tooltip").remove();ac.sh= ow_group()}}].concat(M.prototype.action_icons_def),to_dict:z.prototype.to_d= ict,add_drawable:z.prototype.add_drawable,unpack_drawables:z.prototype.unpa= ck_drawables,change_mode:function(ac){M.prototype.change_mode.call(this,ac)= ;for(var ad=3D0;ad<this.drawables.length;ad++){this.drawables[ad].change_mo= de(ac)}},init:function(){var ae=3D[];for(var ad=3D0;ad<this.drawables.lengt= h;ad++){ae.push(this.drawables[ad].init())}var ac=3Dthis;$.when.apply($,ae)= .then(function(){ac.enabled=3Dtrue;ac.request_draw()})},update_icons:functi= on(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hid= e();this.action_icons.param_space_viz_icon.hide()},can_draw:r.prototype.can= _draw,draw_helper:function(ad,at,az,aw,ak,am,au){var ar=3Dthis,aD=3Dthis._g= en_tile_cache_key(at,am,az),ah=3Dthis._get_tile_bounds(az,aw);if(!au){au=3D= {}}var aC=3D(ad?undefined:ar.tile_cache.get_elt(aD));if(aC){ar.show_tile(aC= ,ak,am);return aC}var al=3D[],ar,ap=3Dtrue,ax,an;for(var ay=3D0;ay<this.dra= wables.length;ay++){ar=3Dthis.drawables[ay];ax=3Dar.data_manager.get_data(a= h,ar.mode,aw,ar.data_url_extra_params);if(V(ax)){ap=3Dfalse}al.push(ax);an= =3Dnull;if(view.reference_track&&am>view.canvas_manager.char_width_px){an= =3Dview.reference_track.data_manager.get_data(ah,ar.mode,aw,view.reference_= track.data_url_extra_params);if(V(an)){ap=3Dfalse}}al.push(an)}if(ap){q(ax,= au.more_tile_data);this.tile_predraw_init();var ag=3Dar.view.canvas_manager= .new_canvas(),ai=3Dar._get_tile_bounds(az,aw),aA=3Dah.get("start"),ae=3Dah.= get("end"),aB=3D0,at=3DMath.ceil((ae-aA)*am)+this.left_offset,aq=3D0,af=3D[= ],ay;var ac=3D0;for(ay=3D0;ay<this.drawables.length;ay++,aB+=3D2){ar=3Dthis= .drawables[ay];ax=3Dal[aB];var ao=3Dar.mode;if(ao=3D=3D=3D"Auto"){ao=3Dar.g= et_mode(ax);ar.update_auto_mode(ao)}af.push(ao);ac=3Dar.get_canvas_height(a= x,ao,am,at);if(ac>aq){aq=3Dac}}ag.width=3Dat;ag.height=3D(au.height?au.heig= ht:aq);aB=3D0;var av=3Dag.getContext("2d");av.translate(this.left_offset,0)= ;av.globalAlpha=3D0.5;av.globalCompositeOperation=3D"source-over";for(ay=3D= 0;ay<this.drawables.length;ay++,aB+=3D2){ar=3Dthis.drawables[ay];ax=3Dal[aB= ];an=3Dal[aB+1];aC=3Dar.draw_tile(ax,av,af[ay],aw,ah,am,an)}this.tile_cache= .set_elt(aD,aC);this.show_tile(aC,ak,am);return aC}var aj=3D$.Deferred(),ar= =3Dthis;$.when.apply($,al).then(function(){view.request_redraw(false,false,= false,ar);aj.resolve()});return aj},show_group:function(){var af=3Dnew P(th= is.view,this.container,{name:this.name}),ac;for(var ae=3D0;ae<this.drawable= s.length;ae++){ac=3Dthis.drawables[ae];ac.update_icons();af.add_drawable(ac= );ac.container=3Daf;af.content_div.append(ac.container_div)}var ad=3Dthis.c= ontainer.replace_drawable(this,af,true);af.request_draw()},tile_predraw_ini= t:function(){var af=3DNumber.MAX_VALUE,ac=3D-af,ad;for(var ae=3D0;ae<this.d= rawables.length;ae++){ad=3Dthis.drawables[ae];if(ad instanceof h){if(ad.pre= fs.min_value<af){af=3Dad.prefs.min_value}if(ad.prefs.max_value>ac){ac=3Dad.= prefs.max_value}}}for(var ae=3D0;ae<this.drawables.length;ae++){ad=3Dthis.d= rawables[ae];ad.prefs.min_value=3Daf;ad.prefs.max_value=3Dac}},postdraw_act= ions:function(ae,ah,aj,ad){M.prototype.postdraw_actions.call(this,ae,ah,aj,= ad);var ag=3D-1;for(var af=3D0;af<ae.length;af++){var ac=3Dae[af].html_elt.= find("canvas").height();if(ac>ag){ag=3Dac}}for(var af=3D0;af<ae.length;af++= ){var ai=3Dae[af];if(ai.html_elt.find("canvas").height()!=3D=3Dag){this.dra= w_helper(true,ah,ai.index,ai.resolution,ai.html_elt.parent(),aj,{height:ag}= );ai.html_elt.remove()}}}});var B=3Dfunction(ac){M.call(this,ac,{content_di= v:ac.top_labeltrack},{resize:false});ac.reference_track=3Dthis;this.left_of= fset=3D200;this.visible_height_px=3D12;this.container_div.addClass("referen= ce-track");this.content_div.css("background","none");this.content_div.css("= min-height","0px");this.content_div.css("border","none");this.data_url=3Dre= ference_url+"/"+this.view.dbkey;this.data_url_extra_params=3D{reference:tru= e};this.data_manager=3Dnew x.ReferenceTrackDataManager({data_url:this.data_= url});this.hide_contents()};q(B.prototype,r.prototype,M.prototype,{build_he= ader_div:function(){},init:function(){this.data_manager.clear();this.enable= d=3Dtrue},can_draw:r.prototype.can_draw,draw_helper:function(ag,ae,ac,ad,ah= ,ai,af){if(ai>this.view.canvas_manager.char_width_px){return M.prototype.dr= aw_helper.call(this,ag,ae,ac,ad,ah,ai,af)}else{this.hide_contents();return = null}},draw_tile:function(ak,al,ag,af,ai,am){var ae=3Dthis;if(am>this.view.= canvas_manager.char_width_px){if(ak.data=3D=3D=3Dnull){this.hide_contents()= ;return}var ad=3Dal.canvas;al.font=3Dal.canvas.manager.default_font;al.text= Align=3D"center";ak=3Dak.data;for(var ah=3D0,aj=3Dak.length;ah<aj;ah++){var= ac=3DMath.floor(ah*am);al.fillText(ak[ah],ac,10)}this.show_contents();retu= rn new b(ae,ai,af,ad,ak)}this.hide_contents()}});var h=3Dfunction(ae,ad,af)= {var ac=3Dthis;this.display_modes=3D["Histogram","Line","Filled","Intensity= "];this.mode=3D"Histogram";M.call(this,ae,ad,af);this.hda_ldda=3Daf.hda_ldd= a;this.dataset_id=3Daf.dataset_id;this.original_dataset_id=3Dthis.dataset_i= d;this.left_offset=3D0;this.config=3Dnew F({track:this,params:[{key:"name",= label:"Name",type:"text",default_value:this.name},{key:"color",label:"Color= ",type:"color",default_value:l.get_random_color()},{key:"min_value",label:"= Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Ma= x Value",type:"float",default_value:undefined},{key:"mode",type:"string",de= fault_value:this.mode,hidden:true},{key:"height",type:"int",default_value:3= 2,hidden:true}],saved_values:af.prefs,onchange:function(){ac.set_name(ac.pr= efs.name);ac.vertical_range=3Dac.prefs.max_value-ac.prefs.min_value;ac.set_= min_value(ac.prefs.min_value);ac.set_max_value(ac.prefs.max_value)}});this.= prefs=3Dthis.config.values;this.visible_height_px=3Dthis.config.values.heig= ht;this.vertical_range=3Dthis.config.values.max_value-this.config.values.mi= n_value};q(h.prototype,r.prototype,M.prototype,{on_resize:function(){this.r= equest_draw(true)},set_min_value:function(ac){this.prefs.min_value=3Dac;$("= #linetrack_"+this.dataset_id+"_minval").text(this.prefs.min_value);this.til= e_cache.clear();this.request_draw()},set_max_value:function(ac){this.prefs.= max_value=3Dac;$("#linetrack_"+this.dataset_id+"_maxval").text(this.prefs.m= ax_value);this.tile_cache.clear();this.request_draw()},predraw_init:functio= n(){var ac=3Dthis;ac.vertical_range=3Dundefined;return $.getJSON(ac.dataset= .url(),{data_type:"data",stats:true,chrom:ac.view.chrom,low:0,high:ac.view.= max_high,hda_ldda:ac.hda_ldda},function(ad){ac.container_div.addClass("line= -track");var ag=3Dad.data;if(isNaN(parseFloat(ac.prefs.min_value))||isNaN(p= arseFloat(ac.prefs.max_value))){var ae=3Dag.min,ai=3Dag.max;ae=3DMath.floor= (Math.min(0,Math.max(ae,ag.mean-2*ag.sd)));ai=3DMath.ceil(Math.max(0,Math.m= in(ai,ag.mean+2*ag.sd)));ac.prefs.min_value=3Dae;ac.prefs.max_value=3Dai;$(= "#track_"+ac.dataset_id+"_minval").val(ac.prefs.min_value);$("#track_"+ac.d= ataset_id+"_maxval").val(ac.prefs.max_value)}ac.vertical_range=3Dac.prefs.m= ax_value-ac.prefs.min_value;ac.total_frequency=3Dag.total_frequency;ac.cont= ainer_div.find(".yaxislabel").remove();var ah=3D$("<div/>").text(W(ac.prefs= .min_value,3)).make_text_editable({num_cols:6,on_finish:function(aj){$(".bs= -tooltip").remove();var aj=3DparseFloat(aj);if(!isNaN(aj)){ac.set_min_value= (aj)}},help_text:"Set min value"}).addClass("yaxislabel bottom").attr("id",= "linetrack_"+ac.dataset_id+"_minval").prependTo(ac.container_div),af=3D$("<= div/>").text(W(ac.prefs.max_value,3)).make_text_editable({num_cols:6,on_fin= ish:function(aj){$(".bs-tooltip").remove();var aj=3DparseFloat(aj);if(!isNa= N(aj)){ac.set_max_value(aj)}},help_text:"Set max value"}).addClass("yaxisla= bel top").attr("id","linetrack_"+ac.dataset_id+"_maxval").prependTo(ac.cont= ainer_div)})},draw_tile:function(al,aj,ae,ad,ag,ak){var ac=3Daj.canvas,af= =3Dag.get("start"),ai=3Dag.get("end"),ah=3Dnew L.LinePainter(al.data,af,ai,= this.prefs,ae);ah.draw(aj,ac.width,ac.height,ak);return new b(this,ag,ad,ac= ,al.data)},can_subset:function(ac){return false}});var t=3Dfunction(ae,ad,a= f){var ac=3Dthis;this.display_modes=3D["Heatmap"];this.mode=3D"Heatmap";M.c= all(this,ae,ad,af);this.hda_ldda=3Daf.hda_ldda;this.dataset_id=3Daf.dataset= _id;this.original_dataset_id=3Dthis.dataset_id;this.left_offset=3D0;this.co= nfig=3Dnew F({track:this,params:[{key:"name",label:"Name",type:"text",defau= lt_value:this.name},{key:"pos_color",label:"Positive Color",type:"color",de= fault_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color"= ,default_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",d= efault_value:0},{key:"max_value",label:"Max Value",type:"float",default_val= ue:1},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"= height",type:"int",default_value:500,hidden:true}],saved_values:af.prefs,on= change:function(){ac.set_name(ac.prefs.name);ac.vertical_range=3Dac.prefs.m= ax_value-ac.prefs.min_value;ac.set_min_value(ac.prefs.min_value);ac.set_max= _value(ac.prefs.max_value)}});this.prefs=3Dthis.config.values;this.visible_= height_px=3Dthis.config.values.height;this.vertical_range=3Dthis.config.val= ues.max_value-this.config.values.min_value};q(t.prototype,r.prototype,M.pro= totype,{on_resize:function(){this.request_draw(true)},set_min_value:functio= n(ac){this.prefs.min_value=3Dac;this.tile_cache.clear();this.request_draw()= },set_max_value:function(ac){this.prefs.max_value=3Dac;this.tile_cache.clea= r();this.request_draw()},draw_tile:function(am,ak,ah,af,ad,al){var ae=3Dak.= canvas,ac=3Dthis._get_tile_bounds(ad,af),ag=3Dac[0],aj=3Dac[1],ai=3Dnew L.D= iagonalHeatmapPainter(am.data,ag,aj,this.prefs,ah);ai.draw(ak,ae.width,ae.h= eight,al);return new b(this,ad,af,ae,am.data)}});var c=3Dfunction(af,ae,ah)= {var ad=3Dthis;this.display_modes=3D["Auto","Coverage","Dense","Squish","Pa= ck"];M.call(this,af,ae,ah);var ag=3Dl.get_random_color(),ac=3Dl.get_random_= color([ag,"#ffffff"]);this.config=3Dnew F({track:this,params:[{key:"name",l= abel:"Name",type:"text",default_value:this.name},{key:"block_color",label:"= Block color",type:"color",default_value:ag},{key:"reverse_strand_color",lab= el:"Antisense strand color",type:"color",default_value:ac},{key:"label_colo= r",label:"Label color",type:"color",default_value:"black"},{key:"show_count= s",label:"Show summary counts",type:"bool",default_value:true,help:"Show th= e number of items in each bin when drawing summary histogram"},{key:"histog= ram_max",label:"Histogram maximum",type:"float",default_value:null,help:"cl= ear value to set automatically"},{key:"connector_style",label:"Connector st= yle",type:"select",default_value:"fishbones",options:[{label:"Line with arr= ows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"stri= ng",default_value:this.mode,hidden:true},{key:"height",type:"int",default_v= alue:this.visible_height_px,hidden:true}],saved_values:ah.prefs,onchange:fu= nction(){ad.set_name(ad.prefs.name);ad.tile_cache.clear();ad.set_painter_fr= om_config();ad.request_draw()}});this.prefs=3Dthis.config.values;this.visib= le_height_px=3Dthis.config.values.height;this.container_div.addClass("featu= re-track");this.hda_ldda=3Dah.hda_ldda;this.dataset_id=3Dah.dataset_id;this= .original_dataset_id=3Dah.dataset_id;this.show_labels_scale=3D0.001;this.sh= owing_details=3Dfalse;this.summary_draw_height=3D30;this.slotters=3D{};this= .start_end_dct=3D{};this.left_offset=3D200;this.set_painter_from_config()};= q(c.prototype,r.prototype,M.prototype,{set_dataset:function(ac){this.datase= t_id=3Dac.get("id");this.hda_ldda=3Dac.get("hda_ldda");this.dataset=3Dac;th= is.data_manager.set("dataset",ac)},set_painter_from_config:function(){if(th= is.config.values.connector_style=3D=3D=3D"arcs"){this.painter=3DL.ArcLinked= FeaturePainter}else{this.painter=3DL.LinkedFeaturePainter}},before_draw:fun= ction(){this.max_height_px=3D0},postdraw_actions:function(ar,am,ah,ag){M.pr= ototype.postdraw_actions.call(this,ar,ag);var al=3Dthis,ao;if(al.mode=3D=3D= =3D"Coverage"){var ad=3D-1;for(ao=3D0;ao<ar.length;ao++){var an=3Dar[ao].ma= x_val;if(an>ad){ad=3Dan}}for(ao=3D0;ao<ar.length;ao++){var au=3Dar[ao];if(a= u.max_val!=3D=3Dad){au.html_elt.remove();al.draw_helper(true,am,au.index,au= .resolution,au.html_elt.parent(),ah,{more_tile_data:{max:ad}})}}}if(al.filt= ers_manager){var ai=3Dal.filters_manager.filters;for(var aq=3D0;aq<ai.lengt= h;aq++){ai[aq].update_ui_elt()}var at=3Dfalse,ac,aj;for(ao=3D0;ao<ar.length= ;ao++){if(ar[ao].data.length){ac=3Dar[ao].data[0];for(var aq=3D0;aq<ai.leng= th;aq++){aj=3Dai[aq];if(aj.applies_to(ac)&&aj.min!=3D=3Daj.max){at=3Dtrue;b= reak}}}}if(al.filters_available!=3D=3Dat){al.filters_available=3Dat;if(!al.= filters_available){al.filters_manager.hide()}al.update_icons()}}this.contai= ner_div.find(".yaxislabel").remove();var af=3Dar[0];if(af instanceof j){var= ak=3D(this.prefs.histogram_max?this.prefs.histogram_max:af.max_val),ae=3D$= ("<div/>").text(ak).make_text_editable({num_cols:12,on_finish:function(av){= $(".bs-tooltip").remove();var av=3DparseFloat(av);al.prefs.histogram_max=3D= (!isNaN(av)?av:null);al.tile_cache.clear();al.request_draw()},help_text:"Se= t max value; leave blank to use default"}).addClass("yaxislabel top").css("= color",this.prefs.label_color);this.container_div.prepend(ae)}if(af instanc= eof O){var ap=3Dtrue;for(ao=3D0;ao<ar.length;ao++){if(!ar[ao].all_slotted){= ap=3Dfalse;break}}if(!ap){this.action_icons.show_more_rows_icon.show()}else= {this.action_icons.show_more_rows_icon.hide()}}else{this.action_icons.show_= more_rows_icon.hide()}},update_auto_mode:function(ac){var ac;if(this.mode= =3D=3D=3D"Auto"){if(ac=3D=3D=3D"no_detail"){ac=3D"feature spans"}else{if(ac= =3D=3D=3D"summary_tree"){ac=3D"coverage histogram"}}this.action_icons.mode_= icon.attr("title","Set display mode (now: Auto/"+ac+")")}},incremental_slot= s:function(ag,ac,af){var ad=3Dthis.view.canvas_manager.dummy_context,ae=3Dt= his.slotters[ag];if(!ae||(ae.mode!=3D=3Daf)){ae=3Dnew (u.FeatureSlotter)(ag= ,af,A,function(ah){return ad.measureText(ah)});this.slotters[ag]=3Dae}retur= n ae.slot_features(ac)},get_mode:function(ac){if(ac.dataset_type=3D=3D=3D"s= ummary_tree"){mode=3D"summary_tree"}else{if(ac.extra_info=3D=3D=3D"no_detai= l"||this.is_overview){mode=3D"no_detail"}else{if(this.view.high-this.view.l= ow>I){mode=3D"Squish"}else{mode=3D"Pack"}}}return mode},get_canvas_height:f= unction(ac,ag,ah,ad){if(ag=3D=3D=3D"summary_tree"||ag=3D=3D=3D"Coverage"){r= eturn this.summary_draw_height}else{var af=3Dthis.incremental_slots(ah,ac.d= ata,ag);var ae=3Dnew (this.painter)(null,null,null,this.prefs,ag);return Ma= th.max(aa,ae.get_required_height(af,ad))}},draw_tile:function(am,aq,ao,ar,a= f,aj,ae){var ap=3Dthis,ad=3Daq.canvas,ay=3Daf.get("start"),ac=3Daf.get("end= "),ag=3Dthis.left_offset;if(ao=3D=3D=3D"summary_tree"||ao=3D=3D=3D"Coverage= "){var aA=3Dnew L.SummaryTreePainter(am,ay,ac,this.prefs);aA.draw(aq,ad.wid= th,ad.height,aj);return new j(ap,af,ar,ad,am.data,am.max)}var ai=3D[],an=3D= this.slotters[aj].slots;all_slotted=3Dtrue;if(am.data){var ak=3Dthis.filter= s_manager.filters;for(var at=3D0,av=3Dam.data.length;at<av;at++){var ah=3Da= m.data[at];var au=3Dfalse;var al;for(var ax=3D0,aC=3Dak.length;ax<aC;ax++){= al=3Dak[ax];al.update_attrs(ah);if(!al.keep(ah)){au=3Dtrue;break}}if(!au){a= i.push(ah);if(!(ah[0] in an)){all_slotted=3Dfalse}}}}var aB=3D(this.filters= _manager.alpha_filter?new C(this.filters_manager.alpha_filter):null);var az= =3D(this.filters_manager.height_filter?new C(this.filters_manager.height_fi= lter):null);var aA=3Dnew (this.painter)(ai,ay,ac,this.prefs,ao,aB,az,ae);va= r aw=3Dnull;aq.fillStyle=3Dthis.prefs.block_color;aq.font=3Daq.canvas.manag= er.default_font;aq.textAlign=3D"right";if(am.data){aw=3DaA.draw(aq,ad.width= ,ad.height,aj,an);aw.translation=3D-ag}return new O(ap,af,ar,ad,am.data,aj,= ao,am.message,all_slotted,aw)},data_and_mode_compatible:function(ac,ad){if(= ad=3D=3D=3D"Auto"){return true}else{if(ad=3D=3D=3D"Coverage"){return ac.dat= aset_type=3D=3D=3D"summary_tree"}else{if(ac.extra_info=3D=3D=3D"no_detail"|= |ac.dataset_type=3D=3D=3D"summary_tree"){return false}else{return true}}}},= can_subset:function(ac){if(ac.dataset_type=3D=3D=3D"summary_tree"||ac.messa= ge||ac.extra_info=3D=3D=3D"no_detail"){return false}return true}});var R=3D= function(ad,ac,ae){c.call(this,ad,ac,ae);this.config=3Dnew F({track:this,pa= rams:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"b= lock_color",label:"Block color",type:"color",default_value:l.get_random_col= or()},{key:"label_color",label:"Label color",type:"color",default_value:"bl= ack"},{key:"show_insertions",label:"Show insertions",type:"bool",default_va= lue:false},{key:"show_counts",label:"Show summary counts",type:"bool",defau= lt_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:tru= e}],saved_values:ae.prefs,onchange:function(){this.track.set_name(this.trac= k.prefs.name);this.track.tile_cache.clear();this.track.request_draw()}});th= is.prefs=3Dthis.config.values;this.painter=3DL.ReadPainter};q(R.prototype,r= .prototype,M.prototype,c.prototype);var T=3Dfunction(ae,ad,ag){c.call(this,= ae,ad,ag);var af=3Dl.get_random_color(),ac=3Dl.get_random_color([af,"#fffff= f"]);this.config=3Dnew F({track:this,params:[{key:"name",label:"Name",type:= "text",default_value:this.name},{key:"block_color",label:"Block and sense s= trand color",type:"color",default_value:af},{key:"reverse_strand_color",lab= el:"Antisense strand color",type:"color",default_value:ac},{key:"label_colo= r",label:"Label color",type:"color",default_value:"black"},{key:"show_inser= tions",label:"Show insertions",type:"bool",default_value:false},{key:"show_= differences",label:"Show differences only",type:"bool",default_value:true},= {key:"show_counts",label:"Show summary counts",type:"bool",default_value:tr= ue},{key:"histogram_max",label:"Histogram maximum",type:"float",default_val= ue:null,help:"Clear value to set automatically"},{key:"mode",type:"string",= default_value:this.mode,hidden:true}],saved_values:ag.prefs,onchange:functi= on(){this.track.set_name(this.track.prefs.name);this.track.tile_cache.clear= ();this.track.request_draw()}});this.prefs=3Dthis.config.values;this.painte= r=3DL.ReadPainter;this.update_icons()};q(T.prototype,r.prototype,M.prototyp= e,c.prototype);var d=3D{LineTrack:h,FeatureTrack:c,VcfTrack:R,ReadTrack:T,C= ompositeTrack:f,DrawableGroup:P};var p=3Dfunction(ae,ad,ac){if("copy" in ae= ){return ae.copy(ac)}else{var af=3Dae.obj_type;if(!af){af=3Dae.track_type}r= eturn new d[af](ad,ac,ae)}};return{View:Y,DrawableGroup:P,LineTrack:h,Featu= reTrack:c,DiagonalHeatmapTrack:t,ReadTrack:T,VcfTrack:R,CompositeTrack:f,ob= ject_from_template:p}}); \ No newline at end of file +define(["libs/underscore","viz/visualization","viz/trackster/util","viz/tr= ackster/slotting","viz/trackster/painters","mvc/data","viz/trackster/filter= s"],function(ab,x,l,u,L,Y,i){var q=3Dab.extend;var V=3Dfunction(ac){return(= "isResolved" in ac)};var n=3D{};var k=3Dfunction(ac,ad){n[ac.attr("id")]=3D= ad};var m=3Dfunction(ac,ae,ag,af){ag=3D".group";var ad=3D{};n[ac.attr("id")= ]=3Daf;ac.bind("drag",{handle:"."+ae,relative:true},function(ao,ap){var an= =3D$(this),at=3D$(this).parent(),ak=3Dat.children(),am=3Dn[$(this).attr("id= ")],aj,ai,aq,ah,al;ai=3D$(this).parents(ag);if(ai.length!=3D=3D0){aq=3Dai.p= osition().top;ah=3Daq+ai.outerHeight();if(ap.offsetY<aq){$(this).insertBefo= re(ai);var ar=3Dn[ai.attr("id")];ar.remove_drawable(am);ar.container.add_dr= awable_before(am,ar);return}else{if(ap.offsetY>ah){$(this).insertAfter(ai);= var ar=3Dn[ai.attr("id")];ar.remove_drawable(am);ar.container.add_drawable(= am);return}}}ai=3Dnull;for(al=3D0;al<ak.length;al++){aj=3D$(ak.get(al));aq= =3Daj.position().top;ah=3Daq+aj.outerHeight();if(aj.is(ag)&&this!=3D=3Daj.g= et(0)&&ap.offsetY>=3Daq&&ap.offsetY<=3Dah){if(ap.offsetY-aq<ah-ap.offsetY){= aj.find(".content-div").prepend(this)}else{aj.find(".content-div").append(t= his)}if(am.container){am.container.remove_drawable(am)}n[aj.attr("id")].add= _drawable(am);return}}for(al=3D0;al<ak.length;al++){aj=3D$(ak.get(al));if(a= p.offsetY<aj.position().top&&!(aj.hasClass("reference-track")||aj.hasClass(= "intro"))){break}}if(al=3D=3D=3Dak.length){if(this!=3D=3Dak.get(al-1)){at.a= ppend(this);n[at.attr("id")].move_drawable(am,al)}}else{if(this!=3D=3Dak.ge= t(al)){$(this).insertBefore(ak.get(al));n[at.attr("id")].move_drawable(am,(= ap.deltaY>0?al-1:al))}}}).bind("dragstart",function(){ad["border-top"]=3Dac= .css("border-top");ad["border-bottom"]=3Dac.css("border-bottom");$(this).cs= s({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind(= "dragend",function(){$(this).css(ad)})};var aa=3D16,G=3D9,D=3D20,A=3D100,I= =3D12000,S=3D400,K=3D5000,w=3D100,o=3D"There was an error in indexing this = dataset. ",J=3D"A converter for this dataset is not installed. Please check= your datatypes_conf.xml file.",E=3D"No data for this chrom/contig.",v=3D"P= reparing data. This can take a while for a large dataset. If the visualizat= ion is saved and closed, preparation will continue in the background.",y=3D= "Tool cannot be rerun: ",a=3D"Loading data...",U=3D"Ready for display",Q=3D= 10,H=3D20;function W(ad,ac){if(!ac){ac=3D0}var ae=3DMath.pow(10,ac);return = Math.round(ad*ae)/ae}var r=3Dfunction(ad,ac,af){if(!r.id_counter){r.id_coun= ter=3D0}this.id=3Dr.id_counter++;this.name=3Daf.name;this.view=3Dad;this.co= ntainer=3Dac;this.config=3Dnew F({track:this,params:[{key:"name",label:"Nam= e",type:"text",default_value:this.name}],saved_values:af.prefs,onchange:fun= ction(){this.track.set_name(this.track.config.values.name)}});this.prefs=3D= this.config.values;this.drag_handle_class=3Daf.drag_handle_class;this.is_ov= erview=3Dfalse;this.action_icons=3D{};this.content_visible=3Dtrue;this.cont= ainer_div=3Dthis.build_container_div();this.header_div=3Dthis.build_header_= div();if(this.header_div){this.container_div.append(this.header_div);this.i= cons_div=3D$("<div/>").css("float","left").hide().appendTo(this.header_div)= ;this.build_action_icons(this.action_icons_def);this.header_div.append($("<= div style=3D'clear: both'/>"));this.header_div.dblclick(function(ag){ag.sto= pPropagation()});var ae=3Dthis;this.container_div.hover(function(){ae.icons= _div.show()},function(){ae.icons_div.hide()});$("<div style=3D'clear: both'= />").appendTo(this.container_div)}};r.prototype.action_icons_def=3D[{name:"= toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:funct= ion(ac){if(ac.content_visible){ac.action_icons.toggle_icon.addClass("toggle= -expand").removeClass("toggle");ac.hide_contents();ac.content_visible=3Dfal= se}else{ac.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-= expand");ac.content_visible=3Dtrue;ac.show_contents()}}},{name:"settings_ic= on",title:"Edit settings",css_class:"settings-icon",on_click_fn:function(ad= ){var af=3Dfunction(){hide_modal();$(window).unbind("keypress.check_enter_e= sc")},ac=3Dfunction(){ad.config.update_from_form($(".dialog-box"));hide_mod= al();$(window).unbind("keypress.check_enter_esc")},ae=3Dfunction(ag){if((ag= .keyCode||ag.which)=3D=3D=3D27){af()}else{if((ag.keyCode||ag.which)=3D=3D= =3D13){ac()}}};$(window).bind("keypress.check_enter_esc",ae);show_modal("Co= nfigure",ad.config.build_form(),{Cancel:af,OK:ac})}},{name:"remove_icon",ti= tle:"Remove",css_class:"remove-icon",on_click_fn:function(ac){$(".bs-toolti= p").remove();ac.remove()}}];q(r.prototype,{init:function(){},changed:functi= on(){this.view.changed()},can_draw:function(){if(this.enabled&&this.content= _visible){return true}return false},request_draw:function(){},_draw:functio= n(){},to_dict:function(){},set_name:function(ac){this.old_name=3Dthis.name;= this.name=3Dac;this.name_div.text(this.name)},revert_name:function(){if(thi= s.old_name){this.name=3Dthis.old_name;this.name_div.text(this.name)}},remov= e:function(){this.changed();this.container.remove_drawable(this);var ac=3Dt= his.view;this.container_div.hide(0,function(){$(this).remove();ac.update_in= tro_div()})},build_container_div:function(){},build_header_div:function(){}= ,add_action_icon:function(ad,ai,ah,ag,ac,af){var ae=3Dthis;this.action_icon= s[ad]=3D$("<a/>").attr("href","javascript:void(0);").attr("title",ai).addCl= ass("icon-button").addClass(ah).tooltip().click(function(){ag(ae)}).appendT= o(this.icons_div);if(af){this.action_icons[ad].hide()}},build_action_icons:= function(ac){var ae;for(var ad=3D0;ad<ac.length;ad++){ae=3Dac[ad];this.add_= action_icon(ae.name,ae.title,ae.css_class,ae.on_click_fn,ae.prepend,ae.hide= )}},update_icons:function(){},hide_contents:function(){},show_contents:func= tion(){},get_drawables:function(){}});var z=3Dfunction(ad,ac,ae){r.call(thi= s,ad,ac,ae);this.obj_type=3Dae.obj_type;this.drawables=3D[]};q(z.prototype,= r.prototype,{unpack_drawables:function(ae){this.drawables=3D[];var ad;for(v= ar ac=3D0;ac<ae.length;ac++){ad=3Dp(ae[ac],this.view,this);this.add_drawabl= e(ad)}},init:function(){for(var ac=3D0;ac<this.drawables.length;ac++){this.= drawables[ac].init()}},_draw:function(){for(var ac=3D0;ac<this.drawables.le= ngth;ac++){this.drawables[ac]._draw()}},to_dict:function(){var ad=3D[];for(= var ac=3D0;ac<this.drawables.length;ac++){ad.push(this.drawables[ac].to_dic= t())}return{name:this.name,prefs:this.prefs,obj_type:this.obj_type,drawable= s:ad}},add_drawable:function(ac){this.drawables.push(ac);ac.container=3Dthi= s;this.changed()},add_drawable_before:function(ae,ac){this.changed();var ad= =3Dthis.drawables.indexOf(ac);if(ad!=3D=3D-1){this.drawables.splice(ad,0,ae= );return true}return false},replace_drawable:function(ae,ac,ad){var af=3Dth= is.drawables.indexOf(ae);if(af!=3D=3D-1){this.drawables[af]=3Dac;if(ad){ae.= container_div.replaceWith(ac.container_div)}this.changed()}return af},remov= e_drawable:function(ad){var ac=3Dthis.drawables.indexOf(ad);if(ac!=3D=3D-1)= {this.drawables.splice(ac,1);ad.container=3Dnull;this.changed();return true= }return false},move_drawable:function(ad,ae){var ac=3Dthis.drawables.indexO= f(ad);if(ac!=3D=3D-1){this.drawables.splice(ac,1);this.drawables.splice(ae,= 0,ad);this.changed();return true}return false},get_drawables:function(){ret= urn this.drawables}});var P=3Dfunction(ad,ac,af){q(af,{obj_type:"DrawableGr= oup",drag_handle_class:"group-handle"});z.call(this,ad,ac,af);this.content_= div=3D$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_cont= ent_div").appendTo(this.container_div);k(this.container_div,this);k(this.co= ntent_div,this);m(this.container_div,this.drag_handle_class,".group",this);= this.filters_manager=3Dnew i.FiltersManager(this);this.header_div.after(thi= s.filters_manager.parent_div);this.saved_filters_managers=3D[];if("drawable= s" in af){this.unpack_drawables(af.drawables)}if("filters" in af){var ae=3D= this.filters_manager;this.filters_manager=3Dnew i.FiltersManager(this,af.fi= lters);ae.parent_div.replaceWith(this.filters_manager.parent_div);if(af.fil= ters.visible){this.setup_multitrack_filtering()}}};q(P.prototype,r.prototyp= e,z.prototype,{action_icons_def:[r.prototype.action_icons_def[0],r.prototyp= e.action_icons_def[1],{name:"composite_icon",title:"Show composite track",c= ss_class:"layers-stack",on_click_fn:function(ac){$(".bs-tooltip").remove();= ac.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:= "filters-icon",on_click_fn:function(ac){if(ac.filters_manager.visible()){ac= .filters_manager.clear_filters();ac._restore_filter_managers()}else{ac.setu= p_multitrack_filtering();ac.request_draw(true)}ac.filters_manager.toggle()}= },r.prototype.action_icons_def[2]],build_container_div:function(){var ac=3D= $("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container= ){this.container.content_div.append(ac)}return ac},build_header_div:functio= n(){var ac=3D$("<div/>").addClass("track-header");ac.append($("<div/>").add= Class(this.drag_handle_class));this.name_div=3D$("<div/>").addClass("track-= name").text(this.name).appendTo(ac);return ac},hide_contents:function(){thi= s.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.req= uest_draw()},update_icons:function(){var ae=3Dthis.drawables.length;if(ae= =3D=3D=3D0){this.action_icons.composite_icon.hide();this.action_icons.filte= rs_icon.hide()}else{if(ae=3D=3D=3D1){if(this.drawables[0] instanceof f){thi= s.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}= else{var al,ak,ai,ao=3Dtrue,ag=3Dthis.drawables[0].get_type(),ac=3D0;for(al= =3D0;al<ae;al++){ai=3Dthis.drawables[al];if(ai.get_type()!=3D=3Dag){can_com= posite=3Dfalse;break}if(ai instanceof c){ac++}}if(ao||ac=3D=3D=3D1){this.ac= tion_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide= ();$(".bs-tooltip").remove()}if(ac>1&&ac=3D=3D=3Dthis.drawables.length){var= ap=3D{},ad;ai=3Dthis.drawables[0];for(ak=3D0;ak<ai.filters_manager.filters= .length;ak++){ad=3Dai.filters_manager.filters[ak];ap[ad.name]=3D[ad]}for(al= =3D1;al<this.drawables.length;al++){ai=3Dthis.drawables[al];for(ak=3D0;ak<a= i.filters_manager.filters.length;ak++){ad=3Dai.filters_manager.filters[ak];= if(ad.name in ap){ap[ad.name].push(ad)}}}this.filters_manager.remove_all();= var af,ah,aj,am;for(var an in ap){af=3Dap[an];if(af.length=3D=3D=3Dac){ah= =3Dnew i.NumberFilter({name:af[0].name,index:af[0].index});this.filters_man= ager.add_filter(ah)}}if(this.filters_manager.filters.length>0){this.action_= icons.filters_icon.show()}else{this.action_icons.filters_icon.hide()}}else{= this.action_icons.filters_icon.hide()}}}},_restore_filter_managers:function= (){for(var ac=3D0;ac<this.drawables.length;ac++){this.drawables[ac].filters= _manager=3Dthis.saved_filters_managers[ac]}this.saved_filters_managers=3D[]= },setup_multitrack_filtering:function(){if(this.filters_manager.filters.len= gth>0){this.saved_filters_managers=3D[];for(var ac=3D0;ac<this.drawables.le= ngth;ac++){drawable=3Dthis.drawables[ac];this.saved_filters_managers.push(d= rawable.filters_manager);drawable.filters_manager=3Dthis.filters_manager}}t= his.filters_manager.init_filters()},show_composite_track:function(){var ag= =3D[];for(var ad=3D0;ad<this.drawables.length;ad++){ag.push(this.drawables[= ad].name)}var ae=3D"Composite Track of "+this.drawables.length+" tracks ("+= ag.join(", ")+")";var af=3Dnew f(this.view,this.view,{name:ae,drawables:thi= s.drawables});var ac=3Dthis.container.replace_drawable(this,af,true);af.req= uest_draw()},add_drawable:function(ac){z.prototype.add_drawable.call(this,a= c);this.update_icons()},remove_drawable:function(ac){z.prototype.remove_dra= wable.call(this,ac);this.update_icons()},to_dict:function(){if(this.filters= _manager.visible()){this._restore_filter_managers()}var ac=3Dq(z.prototype.= to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filter= s_manager.visible()){this.setup_multitrack_filtering()}return ac},request_d= raw:function(ac,ae){for(var ad=3D0;ad<this.drawables.length;ad++){this.draw= ables[ad].request_draw(ac,ae)}}});var Z=3DBackbone.View.extend({initialize:= function(ac){q(ac,{obj_type:"View"});z.call(this,"View",ac.container,ac);th= is.chrom=3Dnull;this.vis_id=3Dac.vis_id;this.dbkey=3Dac.dbkey;this.label_tr= acks=3D[];this.tracks_to_be_redrawn=3D[];this.max_low=3D0;this.max_high=3D0= ;this.zoom_factor=3D3;this.min_separation=3D30;this.has_changes=3Dfalse;thi= s.load_chroms_deferred=3Dnull;this.render();this.canvas_manager=3Dnew x.Can= vasManager(this.container.get(0).ownerDocument);this.reset()},render:functi= on(){this.requested_redraw=3Dfalse;var ae=3Dthis.container,ac=3Dthis;this.t= op_container=3D$("<div/>").addClass("top-container").appendTo(ae);this.brow= ser_content_div=3D$("<div/>").addClass("content").css("position","relative"= ).appendTo(ae);this.bottom_container=3D$("<div/>").addClass("bottom-contain= er").appendTo(ae);this.top_labeltrack=3D$("<div/>").addClass("top-labeltrac= k").appendTo(this.top_container);this.viewport_container=3D$("<div/>").addC= lass("viewport-container").attr("id","viewport-container").appendTo(this.br= owser_content_div);this.content_div=3Dthis.viewport_container;k(this.viewpo= rt_container,ac);this.intro_div=3D$("<div/>").addClass("intro").appendTo(th= is.viewport_container).hide();var af=3D$("<div/>").text("Add Datasets to Vi= sualization").addClass("action-button").appendTo(this.intro_div).click(func= tion(){x.select_datasets(select_datasets_url,add_track_async_url,{"f-dbkey"= :ac.dbkey},function(ag){ab.each(ag,function(ah){ac.add_drawable(p(ah,ac,ac)= )})})});this.nav_labeltrack=3D$("<div/>").addClass("nav-labeltrack").append= To(this.bottom_container);this.nav_container=3D$("<div/>").addClass("tracks= ter-nav-container").prependTo(this.top_container);this.nav=3D$("<div/>").ad= dClass("trackster-nav").appendTo(this.nav_container);this.overview=3D$("<di= v/>").addClass("overview").appendTo(this.bottom_container);this.overview_vi= ewport=3D$("<div/>").addClass("overview-viewport").appendTo(this.overview);= this.overview_close=3D$("<a/>").attr("href","javascript:void(0);").attr("ti= tle","Close overview").addClass("icon-button overview-close tooltip").hide(= ).appendTo(this.overview_viewport);this.overview_highlight=3D$("<div/>").ad= dClass("overview-highlight").hide().appendTo(this.overview_viewport);this.o= verview_box_background=3D$("<div/>").addClass("overview-boxback").appendTo(= this.overview_viewport);this.overview_box=3D$("<div/>").addClass("overview-= box").appendTo(this.overview_viewport);this.default_overview_height=3Dthis.= overview_box.height();this.nav_controls=3D$("<div/>").addClass("nav-control= s").appendTo(this.nav);this.chrom_select=3D$("<select/>").attr({name:"chrom= "}).css("width","15em").append("<option value=3D''>Loading</option>").appen= dTo(this.nav_controls);var ad=3Dfunction(ag){if(ag.type=3D=3D=3D"focusout"|= |(ag.keyCode||ag.which)=3D=3D=3D13||(ag.keyCode||ag.which)=3D=3D=3D27){if((= ag.keyCode||ag.which)!=3D=3D27){ac.go_to($(this).val())}$(this).hide();$(th= is).val("");ac.location_span.show();ac.chrom_select.show()}};this.nav_input= =3D$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ad).app= endTo(this.nav_controls);this.location_span=3D$("<span/>").addClass("locati= on").attr("original-title","Click to change location").tooltip({placement:"= bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){a= c.location_span.hide();ac.chrom_select.hide();ac.nav_input.val(ac.chrom+":"= +ac.low+"-"+ac.high);ac.nav_input.css("display","inline-block");ac.nav_inpu= t.select();ac.nav_input.focus();ac.nav_input.autocomplete({source:function(= ai,ag){var aj=3D[],ah=3D$.map(ac.get_drawables(),function(ak){return ak.dat= a_manager.search_features(ai.term).success(function(al){aj=3Daj.concat(al)}= )});$.when.apply($,ah).done(function(){ag($.map(aj,function(ak){return{labe= l:ak[0],value:ak[1]}}))})}})});if(this.vis_id!=3D=3Dundefined){this.hidden_= input=3D$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.= nav_controls)}this.zo_link=3D$("<a/>").attr("id","zoom-out").attr("title","= Zoom out").tooltip({placement:"bottom"}).click(function(){ac.zoom_out();ac.= request_redraw()}).appendTo(this.nav_controls);this.zi_link=3D$("<a/>").att= r("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).cli= ck(function(){ac.zoom_in();ac.request_redraw()}).appendTo(this.nav_controls= );this.load_chroms_deferred=3Dthis.load_chroms({low:0});this.chrom_select.b= ind("change",function(){ac.change_chrom(ac.chrom_select.val())});this.brows= er_content_div.click(function(ag){$(this).find("input").trigger("blur")});t= his.browser_content_div.bind("dblclick",function(ag){ac.zoom_in(ag.pageX,th= is.viewport_container)});this.overview_box.bind("dragstart",function(ag,ah)= {this.current_x=3Dah.offsetX}).bind("drag",function(ag,ai){var aj=3Dai.offs= etX-this.current_x;this.current_x=3Dai.offsetX;var ah=3DMath.round(aj/ac.vi= ewport_container.width()*(ac.max_high-ac.max_low));ac.move_delta(-ah)});thi= s.overview_close.click(function(){ac.reset_overview()});this.viewport_conta= iner.bind("draginit",function(ag,ah){if(ag.clientX>ac.viewport_container.wi= dth()-16){return false}}).bind("dragstart",function(ag,ah){ah.original_low= =3Dac.low;ah.current_height=3Dag.clientY;ah.current_x=3Dah.offsetX}).bind("= drag",function(ai,ak){var ag=3D$(this);var al=3Dak.offsetX-ak.current_x;var= ah=3Dag.scrollTop()-(ai.clientY-ak.current_height);ag.scrollTop(ah);ak.cur= rent_height=3Dai.clientY;ak.current_x=3Dak.offsetX;var aj=3DMath.round(al/a= c.viewport_container.width()*(ac.high-ac.low));ac.move_delta(aj)}).bind("mo= usewheel",function(ai,ak,ah,ag){if(ah){ah*=3D50;var aj=3DMath.round(-ah/ac.= viewport_container.width()*(ac.high-ac.low));ac.move_delta(aj)}});this.top_= labeltrack.bind("dragstart",function(ag,ah){return $("<div />").css({height= :ac.browser_content_div.height()+ac.top_labeltrack.height()+ac.nav_labeltra= ck.height()+1,top:"0px",position:"absolute","background-color":"#ccf",opaci= ty:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(ak,al){$(a= l.proxy).css({left:Math.min(ak.pageX,al.startX)-ac.container.offset().left,= width:Math.abs(ak.pageX-al.startX)});var ah=3DMath.min(ak.pageX,al.startX)-= ac.container.offset().left,ag=3DMath.max(ak.pageX,al.startX)-ac.container.o= ffset().left,aj=3D(ac.high-ac.low),ai=3Dac.viewport_container.width();ac.up= date_location(Math.round(ah/ai*aj)+ac.low,Math.round(ag/ai*aj)+ac.low)}).bi= nd("dragend",function(al,am){var ah=3DMath.min(al.pageX,am.startX),ag=3DMat= h.max(al.pageX,am.startX),aj=3D(ac.high-ac.low),ai=3Dac.viewport_container.= width(),ak=3Dac.low;ac.low=3DMath.round(ah/ai*aj)+ak;ac.high=3DMath.round(a= g/ai*aj)+ak;$(am.proxy).remove();ac.request_redraw()});this.add_label_track= (new X(this,{content_div:this.top_labeltrack}));this.add_label_track(new X(= this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function()= {if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=3D= setTimeout(function(){ac.resize_window()},500)});$(document).bind("redraw",= function(){ac.redraw()});this.reset();$(window).trigger("resize")}});q(Z.pr= ototype,z.prototype,{changed:function(){this.has_changes=3Dtrue},update_int= ro_div:function(){if(this.drawables.length=3D=3D=3D0){this.intro_div.show()= }else{this.intro_div.hide()}},trigger_navigate:function(ad,af,ac,ag){if(thi= s.timer){clearTimeout(this.timer)}if(ag){var ae=3Dthis;this.timer=3DsetTime= out(function(){ae.trigger("navigate",ad+":"+af+"-"+ac)},500)}else{view.trig= ger("navigate",ad+":"+af+"-"+ac)}},update_location:function(ac,ae){this.loc= ation_span.text(commatize(ac)+" - "+commatize(ae));this.nav_input.val(this.= chrom+":"+commatize(ac)+"-"+commatize(ae));var ad=3Dview.chrom_select.val()= ;if(ad!=3D=3D""){this.trigger_navigate(ad,view.low,view.high,true)}},load_c= hroms:function(ae){ae.num=3Dw;var ac=3Dthis,ad=3D$.Deferred();$.ajax({url:c= hrom_url+"/"+this.dbkey,data:ae,dataType:"json",success:function(ag){if(ag.= chrom_info.length=3D=3D=3D0){return}if(ag.reference){ac.add_label_track(new= B(ac))}ac.chrom_data=3Dag.chrom_info;var aj=3D'<option value=3D"">Select C= hrom/Contig</option>';for(var ai=3D0,af=3Dac.chrom_data.length;ai<af;ai++){= var ah=3Dac.chrom_data[ai].chrom;aj+=3D'<option value=3D"'+ah+'">'+ah+"</op= tion>"}if(ag.prev_chroms){aj+=3D'<option value=3D"previous">Previous '+w+"<= /option>"}if(ag.next_chroms){aj+=3D'<option value=3D"next">Next '+w+"</opti= on>"}ac.chrom_select.html(aj);ac.chrom_start_index=3Dag.start_index;ad.reso= lve(ag)},error:function(){alert("Could not load chroms for this dbkey:",ac.= dbkey)}});return ad},change_chrom:function(ah,ad,aj){var ae=3Dthis;if(!ae.c= hrom_data){ae.load_chroms_deferred.then(function(){ae.change_chrom(ah,ad,aj= )});return}if(!ah||ah=3D=3D=3D"None"){return}if(ah=3D=3D=3D"previous"){ae.l= oad_chroms({low:this.chrom_start_index-w});return}if(ah=3D=3D=3D"next"){ae.= load_chroms({low:this.chrom_start_index+w});return}var ai=3D$.grep(ae.chrom= _data,function(ak,al){return ak.chrom=3D=3D=3Dah})[0];if(ai=3D=3D=3Dundefin= ed){ae.load_chroms({chrom:ah},function(){ae.change_chrom(ah,ad,aj)});return= }else{if(ah!=3D=3Dae.chrom){ae.chrom=3Dah;ae.chrom_select.val(ae.chrom);ae.= max_high=3Dai.len-1;ae.reset();ae.request_redraw(true);for(var ag=3D0,ac=3D= ae.drawables.length;ag<ac;ag++){var af=3Dae.drawables[ag];if(af.init){af.in= it()}}if(ae.reference_track){ae.reference_track.init()}}if(ad!=3D=3Dundefin= ed&&aj!=3D=3Dundefined){ae.low=3DMath.max(ad,0);ae.high=3DMath.min(aj,ae.ma= x_high)}else{ae.low=3D0;ae.high=3Dae.max_high}ae.reset_overview();ae.reques= t_redraw()}},go_to:function(ag){ag=3Dag.replace(/ |,/g,"");var ak=3Dthis,ac= ,af,ad=3Dag.split(":"),ai=3Dad[0],aj=3Dad[1];if(aj!=3D=3Dundefined){try{var= ah=3Daj.split("-");ac=3DparseInt(ah[0],10);af=3DparseInt(ah[1],10)}catch(a= e){return false}}ak.change_chrom(ai,ac,af)},move_fraction:function(ae){var = ac=3Dthis;var ad=3Dac.high-ac.low;this.move_delta(ae*ad)},move_delta:functi= on(af){var ac=3Dthis;var ae=3Dac.high-ac.low;if(ac.low-af<ac.max_low){ac.lo= w=3Dac.max_low;ac.high=3Dac.max_low+ae}else{if(ac.high-af>ac.max_high){ac.h= igh=3Dac.max_high;ac.low=3Dac.max_high-ae}else{ac.high-=3Daf;ac.low-=3Daf}}= ac.request_redraw();var ad=3Dac.chrom_select.val();this.trigger_navigate(ad= ,ac.low,ac.high,true)},add_drawable:function(ac){z.prototype.add_drawable.c= all(this,ac);ac.init();this.changed();this.update_intro_div()},add_label_tr= ack:function(ac){ac.view=3Dthis;ac.init();this.label_tracks.push(ac)},remov= e_drawable:function(ae,ad){z.prototype.remove_drawable.call(this,ae);if(ad)= {var ac=3Dthis;ae.container_div.hide(0,function(){$(this).remove();ac.updat= e_intro_div()})}},reset:function(){this.low=3Dthis.max_low;this.high=3Dthis= .max_high;this.viewport_container.find(".yaxislabel").remove()},request_red= raw:function(ak,ac,aj,al){var ai=3Dthis,ah=3D(al?[al]:ai.drawables),ae;var = ad;for(var ag=3D0;ag<ah.length;ag++){ad=3Dah[ag];ae=3D-1;for(var af=3D0;af<= ai.tracks_to_be_redrawn.length;af++){if(ai.tracks_to_be_redrawn[af][0]=3D= =3D=3Dad){ae=3Daf;break}}if(ae<0){ai.tracks_to_be_redrawn.push([ad,ac,aj])}= else{ai.tracks_to_be_redrawn[ag][1]=3Dac;ai.tracks_to_be_redrawn[ag][2]=3Da= j}}if(!this.requested_redraw){requestAnimationFrame(function(){ai._redraw(a= k)});this.requested_redraw=3Dtrue}},_redraw:function(am){this.requested_red= raw=3Dfalse;var aj=3Dthis.low,af=3Dthis.high;if(aj<this.max_low){aj=3Dthis.= max_low}if(af>this.max_high){af=3Dthis.max_high}var al=3Dthis.high-this.low= ;if(this.high!=3D=3D0&&al<this.min_separation){af=3Daj+this.min_separation}= this.low=3DMath.floor(aj);this.high=3DMath.ceil(af);this.update_location(th= is.low,this.high);this.resolution_b_px=3D(this.high-this.low)/this.viewport= _container.width();this.resolution_px_b=3Dthis.viewport_container.width()/(= this.high-this.low);var ac=3D(this.low/(this.max_high-this.max_low)*this.ov= erview_viewport.width())||0;var ai=3D((this.high-this.low)/(this.max_high-t= his.max_low)*this.overview_viewport.width())||0;var an=3D13;this.overview_b= ox.css({left:ac,width:Math.max(an,ai)}).show();if(ai<an){this.overview_box.= css("left",ac-(an-ai)/2)}if(this.overview_highlight){this.overview_highligh= t.css({left:ac,width:ai})}if(!am){var ae,ad,ak;for(var ag=3D0,ah=3Dthis.tra= cks_to_be_redrawn.length;ag<ah;ag++){ae=3Dthis.tracks_to_be_redrawn[ag][0];= ad=3Dthis.tracks_to_be_redrawn[ag][1];ak=3Dthis.tracks_to_be_redrawn[ag][2]= ;if(ae){ae._draw(ad,ak)}}this.tracks_to_be_redrawn=3D[];for(ag=3D0,ah=3Dthi= s.label_tracks.length;ag<ah;ag++){this.label_tracks[ag]._draw()}}},zoom_in:= function(ad,ae){if(this.max_high=3D=3D=3D0||this.high-this.low<=3Dthis.min_= separation){return}var af=3Dthis.high-this.low,ag=3Daf/2+this.low,ac=3D(af/= this.zoom_factor)/2;if(ad){ag=3Dad/this.viewport_container.width()*(this.hi= gh-this.low)+this.low}this.low=3DMath.round(ag-ac);this.high=3DMath.round(a= g+ac);this.changed();this.request_redraw()},zoom_out:function(){if(this.max= _high=3D=3D=3D0){return}var ad=3Dthis.high-this.low,ae=3Dad/2+this.low,ac= =3D(ad*this.zoom_factor)/2;this.low=3DMath.round(ae-ac);this.high=3DMath.ro= und(ae+ac);this.changed();this.request_redraw()},resize_window:function(){t= his.viewport_container.height(this.container.height()-this.top_container.he= ight()-this.bottom_container.height());this.request_redraw()},set_overview:= function(ae){if(this.overview_drawable){if(this.overview_drawable.dataset_i= d=3D=3D=3Dae.dataset_id){return}this.overview_viewport.find(".track").remov= e()}var ad=3Dae.copy({content_div:this.overview_viewport}),ac=3Dthis;ad.hea= der_div.hide();ad.is_overview=3Dtrue;ac.overview_drawable=3Dad;this.overvie= w_drawable.postdraw_actions=3Dfunction(){ac.overview_highlight.show().heigh= t(ac.overview_drawable.content_div.height());ac.overview_viewport.height(ac= .overview_drawable.content_div.height()+ac.overview_box.outerHeight());ac.o= verview_close.show();ac.resize_window()};ac.overview_drawable.request_draw(= );this.changed()},reset_overview:function(){$(".bs-tooltip").remove();this.= overview_viewport.find(".track-tile").remove();this.overview_viewport.heigh= t(this.default_overview_height);this.overview_box.height(this.default_overv= iew_height);this.overview_close.hide();this.overview_highlight.hide();view.= resize_window();view.overview_drawable=3Dnull}});var s=3Dfunction(ae,aj,af)= {this.track=3Dae;this.name=3Daj.name;this.params=3D[];var aq=3Daj.params;fo= r(var ag=3D0;ag<aq.length;ag++){var al=3Daq[ag],ad=3Dal.name,ap=3Dal.label,= ah=3Dunescape(al.html),ar=3Dal.value,an=3Dal.type;if(an=3D=3D=3D"number"){t= his.params.push(new e(ad,ap,ah,(ad in af?af[ad]:ar),al.min,al.max))}else{if= (an=3D=3D=3D"select"){this.params.push(new N(ad,ap,ah,(ad in af?af[ad]:ar))= )}else{console.log("WARNING: unrecognized tool parameter type:",ad,an)}}}th= is.parent_div=3D$("<div/>").addClass("dynamic-tool").hide();this.parent_div= .bind("drag",function(au){au.stopPropagation()}).click(function(au){au.stop= Propagation()}).bind("dblclick",function(au){au.stopPropagation()});var ao= =3D$("<div class=3D'tool-name'>").appendTo(this.parent_div).text(this.name)= ;var am=3Dthis.params;var ak=3Dthis;$.each(this.params,function(av,ay){var = ax=3D$("<div>").addClass("param-row").appendTo(ak.parent_div);var au=3D$("<= div>").addClass("param-label").text(ay.label).appendTo(ax);var aw=3D$("<div= />").addClass("param-input").html(ay.html).appendTo(ax);aw.find(":input").v= al(ay.value);$("<div style=3D'clear: both;'/>").appendTo(ax)});this.parent_= div.find("input").click(function(){$(this).select()});var at=3D$("<div>").a= ddClass("param-row").appendTo(this.parent_div);var ai=3D$("<input type=3D's= ubmit'>").attr("value","Run on complete dataset").appendTo(at);var ac=3D$("= <input type=3D'submit'>").attr("value","Run on visible region").css("margin= -left","3em").appendTo(at);ac.click(function(){ak.run_on_region()});ai.clic= k(function(){ak.run_on_dataset()});if("visible" in af&&af.visible){this.par= ent_div.show()}};q(s.prototype,{update_params:function(){for(var ac=3D0;ac<= this.params.length;ac++){this.params[ac].update_value()}},state_dict:functi= on(){var ad=3D{};for(var ac=3D0;ac<this.params.length;ac++){ad[this.params[= ac].name]=3Dthis.params[ac].value}ad.visible=3Dthis.parent_div.is(":visible= ");return ad},get_param_values_dict:function(){var ac=3D{};this.parent_div.= find(":input").each(function(){var ad=3D$(this).attr("name"),ae=3D$(this).v= al();ac[ad]=3Dae});return ac},get_param_values:function(){var ac=3D[];this.= parent_div.find(":input").each(function(){var ad=3D$(this).attr("name"),ae= =3D$(this).val();if(ad){ac[ac.length]=3Dae}});return ac},run_on_dataset:fun= ction(){var ac=3Dthis;ac.run({target_dataset_id:this.track.original_dataset= _id,tool_id:ac.name},null,function(ad){show_modal(ac.name+" is Running",ac.= name+" is running on the complete dataset. Tool outputs are in dataset's hi= story.",{Close:hide_modal})})},run_on_region:function(){var ad=3D{target_da= taset_id:this.track.original_dataset_id,action:"rerun",tool_id:this.name,re= gions:[{chrom:this.track.view.chrom,start:this.track.view.low,end:this.trac= k.view.high}]},ah=3Dthis.track,ae=3Dad.tool_id+ah.tool_region_and_parameter= s_str(ad.chrom,ad.low,ad.high),ac;if(ah.container=3D=3D=3Dview){var ag=3Dne= w P(view,view,{name:this.name});var af=3Dah.container.replace_drawable(ah,a= g,false);ag.container_div.insertBefore(ah.view.content_div.children()[af]);= ag.add_drawable(ah);ah.container_div.appendTo(ag.content_div);ac=3Dag}else{= ac=3Dah.container}var ai=3Dnew ah.constructor(view,ac,{name:ae,hda_ldda:"hd= a"});ai.init_for_tool_data();ai.change_mode(ah.mode);ai.set_filters_manager= (ah.filters_manager.copy(ai));ai.update_icons();ac.add_drawable(ai);ai.tile= s_div.text("Starting job.");this.update_params();this.run(ad,ai,function(aj= ){ai.set_dataset(new Y.Dataset(aj));ai.tiles_div.text("Running job.");ai.in= it()})},run:function(ac,ae,af){ac.inputs=3Dthis.get_param_values_dict();var= ad=3Dnew l.ServerStateDeferred({ajax_settings:{url:galaxy_paths.get("tool_= url"),data:JSON.stringify(ac),dataType:"json",contentType:"application/json= ",type:"POST"},interval:2000,success_fn:function(ag){return ag!=3D=3D"pendi= ng"}});$.when(ad.go()).then(function(ag){if(ag=3D=3D=3D"no converter"){ae.c= ontainer_div.addClass("error");ae.content_div.text(J)}else{if(ag.error){ae.= container_div.addClass("error");ae.content_div.text(y+ag.message)}else{af(a= g)}}})}});var N=3Dfunction(ad,ac,ae,af){this.name=3Dad;this.label=3Dac;this= .html=3D$(ae);this.value=3Daf};q(N.prototype,{update_value:function(){this.= value=3D$(this.html).val()}});var e=3Dfunction(ae,ad,ag,ah,af,ac){N.call(th= is,ae,ad,ag,ah);this.min=3Daf;this.max=3Dac};q(e.prototype,N.prototype,{upd= ate_value:function(){N.prototype.update_value.call(this);this.value=3Dparse= Float(this.value)}});var C=3Dfunction(ac,ad){L.Scaler.call(this,ad);this.fi= lter=3Dac};C.prototype.gen_val=3Dfunction(ac){if(this.filter.high=3D=3D=3DN= umber.MAX_VALUE||this.filter.low=3D=3D=3D-Number.MAX_VALUE||this.filter.low= =3D=3D=3Dthis.filter.high){return this.default_val}return((parseFloat(ac[th= is.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var= F=3Dfunction(ac){this.track=3Dac.track;this.params=3Dac.params;this.values= =3D{};this.restore_values((ac.saved_values?ac.saved_values:{}));this.onchan= ge=3Dac.onchange};q(F.prototype,{restore_values:function(ac){var ad=3Dthis;= $.each(this.params,function(ae,af){if(ac[af.key]!=3D=3Dundefined){ad.values= [af.key]=3Dac[af.key]}else{ad.values[af.key]=3Daf.default_value}})},build_f= orm:function(){var af=3Dthis;var ac=3D$("<div />");var ae;function ad(ak,ag= ){for(var ao=3D0;ao<ak.length;ao++){ae=3Dak[ao];if(ae.hidden){continue}var = ai=3D"param_"+ao;var at=3Daf.values[ae.key];var av=3D$("<div class=3D'form-= row' />").appendTo(ag);av.append($("<label />").attr("for",ai).text(ae.labe= l+":"));if(ae.type=3D=3D=3D"bool"){av.append($('<input type=3D"checkbox" />= ').attr("id",ai).attr("name",ai).attr("checked",at))}else{if(ae.type=3D=3D= =3D"text"){av.append($('<input type=3D"text"/>').attr("id",ai).val(at).clic= k(function(){$(this).select()}))}else{if(ae.type=3D=3D=3D"select"){var aq= =3D$("<select />").attr("id",ai);for(var am=3D0;am<ae.options.length;am++){= $("<option/>").text(ae.options[am].label).attr("value",ae.options[am].value= ).appendTo(aq)}aq.val(at);av.append(aq)}else{if(ae.type=3D=3D=3D"color"){va= r au=3D$("<div/>").appendTo(av),ap=3D$("<input />").attr("id",ai).attr("nam= e",ai).val(at).css("float","left").appendTo(au).click(function(ax){$(".bs-t= ooltip").removeClass("in");var aw=3D$(this).siblings(".bs-tooltip").addClas= s("in");aw.css({left:$(this).position().left+$(this).width()+5,top:$(this).= position().top-($(aw).height()/2)+($(this).height()/2)}).show();aw.click(fu= nction(ay){ay.stopPropagation()});$(document).bind("click.color-picker",fun= ction(){aw.hide();$(document).unbind("click.color-picker")});ax.stopPropaga= tion()}),an=3D$("<a href=3D'javascript:void(0)'/>").addClass("icon-button a= rrow-circle").appendTo(au).attr("title","Set new random color").tooltip(),a= r=3D$("<div class=3D'bs-tooltip right' style=3D'position: absolute;' />").a= ppendTo(au).hide(),aj=3D$("<div class=3D'tooltip-inner' style=3D'text-align= : inherit'></div>").appendTo(ar),ah=3D$("<div class=3D'tooltip-arrow'></div= div class=3D'help'/>").text(ae.help))}}}ad(this.params,ac);return ac},updat= e_from_form:function(ac){var ae=3Dthis;var ad=3Dfalse;$.each(this.params,fu= nction(af,ah){if(!ah.hidden){var ai=3D"param_"+af;var ag=3Dac.find("#"+ai).= val();if(ah.type=3D=3D=3D"float"){ag=3DparseFloat(ag)}else{if(ah.type=3D=3D= =3D"int"){ag=3DparseInt(ag)}else{if(ah.type=3D=3D=3D"bool"){ag=3Dac.find("#= "+ai).is(":checked")}}}if(ag!=3D=3Dae.values[ah.key]){ae.values[ah.key]=3Da= g;ad=3Dtrue}}});if(ad){this.onchange();this.track.changed()}}});var b=3Dfun= ction(ac,ag,ae,ad,af){this.track=3Dac;this.region=3Dag;this.low=3Dag.get("s= tart");this.high=3Dag.get("end");this.resolution=3Dae;this.html_elt=3D$("<d= iv class=3D'track-tile'/>").append(ad).height($(ad).attr("height"));this.da= ta=3Daf;this.stale=3Dfalse};b.prototype.predisplay_actions=3Dfunction(){};v= ar j=3Dfunction(ac,ah,ae,ad,af,ag){b.call(this,ac,ah,ae,ad,af);this.max_val= =3Dag};q(j.prototype,b.prototype);var O=3Dfunction(af,an,ag,ae,ai,ap,aj,aq,= ad,am){b.call(this,af,an,ag,ae,ai);this.mode=3Daj;this.all_slotted=3Dad;thi= s.feature_mapper=3Dam;this.has_icons=3Dfalse;if(aq){this.has_icons=3Dtrue;v= ar ak=3Dthis;ae=3Dthis.html_elt.children()[0],message_div=3D$("<div/>").add= Class("tile-message").css({height:D-1,width:ae.width}).prependTo(this.html_= elt);var al=3Dnew x.GenomeRegion({chrom:af.view.chrom,start:this.low,end:th= is.high}),ao=3Dai.length,ah=3D$("<a href=3D'javascript:void(0);'/>").addCla= ss("icon more-down").attr("title","For speed, only the first "+ao+" feature= s in this region were obtained from server. Click to get more data includin= g depth").tooltip().appendTo(message_div),ac=3D$("<a href=3D'javascript:voi= d(0);'/>").addClass("icon more-across").attr("title","For speed, only the f= irst "+ao+" features in this region were obtained from server. Click to get= more data excluding depth").tooltip().appendTo(message_div);ah.click(funct= ion(){ak.stale=3Dtrue;af.data_manager.get_more_data(al,af.mode,ak.resolutio= n,{},af.data_manager.DEEP_DATA_REQ);$(".bs-tooltip").hide();af.request_draw= (true)}).dblclick(function(ar){ar.stopPropagation()});ac.click(function(){a= k.stale=3Dtrue;af.data_manager.get_more_data(al,af.mode,ak.resolution,{},af= .data_manager.BROAD_DATA_REQ);$(".bs-tooltip").hide();af.request_draw(true)= }).dblclick(function(ar){ar.stopPropagation()})}};q(O.prototype,b.prototype= );O.prototype.predisplay_actions=3Dfunction(){var ad=3Dthis,ac=3D{};if(ad.m= ode!=3D=3D"Pack"){return}$(this.html_elt).hover(function(){this.hovered=3Dt= rue;$(this).mousemove()},function(){this.hovered=3Dfalse;$(this).parents(".= track-content").children(".overlay").children(".feature-popup").remove()}).= mousemove(function(ao){if(!this.hovered){return}var aj=3D$(this).offset(),a= n=3Dao.pageX-aj.left,am=3Dao.pageY-aj.top,at=3Dad.feature_mapper.get_featur= e_data(an,am),ak=3D(at?at[0]:null);$(this).parents(".track-content").childr= en(".overlay").children(".feature-popup").each(function(){if(!ak||$(this).a= ttr("id")!=3D=3Dak.toString()){$(this).remove()}});if(at){var af=3Dac[ak];i= f(!af){var ak=3Dat[0],ap=3D{name:at[3],start:at[1],end:at[2],strand:at[4]},= ai=3Dad.track.filters_manager.filters,ah;for(var al=3D0;al<ai.length;al++){= ah=3Dai[al];ap[ah.name]=3Dat[ah.index]}var af=3D$("<div/>").attr("id",ak).a= ddClass("feature-popup"),au=3D$("<table/>"),ar,aq,av;for(ar in ap){aq=3Dap[= ar];av=3D$("<tr/>").appendTo(au);$("<th/>").appendTo(av).text(ar);$("<td/>"= ).attr("align","left").appendTo(av).text(typeof(aq)=3D=3D=3D"number"?W(aq,2= ):aq)}af.append($("<div class=3D'feature-popup-inner'>").append(au));ac[ak]= =3Daf}af.appendTo($(this).parents(".track-content").children(".overlay"));v= ar ag=3Dan+parseInt(ad.html_elt.css("left"))-af.width()/2,ae=3Dam+parseInt(= ad.html_elt.css("top"))+7;af.css("left",ag+"px").css("top",ae+"px")}else{if= (!ao.isPropagationStopped()){ao.stopPropagation();$(this).siblings().each(f= unction(){$(this).trigger(ao)})}}}).mouseleave(function(){$(this).parents("= .track-content").children(".overlay").children(".feature-popup").remove()})= };var g=3Dfunction(ad,ac,ae){q(ae,{drag_handle_class:"draghandle"});r.call(= this,ad,ac,ae);this.dataset=3Dnew Y.Dataset({id:ae.dataset_id,hda_ldda:ae.h= da_ldda});this.dataset_check_type=3D"converted_datasets_state";this.data_ur= l_extra_params=3D{};this.data_query_wait=3D("data_query_wait" in ae?ae.data= _query_wait:K);this.data_manager=3D("data_manager" in ae?ae.data_manager:ne= w x.GenomeDataManager({dataset:this.dataset,data_mode_compatible:this.data_= and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=3D16;t= his.max_height_px=3D800;this.visible_height_px=3D0;this.content_div=3D$("<d= iv class=3D'track-content'>").appendTo(this.container_div);if(this.containe= r){this.container.content_div.append(this.container_div);if(!("resize" in a= e)||ae.resize){this.add_resize_handle()}}};q(g.prototype,r.prototype,{actio= n_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-= expand",on_click_fn:function(){}},r.prototype.action_icons_def[0],{name:"ov= erview_icon",title:"Set as overview",css_class:"overview-icon",on_click_fn:= function(ac){ac.view.set_overview(ac)}},r.prototype.action_icons_def[1],{na= me:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:func= tion(ac){if(ac.filters_manager.visible()){ac.filters_manager.clear_filters(= )}else{ac.filters_manager.init_filters()}ac.filters_manager.toggle()}},{nam= e:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(ac){ac.= dynamic_tool_div.toggle();if(ac.dynamic_tool_div.is(":visible")){ac.set_nam= e(ac.name+ac.tool_region_and_parameters_str())}else{ac.revert_name()}$(".bs= -tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter sp= ace visualization",css_class:"arrow-split",on_click_fn:function(ac){var af= =3D'<strong>Tool</strong>: <%=3D track.tool.name %><br/><strong>Dataset</st= rong>: <%=3D track.name %><br/><strong>Region(s)</strong>: <select name=3D"= regions"><option value=3D"cur">current viewing area</option><option value= =3D"bookmarks">bookmarks</option><option value=3D"both">current viewing are= a and bookmarks</option></select>',ae=3Dab.template(af,{track:ac});var ah= =3Dfunction(){hide_modal();$(window).unbind("keypress.check_enter_esc")},ad= =3Dfunction(){var aj=3D$('select[name=3D"regions"] option:selected').val(),= al,ai=3Dnew x.GenomeRegion({chrom:view.chrom,start:view.low,end:view.high})= ,ak=3Dab.map($(".bookmark"),function(am){return new x.GenomeRegion({from_st= r:$(am).children(".position").text()})});if(aj=3D=3D=3D"cur"){al=3D[ai]}els= e{if(aj=3D=3D=3D"bookmarks"){al=3Dak}else{al=3D[ai].concat(ak)}}hide_modal(= );window.location.href=3Dgalaxy_paths.get("sweepster_url")+"?"+$.param({dat= aset_id:ac.dataset_id,hda_ldda:ac.hda_ldda,regions:JSON.stringify(new Backb= one.Collection(al).toJSON())})},ag=3Dfunction(ai){if((ai.keyCode||ai.which)= =3D=3D=3D27){ah()}else{if((ai.keyCode||ai.which)=3D=3D=3D13){ad()}}};show_m= odal("Visualize tool parameter space and output from different parameter se= ttings?",ae,{No:ah,Yes:ad})}},r.prototype.action_icons_def[2]],can_draw:fun= ction(){if(this.dataset_id&&r.prototype.can_draw.call(this)){return true}re= turn false},build_container_div:function(){return $("<div/>").addClass("tra= ck").attr("id","track_"+this.id).css("position","relative")},build_header_d= iv:function(){var ac=3D$("<div class=3D'track-header'/>");if(this.view.edit= or){this.drag_div=3D$("<div/>").addClass(this.drag_handle_class).appendTo(a= c)}this.name_div=3D$("<div/>").addClass("track-name").appendTo(ac).text(thi= s.name).attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"= ").toLowerCase());return ac},on_resize:function(){},add_resize_handle:funct= ion(){var ac=3Dthis;var af=3Dfalse;var ae=3Dfalse;var ad=3D$("<div class=3D= 'track-resize'>");$(ac.container_div).hover(function(){if(ac.content_visibl= e){af=3Dtrue;ad.show()}},function(){af=3Dfalse;if(!ae){ad.hide()}});ad.hide= ().bind("dragstart",function(ag,ah){ae=3Dtrue;ah.original_height=3D$(ac.con= tent_div).height()}).bind("drag",function(ah,ai){var ag=3DMath.min(Math.max= (ai.original_height+ai.deltaY,ac.min_height_px),ac.max_height_px);$(ac.tile= s_div).css("height",ag);ac.visible_height_px=3D(ac.max_height_px=3D=3D=3Dag= ?0:ag);ac.on_resize()}).bind("dragend",function(ag,ah){ac.tile_cache.clear(= );ae=3Dfalse;if(!af){ad.hide()}ac.config.values.height=3Dac.visible_height_= px;ac.changed()}).appendTo(ac.container_div)},set_display_modes:function(af= ,ai){this.display_modes=3Daf;this.mode=3D(ai?ai:(this.config&&this.config.v= alues.mode?this.config.values.mode:this.display_modes[0]));this.action_icon= s.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var ad=3D= this,ag=3D{};for(var ae=3D0,ac=3Dad.display_modes.length;ae<ac;ae++){var ah= =3Dad.display_modes[ae];ag[ah]=3Dfunction(aj){return function(){ad.change_m= ode(aj);ad.icons_div.show();ad.container_div.mouseleave(function(){ad.icons= _div.hide()})}}(ah)}make_popupmenu(this.action_icons.mode_icon,ag)},build_a= ction_icons:function(){r.prototype.build_action_icons.call(this,this.action= _icons_def);if(this.display_modes!=3D=3Dundefined){this.set_display_modes(t= his.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.co= ntainer_div.find(".yaxislabel, .track-resize").hide()},show_contents:functi= on(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-res= ize").show();this.request_draw()},get_type:function(){if(this instanceof X)= {return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrack"}else{= if(this instanceof h){return"LineTrack"}else{if(this instanceof T){return"R= eadTrack"}else{if(this instanceof R){return"VcfTrack"}else{if(this instance= of f){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack= "}}}}}}}return""},init:function(){var ad=3Dthis;ad.enabled=3Dfalse;ad.tile_= cache.clear();ad.data_manager.clear();ad.content_div.css("height","auto");a= d.tiles_div.children().remove();ad.container_div.removeClass("nodata error = pending");if(!ad.dataset_id){return}var ac=3D$.Deferred(),ae=3D{hda_ldda:ad= .hda_ldda,data_type:this.dataset_check_type,chrom:ad.view.chrom};$.getJSON(= this.dataset.url(),ae,function(af){if(!af||af=3D=3D=3D"error"||af.kind=3D= =3D=3D"error"){ad.container_div.addClass("error");ad.tiles_div.text(o);if(a= f.message){var ag=3D$(" <a href=3D'javascript:void(0);'></a>").text("View e= rror").click(function(){show_modal("Trackster Error","<pre>"+af.message+"</= pre>",{Close:hide_modal})});ad.tiles_div.append(ag)}}else{if(af=3D=3D=3D"no= converter"){ad.container_div.addClass("error");ad.tiles_div.text(J)}else{i= f(af=3D=3D=3D"no data"||(af.data!=3D=3Dundefined&&(af.data=3D=3D=3Dnull||af= .data.length=3D=3D=3D0))){ad.container_div.addClass("nodata");ad.tiles_div.= text(E)}else{if(af=3D=3D=3D"pending"){ad.container_div.addClass("pending");= ad.tiles_div.html(v);setTimeout(function(){ad.init()},ad.data_query_wait)}e= lse{if(af=3D=3D=3D"data"||af.status=3D=3D=3D"data"){if(af.valid_chroms){ad.= valid_chroms=3Daf.valid_chroms;ad.update_icons()}ad.tiles_div.text(U);if(ad= .view.chrom){ad.tiles_div.text("");ad.tiles_div.css("height",ad.visible_hei= ght_px+"px");ad.enabled=3Dtrue;$.when(ad.predraw_init()).done(function(){ac= .resolve();ad.container_div.removeClass("nodata error pending");ad.request_= draw()})}else{ac.resolve()}}}}}}});this.update_icons();return ac},predraw_i= nit:function(){},get_drawables:function(){return this}});var M=3Dfunction(a= e,ad,af){g.call(this,ae,ad,af);var ac=3Dthis;m(ac.container_div,ac.drag_han= dle_class,".group",ac);this.filters_manager=3Dnew i.FiltersManager(this,("f= ilters" in af?af.filters:null));this.data_manager.set("filters_manager",thi= s.filters_manager);this.filters_available=3Dfalse;this.tool=3D("tool" in af= &&af.tool?new s(this,af.tool,af.tool_state):null);this.tile_cache=3Dnew x.C= ache(Q);if(this.header_div){this.set_filters_manager(this.filters_manager);= if(this.tool){this.dynamic_tool_div=3Dthis.tool.parent_div;this.header_div.= after(this.dynamic_tool_div)}}this.tiles_div=3D$("<div/>").addClass("tiles"= ).appendTo(this.content_div);this.overlay_div=3D$("<div/>").addClass("overl= ay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)}};q(M= .prototype,r.prototype,g.prototype,{action_icons_def:g.prototype.action_ico= ns_def.concat([{name:"show_more_rows_icon",title:"To minimize track height,= not all feature rows are displayed. Click to display more rows.",css_class= :"exclamation",on_click_fn:function(ac){$(".bs-tooltip").remove();ac.slotte= rs[ac.view.resolution_px_b].max_rows*=3D2;ac.request_draw(true)},hide:true}= ]),copy:function(ac){var ad=3Dthis.to_dict();q(ad,{data_manager:this.data_m= anager});var ae=3Dnew this.constructor(this.view,ac,ad);ae.change_mode(this= .mode);ae.enabled=3Dthis.enabled;return ae},set_filters_manager:function(ac= ){this.filters_manager=3Dac;this.header_div.after(this.filters_manager.pare= nt_div)},to_dict:function(){return{track_type:this.get_type(),name:this.nam= e,hda_ldda:this.hda_ldda,dataset_id:this.dataset_id,prefs:this.prefs,mode:t= his.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool?this.= tool.state_dict():{})}},change_mode:function(ad){var ac=3Dthis;ac.mode=3Dad= ;ac.config.values.mode=3Dad;ac.tile_cache.clear();ac.request_draw();this.ac= tion_icons.mode_icon.attr("title","Set display mode (now: "+ac.mode+")");re= turn ac},update_icons:function(){var ac=3Dthis;if(ac.filters_available){ac.= action_icons.filters_icon.show()}else{ac.action_icons.filters_icon.hide()}i= f(ac.tool){ac.action_icons.tools_icon.show();ac.action_icons.param_space_vi= z_icon.show()}else{ac.action_icons.tools_icon.hide();ac.action_icons.param_= space_viz_icon.hide()}},_gen_tile_cache_key:function(ad,ae,ac){return ad+"_= "+ae+"_"+ac},request_draw:function(ad,ac){this.view.request_redraw(false,ad= ,ac,this)},before_draw:function(){},_draw:function(ad,an){if(!this.can_draw= ()){return}var al=3Dthis.view.low,ah=3Dthis.view.high,aj=3Dah-al,ae=3Dthis.= view.container.width(),ap=3Dthis.view.resolution_px_b,ag=3Dthis.view.resolu= tion_b_px;if(this.is_overview){al=3Dthis.view.max_low;ah=3Dthis.view.max_hi= gh;ag=3D(view.max_high-view.max_low)/ae;ap=3D1/ag}this.before_draw();this.t= iles_div.children().addClass("remove");var ac=3DMath.floor(al/(ag*S)),ak=3D= true,ao=3D[],ai=3Dfunction(aq){return(aq&&"track" in aq)};while((ac*S*ag)<a= h){var am=3Dthis.draw_helper(ad,ae,ac,ag,this.tiles_div,ap);if(ai(am)){ao.p= ush(am)}else{ak=3Dfalse}ac+=3D1}if(!an){this.tiles_div.children(".remove").= removeClass("remove").remove()}var af=3Dthis;if(ak){this.tiles_div.children= (".remove").remove();af.postdraw_actions(ao,ae,ap,an)}},postdraw_actions:fu= nction(ae,af,ah,ac){var ag=3Dfalse;for(var ad=3D0;ad<ae.length;ad++){if(ae[= ad].has_icons){ag=3Dtrue;break}}if(ag){for(var ad=3D0;ad<ae.length;ad++){ti= le=3Dae[ad];if(!tile.has_icons){tile.html_elt.css("padding-top",D)}}}},draw= _helper:function(ac,ao,au,ar,ah,ai,ap){var an=3Dthis,ax=3Dthis._gen_tile_ca= che_key(ao,ai,au),af=3Dthis._get_tile_bounds(au,ar);if(!ap){ap=3D{}}var aw= =3D(ac?undefined:an.tile_cache.get_elt(ax));if(aw){an.show_tile(aw,ah,ai);r= eturn aw}var al=3Dtrue;var at=3Dan.data_manager.get_data(af,an.mode,ar,an.d= ata_url_extra_params);if(V(at)){al=3Dfalse}var aj;if(view.reference_track&&= ai>view.canvas_manager.char_width_px){aj=3Dview.reference_track.data_manage= r.get_data(af,an.mode,ar,view.reference_track.data_url_extra_params);if(V(a= j)){al=3Dfalse}}if(al){q(at,ap.more_tile_data);var ak=3Dan.mode;if(ak=3D=3D= =3D"Auto"){ak=3Dan.get_mode(at);an.update_auto_mode(ak)}var ae=3Dan.view.ca= nvas_manager.new_canvas(),av=3Daf.get("start"),ad=3Daf.get("end"),ao=3DMath= .ceil((ad-av)*ai)+an.left_offset,am=3Dan.get_canvas_height(at,ak,ai,ao);ae.= width=3Dao;ae.height=3Dam;var aq=3Dae.getContext("2d");aq.translate(this.le= ft_offset,0);var aw=3Dan.draw_tile(at,aq,ak,ar,af,ai,aj);if(aw!=3D=3Dundefi= ned){an.tile_cache.set_elt(ax,aw);an.show_tile(aw,ah,ai)}return aw}var ag= =3D$.Deferred();$.when(at,aj).then(function(){view.request_redraw(false,fal= se,false,an);ag.resolve()});return ag},get_canvas_height:function(ac,ae,af,= ad){return this.visible_height_px},draw_tile:function(ac,ad,ah,af,ag,ai,ae)= {console.log("Warning: TiledTrack.draw_tile() not implemented.")},show_tile= :function(ae,ah,ai){var ad=3Dthis,ac=3Dae.html_elt;ae.predisplay_actions();= var ag=3D(ae.low-(this.is_overview?this.view.max_low:this.view.low))*ai;if(= this.left_offset){ag-=3Dthis.left_offset}ac.css({position:"absolute",top:0,= left:ag});if(ac.hasClass("remove")){ac.removeClass("remove")}else{ah.append= (ac)}ae.html_elt.height("auto");this.max_height_px=3DMath.max(this.max_heig= ht_px,ae.html_elt.height());ae.html_elt.parent().children().css("height",th= is.max_height_px+"px");var af=3Dthis.max_height_px;if(this.visible_height_p= x!=3D=3D0){af=3DMath.min(this.max_height_px,this.visible_height_px)}this.ti= les_div.css("height",af+"px")},_get_tile_bounds:function(ac,ad){var af=3DMa= th.floor(ac*S*ad),ag=3DMath.ceil(S*ad),ae=3D(af+ag<=3Dthis.view.max_high?af= +ag:this.view.max_high);return new x.GenomeRegion({chrom:this.view.chrom,st= art:af,end:ae})},tool_region_and_parameters_str:function(ae,ac,af){var ad= =3Dthis,ag=3D(ae!=3D=3Dundefined&&ac!=3D=3Dundefined&&af!=3D=3Dundefined?ae= +":"+ac+"-"+af:"all");return" - region=3D["+ag+"], parameters=3D["+ad.tool.= get_param_values().join(", ")+"]"},data_and_mode_compatible:function(ac,ad)= {return true},can_subset:function(ac){return false},init_for_tool_data:func= tion(){this.data_manager.set("data_type","raw_data");this.data_query_wait= =3D1000;this.dataset_check_type=3D"state";this.normal_postdraw_actions=3Dth= is.postdraw_actions;this.postdraw_actions=3Dfunction(ae,af,ah,ac){var ad=3D= this;ad.normal_postdraw_actions(ae,af,ah,ac);ad.dataset_check_type=3D"conve= rted_datasets_state";ad.data_query_wait=3DK;var ag=3Dnew l.ServerStateDefer= red({url:ad.dataset_state_url,url_params:{dataset_id:ad.dataset_id,hda_ldda= :ad.hda_ldda},interval:ad.data_query_wait,success_fn:function(ai){return ai= !=3D=3D"pending"}});$.when(ag.go()).then(function(){ad.data_manager.set("da= ta_type","data")});ad.postdraw_actions=3Dad.normal_postdraw_actions}}});var= X=3Dfunction(ad,ac){var ae=3D{resize:false};g.call(this,ad,ac,ae);this.con= tainer_div.addClass("label-track")};q(X.prototype,g.prototype,{build_header= _div:function(){},init:function(){this.enabled=3Dtrue},_draw:function(){var= ae=3Dthis.view,af=3Dae.high-ae.low,ai=3DMath.floor(Math.pow(10,Math.floor(= Math.log(af)/Math.log(10)))),ac=3DMath.floor(ae.low/ai)*ai,ag=3Dthis.view.c= ontainer.width(),ad=3D$("<div style=3D'position: relative; height: 1.3em;'>= </div>");while(ac<ae.high){var ah=3D(ac-ae.low)/af*ag;ad.append($("<div cla= ss=3D'label'>"+commatize(ac)+"</div>").css({position:"absolute",left:ah-1})= );ac+=3Dai}this.content_div.children(":first").remove();this.content_div.ap= pend(ad)}});var f=3Dfunction(ad,ac,ag){M.call(this,ad,ac,ag);this.drawables= =3D[];this.left_offset=3D0;if("drawables" in ag){var af;for(var ae=3D0;ae<a= g.drawables.length;ae++){af=3Dag.drawables[ae];this.drawables[ae]=3Dp(af,ad= ,null);if(af.left_offset>this.left_offset){this.left_offset=3Daf.left_offse= t}}this.enabled=3Dtrue}if(this.drawables.length!=3D=3D0){this.set_display_m= odes(this.drawables[0].display_modes,this.drawables[0].mode)}this.update_ic= ons();this.obj_type=3D"CompositeTrack"};q(f.prototype,M.prototype,{action_i= cons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"= layers-stack",on_click_fn:function(ac){$(".bs-tooltip").remove();ac.show_gr= oup()}}].concat(M.prototype.action_icons_def),to_dict:z.prototype.to_dict,a= dd_drawable:z.prototype.add_drawable,unpack_drawables:z.prototype.unpack_dr= awables,change_mode:function(ac){M.prototype.change_mode.call(this,ac);for(= var ad=3D0;ad<this.drawables.length;ad++){this.drawables[ad].change_mode(ac= )}},init:function(){var ae=3D[];for(var ad=3D0;ad<this.drawables.length;ad+= +){ae.push(this.drawables[ad].init())}var ac=3Dthis;$.when.apply($,ae).then= (function(){ac.enabled=3Dtrue;ac.request_draw()})},update_icons:function(){= this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();t= his.action_icons.param_space_viz_icon.hide()},can_draw:r.prototype.can_draw= ,draw_helper:function(ad,at,az,aw,ak,am,au){var ar=3Dthis,aD=3Dthis._gen_ti= le_cache_key(at,am,az),ah=3Dthis._get_tile_bounds(az,aw);if(!au){au=3D{}}va= r aC=3D(ad?undefined:ar.tile_cache.get_elt(aD));if(aC){ar.show_tile(aC,ak,a= m);return aC}var al=3D[],ar,ap=3Dtrue,ax,an;for(var ay=3D0;ay<this.drawable= s.length;ay++){ar=3Dthis.drawables[ay];ax=3Dar.data_manager.get_data(ah,ar.= mode,aw,ar.data_url_extra_params);if(V(ax)){ap=3Dfalse}al.push(ax);an=3Dnul= l;if(view.reference_track&&am>view.canvas_manager.char_width_px){an=3Dview.= reference_track.data_manager.get_data(ah,ar.mode,aw,view.reference_track.da= ta_url_extra_params);if(V(an)){ap=3Dfalse}}al.push(an)}if(ap){q(ax,au.more_= tile_data);this.tile_predraw_init();var ag=3Dar.view.canvas_manager.new_can= vas(),ai=3Dar._get_tile_bounds(az,aw),aA=3Dah.get("start"),ae=3Dah.get("end= "),aB=3D0,at=3DMath.ceil((ae-aA)*am)+this.left_offset,aq=3D0,af=3D[],ay;var= ac=3D0;for(ay=3D0;ay<this.drawables.length;ay++,aB+=3D2){ar=3Dthis.drawabl= es[ay];ax=3Dal[aB];var ao=3Dar.mode;if(ao=3D=3D=3D"Auto"){ao=3Dar.get_mode(= ax);ar.update_auto_mode(ao)}af.push(ao);ac=3Dar.get_canvas_height(ax,ao,am,= at);if(ac>aq){aq=3Dac}}ag.width=3Dat;ag.height=3D(au.height?au.height:aq);a= B=3D0;var av=3Dag.getContext("2d");av.translate(this.left_offset,0);av.glob= alAlpha=3D0.5;av.globalCompositeOperation=3D"source-over";for(ay=3D0;ay<thi= s.drawables.length;ay++,aB+=3D2){ar=3Dthis.drawables[ay];ax=3Dal[aB];an=3Da= l[aB+1];aC=3Dar.draw_tile(ax,av,af[ay],aw,ah,am,an)}this.tile_cache.set_elt= (aD,aC);this.show_tile(aC,ak,am);return aC}var aj=3D$.Deferred(),ar=3Dthis;= $.when.apply($,al).then(function(){view.request_redraw(false,false,false,ar= );aj.resolve()});return aj},show_group:function(){var af=3Dnew P(this.view,= this.container,{name:this.name}),ac;for(var ae=3D0;ae<this.drawables.length= ;ae++){ac=3Dthis.drawables[ae];ac.update_icons();af.add_drawable(ac);ac.con= tainer=3Daf;af.content_div.append(ac.container_div)}var ad=3Dthis.container= .replace_drawable(this,af,true);af.request_draw()},tile_predraw_init:functi= on(){var af=3DNumber.MAX_VALUE,ac=3D-af,ad;for(var ae=3D0;ae<this.drawables= .length;ae++){ad=3Dthis.drawables[ae];if(ad instanceof h){if(ad.prefs.min_v= alue<af){af=3Dad.prefs.min_value}if(ad.prefs.max_value>ac){ac=3Dad.prefs.ma= x_value}}}for(var ae=3D0;ae<this.drawables.length;ae++){ad=3Dthis.drawables= [ae];ad.prefs.min_value=3Daf;ad.prefs.max_value=3Dac}},postdraw_actions:fun= ction(ae,ah,aj,ad){M.prototype.postdraw_actions.call(this,ae,ah,aj,ad);var = ag=3D-1;for(var af=3D0;af<ae.length;af++){var ac=3Dae[af].html_elt.find("ca= nvas").height();if(ac>ag){ag=3Dac}}for(var af=3D0;af<ae.length;af++){var ai= =3Dae[af];if(ai.html_elt.find("canvas").height()!=3D=3Dag){this.draw_helper= (true,ah,ai.index,ai.resolution,ai.html_elt.parent(),aj,{height:ag});ai.htm= l_elt.remove()}}}});var B=3Dfunction(ac){M.call(this,ac,{content_div:ac.top= _labeltrack},{resize:false});ac.reference_track=3Dthis;this.left_offset=3D2= 00;this.visible_height_px=3D12;this.container_div.addClass("reference-track= ");this.content_div.css("background","none");this.content_div.css("min-heig= ht","0px");this.content_div.css("border","none");this.data_url=3Dreference_= url+"/"+this.view.dbkey;this.data_url_extra_params=3D{reference:true};this.= data_manager=3Dnew x.ReferenceTrackDataManager({data_url:this.data_url});th= is.hide_contents()};q(B.prototype,r.prototype,M.prototype,{build_header_div= :function(){},init:function(){this.data_manager.clear();this.enabled=3Dtrue= },can_draw:r.prototype.can_draw,draw_helper:function(ag,ae,ac,ad,ah,ai,af){= if(ai>this.view.canvas_manager.char_width_px){return M.prototype.draw_helpe= r.call(this,ag,ae,ac,ad,ah,ai,af)}else{this.hide_contents();return null}},d= raw_tile:function(ak,al,ag,af,ai,am){var ae=3Dthis;if(am>this.view.canvas_m= anager.char_width_px){if(ak.data=3D=3D=3Dnull){this.hide_contents();return}= var ad=3Dal.canvas;al.font=3Dal.canvas.manager.default_font;al.textAlign=3D= "center";ak=3Dak.data;for(var ah=3D0,aj=3Dak.length;ah<aj;ah++){var ac=3DMa= th.floor(ah*am);al.fillText(ak[ah],ac,10)}this.show_contents();return new b= (ae,ai,af,ad,ak)}this.hide_contents()}});var h=3Dfunction(ae,ad,af){var ac= =3Dthis;this.display_modes=3D["Histogram","Line","Filled","Intensity"];this= .mode=3D"Histogram";M.call(this,ae,ad,af);this.hda_ldda=3Daf.hda_ldda;this.= dataset_id=3Daf.dataset_id;this.original_dataset_id=3Dthis.dataset_id;this.= left_offset=3D0;this.config=3Dnew F({track:this,params:[{key:"name",label:"= Name",type:"text",default_value:this.name},{key:"color",label:"Color",type:= "color",default_value:l.get_random_color()},{key:"min_value",label:"Min Val= ue",type:"float",default_value:undefined},{key:"max_value",label:"Max Value= ",type:"float",default_value:undefined},{key:"mode",type:"string",default_v= alue:this.mode,hidden:true},{key:"height",type:"int",default_value:32,hidde= n:true}],saved_values:af.prefs,onchange:function(){ac.set_name(ac.prefs.nam= e);ac.vertical_range=3Dac.prefs.max_value-ac.prefs.min_value;ac.set_min_val= ue(ac.prefs.min_value);ac.set_max_value(ac.prefs.max_value)}});this.prefs= =3Dthis.config.values;this.visible_height_px=3Dthis.config.values.height;th= is.vertical_range=3Dthis.config.values.max_value-this.config.values.min_val= ue};q(h.prototype,r.prototype,M.prototype,{on_resize:function(){this.reques= t_draw(true)},set_min_value:function(ac){this.prefs.min_value=3Dac;$("#line= track_"+this.dataset_id+"_minval").text(this.prefs.min_value);this.tile_cac= he.clear();this.request_draw()},set_max_value:function(ac){this.prefs.max_v= alue=3Dac;$("#linetrack_"+this.dataset_id+"_maxval").text(this.prefs.max_va= lue);this.tile_cache.clear();this.request_draw()},predraw_init:function(){v= ar ac=3Dthis;ac.vertical_range=3Dundefined;return $.getJSON(ac.dataset.url(= ),{data_type:"data",stats:true,chrom:ac.view.chrom,low:0,high:ac.view.max_h= igh,hda_ldda:ac.hda_ldda},function(ad){ac.container_div.addClass("line-trac= k");var ag=3Dad.data;if(isNaN(parseFloat(ac.prefs.min_value))||isNaN(parseF= loat(ac.prefs.max_value))){var ae=3Dag.min,ai=3Dag.max;ae=3DMath.floor(Math= .min(0,Math.max(ae,ag.mean-2*ag.sd)));ai=3DMath.ceil(Math.max(0,Math.min(ai= ,ag.mean+2*ag.sd)));ac.prefs.min_value=3Dae;ac.prefs.max_value=3Dai;$("#tra= ck_"+ac.dataset_id+"_minval").val(ac.prefs.min_value);$("#track_"+ac.datase= t_id+"_maxval").val(ac.prefs.max_value)}ac.vertical_range=3Dac.prefs.max_va= lue-ac.prefs.min_value;ac.total_frequency=3Dag.total_frequency;ac.container= _div.find(".yaxislabel").remove();var ah=3D$("<div/>").text(W(ac.prefs.min_= value,3)).make_text_editable({num_cols:6,on_finish:function(aj){$(".bs-tool= tip").remove();var aj=3DparseFloat(aj);if(!isNaN(aj)){ac.set_min_value(aj)}= },help_text:"Set min value"}).addClass("yaxislabel bottom").attr("id","line= track_"+ac.dataset_id+"_minval").prependTo(ac.container_div),af=3D$("<div/>= ").text(W(ac.prefs.max_value,3)).make_text_editable({num_cols:6,on_finish:f= unction(aj){$(".bs-tooltip").remove();var aj=3DparseFloat(aj);if(!isNaN(aj)= ){ac.set_max_value(aj)}},help_text:"Set max value"}).addClass("yaxislabel t= op").attr("id","linetrack_"+ac.dataset_id+"_maxval").prependTo(ac.container= _div)})},draw_tile:function(al,aj,ae,ad,ag,ak){var ac=3Daj.canvas,af=3Dag.g= et("start"),ai=3Dag.get("end"),ah=3Dnew L.LinePainter(al.data,af,ai,this.pr= efs,ae);ah.draw(aj,ac.width,ac.height,ak);return new b(this,ag,ad,ac,al.dat= a)},can_subset:function(ac){return false}});var t=3Dfunction(ae,ad,af){var = ac=3Dthis;this.display_modes=3D["Heatmap"];this.mode=3D"Heatmap";M.call(thi= s,ae,ad,af);this.hda_ldda=3Daf.hda_ldda;this.dataset_id=3Daf.dataset_id;thi= s.original_dataset_id=3Dthis.dataset_id;this.left_offset=3D0;this.config=3D= new F({track:this,params:[{key:"name",label:"Name",type:"text",default_valu= e:this.name},{key:"pos_color",label:"Positive Color",type:"color",default_v= alue:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",defaul= t_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",default_= value:-1},{key:"max_value",label:"Max Value",type:"float",default_value:1},= {key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height= ",type:"int",default_value:500,hidden:true}],saved_values:af.prefs,onchange= :function(){ac.set_name(ac.prefs.name);ac.vertical_range=3Dac.prefs.max_val= ue-ac.prefs.min_value;ac.set_min_value(ac.prefs.min_value);ac.set_max_value= (ac.prefs.max_value)}});this.prefs=3Dthis.config.values;this.visible_height= _px=3Dthis.config.values.height;this.vertical_range=3Dthis.config.values.ma= x_value-this.config.values.min_value};q(t.prototype,r.prototype,M.prototype= ,{on_resize:function(){this.request_draw(true)},set_min_value:function(ac){= this.prefs.min_value=3Dac;this.tile_cache.clear();this.request_draw()},set_= max_value:function(ac){this.prefs.max_value=3Dac;this.tile_cache.clear();th= is.request_draw()},draw_tile:function(ac,ae,ai,ag,ah,aj){var af=3Dae.canvas= ,ad=3Dnew L.DiagonalHeatmapPainter(ac.data,ah.get("start"),ah.get("end"),th= is.prefs,ai);ad.draw(ae,af.width,af.height,aj);return new b(this,ah,ag,af,a= c.data)}});var c=3Dfunction(af,ae,ah){var ad=3Dthis;this.display_modes=3D["= Auto","Coverage","Dense","Squish","Pack"];M.call(this,af,ae,ah);var ag=3Dl.= get_random_color(),ac=3Dl.get_random_color([ag,"#FFFFFF"]);this.config=3Dne= w F({track:this,params:[{key:"name",label:"Name",type:"text",default_value:= this.name},{key:"block_color",label:"Block color",type:"color",default_valu= e:ag},{key:"reverse_strand_color",label:"Antisense strand color",type:"colo= r",default_value:ac},{key:"label_color",label:"Label color",type:"color",de= fault_value:"black"},{key:"show_counts",label:"Show summary counts",type:"b= ool",default_value:true,help:"Show the number of items in each bin when dra= wing summary histogram"},{key:"histogram_max",label:"Histogram maximum",typ= e:"float",default_value:null,help:"clear value to set automatically"},{key:= "connector_style",label:"Connector style",type:"select",default_value:"fish= bones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",v= alue:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:tru= e},{key:"height",type:"int",default_value:this.visible_height_px,hidden:tru= e}],saved_values:ah.prefs,onchange:function(){ad.set_name(ad.prefs.name);ad= .tile_cache.clear();ad.set_painter_from_config();ad.request_draw()}});this.= prefs=3Dthis.config.values;this.visible_height_px=3Dthis.config.values.heig= ht;this.container_div.addClass("feature-track");this.hda_ldda=3Dah.hda_ldda= ;this.dataset_id=3Dah.dataset_id;this.original_dataset_id=3Dah.dataset_id;t= his.show_labels_scale=3D0.001;this.showing_details=3Dfalse;this.summary_dra= w_height=3D30;this.slotters=3D{};this.start_end_dct=3D{};this.left_offset= =3D200;this.set_painter_from_config()};q(c.prototype,r.prototype,M.prototyp= e,{set_dataset:function(ac){this.dataset_id=3Dac.get("id");this.hda_ldda=3D= ac.get("hda_ldda");this.dataset=3Dac;this.data_manager.set("dataset",ac)},s= et_painter_from_config:function(){if(this.config.values.connector_style=3D= =3D=3D"arcs"){this.painter=3DL.ArcLinkedFeaturePainter}else{this.painter=3D= L.LinkedFeaturePainter}},before_draw:function(){this.max_height_px=3D0},pos= tdraw_actions:function(ar,am,ah,ag){M.prototype.postdraw_actions.call(this,= ar,ag);var al=3Dthis,ao;if(al.mode=3D=3D=3D"Coverage"){var ad=3D-1;for(ao= =3D0;ao<ar.length;ao++){var an=3Dar[ao].max_val;if(an>ad){ad=3Dan}}for(ao= =3D0;ao<ar.length;ao++){var au=3Dar[ao];if(au.max_val!=3D=3Dad){au.html_elt= .remove();al.draw_helper(true,am,au.index,au.resolution,au.html_elt.parent(= ),ah,{more_tile_data:{max:ad}})}}}if(al.filters_manager){var ai=3Dal.filter= s_manager.filters;for(var aq=3D0;aq<ai.length;aq++){ai[aq].update_ui_elt()}= var at=3Dfalse,ac,aj;for(ao=3D0;ao<ar.length;ao++){if(ar[ao].data.length){a= c=3Dar[ao].data[0];for(var aq=3D0;aq<ai.length;aq++){aj=3Dai[aq];if(aj.appl= ies_to(ac)&&aj.min!=3D=3Daj.max){at=3Dtrue;break}}}}if(al.filters_available= !=3D=3Dat){al.filters_available=3Dat;if(!al.filters_available){al.filters_m= anager.hide()}al.update_icons()}}this.container_div.find(".yaxislabel").rem= ove();var af=3Dar[0];if(af instanceof j){var ak=3D(this.prefs.histogram_max= ?this.prefs.histogram_max:af.max_val),ae=3D$("<div/>").text(ak).make_text_e= ditable({num_cols:12,on_finish:function(av){$(".bs-tooltip").remove();var a= v=3DparseFloat(av);al.prefs.histogram_max=3D(!isNaN(av)?av:null);al.tile_ca= che.clear();al.request_draw()},help_text:"Set max value; leave blank to use= default"}).addClass("yaxislabel top").css("color",this.prefs.label_color);= this.container_div.prepend(ae)}if(af instanceof O){var ap=3Dtrue;for(ao=3D0= ;ao<ar.length;ao++){if(!ar[ao].all_slotted){ap=3Dfalse;break}}if(!ap){this.= action_icons.show_more_rows_icon.show()}else{this.action_icons.show_more_ro= ws_icon.hide()}}else{this.action_icons.show_more_rows_icon.hide()}},update_= auto_mode:function(ac){var ac;if(this.mode=3D=3D=3D"Auto"){if(ac=3D=3D=3D"n= o_detail"){ac=3D"feature spans"}else{if(ac=3D=3D=3D"summary_tree"){ac=3D"co= verage histogram"}}this.action_icons.mode_icon.attr("title","Set display mo= de (now: Auto/"+ac+")")}},incremental_slots:function(ag,ac,af){var ad=3Dthi= s.view.canvas_manager.dummy_context,ae=3Dthis.slotters[ag];if(!ae||(ae.mode= !=3D=3Daf)){ae=3Dnew (u.FeatureSlotter)(ag,af,A,function(ah){return ad.meas= ureText(ah)});this.slotters[ag]=3Dae}return ae.slot_features(ac)},get_mode:= function(ac){if(ac.dataset_type=3D=3D=3D"summary_tree"){mode=3D"summary_tre= e"}else{if(ac.extra_info=3D=3D=3D"no_detail"||this.is_overview){mode=3D"no_= detail"}else{if(this.view.high-this.view.low>I){mode=3D"Squish"}else{mode= =3D"Pack"}}}return mode},get_canvas_height:function(ac,ag,ah,ad){if(ag=3D= =3D=3D"summary_tree"||ag=3D=3D=3D"Coverage"){return this.summary_draw_heigh= t}else{var af=3Dthis.incremental_slots(ah,ac.data,ag);var ae=3Dnew (this.pa= inter)(null,null,null,this.prefs,ag);return Math.max(aa,ae.get_required_hei= ght(af,ad))}},draw_tile:function(am,aq,ao,ar,af,aj,ae){var ap=3Dthis,ad=3Da= q.canvas,ay=3Daf.get("start"),ac=3Daf.get("end"),ag=3Dthis.left_offset;if(a= o=3D=3D=3D"summary_tree"||ao=3D=3D=3D"Coverage"){var aA=3Dnew L.SummaryTree= Painter(am,ay,ac,this.prefs);aA.draw(aq,ad.width,ad.height,aj);return new j= (ap,af,ar,ad,am.data,am.max)}var ai=3D[],an=3Dthis.slotters[aj].slots;all_s= lotted=3Dtrue;if(am.data){var ak=3Dthis.filters_manager.filters;for(var at= =3D0,av=3Dam.data.length;at<av;at++){var ah=3Dam.data[at];var au=3Dfalse;va= r al;for(var ax=3D0,aC=3Dak.length;ax<aC;ax++){al=3Dak[ax];al.update_attrs(= ah);if(!al.keep(ah)){au=3Dtrue;break}}if(!au){ai.push(ah);if(!(ah[0] in an)= ){all_slotted=3Dfalse}}}}var aB=3D(this.filters_manager.alpha_filter?new C(= this.filters_manager.alpha_filter):null);var az=3D(this.filters_manager.hei= ght_filter?new C(this.filters_manager.height_filter):null);var aA=3Dnew (th= is.painter)(ai,ay,ac,this.prefs,ao,aB,az,ae);var aw=3Dnull;aq.fillStyle=3Dt= his.prefs.block_color;aq.font=3Daq.canvas.manager.default_font;aq.textAlign= =3D"right";if(am.data){aw=3DaA.draw(aq,ad.width,ad.height,aj,an);aw.transla= tion=3D-ag}return new O(ap,af,ar,ad,am.data,aj,ao,am.message,all_slotted,aw= )},data_and_mode_compatible:function(ac,ad){if(ad=3D=3D=3D"Auto"){return tr= ue}else{if(ad=3D=3D=3D"Coverage"){return ac.dataset_type=3D=3D=3D"summary_t= ree"}else{if(ac.extra_info=3D=3D=3D"no_detail"||ac.dataset_type=3D=3D=3D"su= mmary_tree"){return false}else{return true}}}},can_subset:function(ac){if(a= c.dataset_type=3D=3D=3D"summary_tree"||ac.message||ac.extra_info=3D=3D=3D"n= o_detail"){return false}return true}});var R=3Dfunction(ad,ac,ae){c.call(th= is,ad,ac,ae);this.config=3Dnew F({track:this,params:[{key:"name",label:"Nam= e",type:"text",default_value:this.name},{key:"block_color",label:"Block col= or",type:"color",default_value:l.get_random_color()},{key:"label_color",lab= el:"Label color",type:"color",default_value:"black"},{key:"show_insertions"= ,label:"Show insertions",type:"bool",default_value:false},{key:"show_counts= ",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",t= ype:"string",default_value:this.mode,hidden:true}],saved_values:ae.prefs,on= change:function(){this.track.set_name(this.track.prefs.name);this.track.til= e_cache.clear();this.track.request_draw()}});this.prefs=3Dthis.config.value= s;this.painter=3DL.ReadPainter};q(R.prototype,r.prototype,M.prototype,c.pro= totype);var T=3Dfunction(ae,ad,ag){c.call(this,ae,ad,ag);var af=3Dl.get_ran= dom_color(),ac=3Dl.get_random_color([af,"#ffffff"]);this.config=3Dnew F({tr= ack:this,params:[{key:"name",label:"Name",type:"text",default_value:this.na= me},{key:"block_color",label:"Block and sense strand color",type:"color",de= fault_value:af},{key:"reverse_strand_color",label:"Antisense strand color",= type:"color",default_value:ac},{key:"label_color",label:"Label color",type:= "color",default_value:"black"},{key:"show_insertions",label:"Show insertion= s",type:"bool",default_value:false},{key:"show_differences",label:"Show dif= ferences only",type:"bool",default_value:true},{key:"show_counts",label:"Sh= ow summary counts",type:"bool",default_value:true},{key:"histogram_max",lab= el:"Histogram maximum",type:"float",default_value:null,help:"Clear value to= set automatically"},{key:"mode",type:"string",default_value:this.mode,hidd= en:true}],saved_values:ag.prefs,onchange:function(){this.track.set_name(thi= s.track.prefs.name);this.track.tile_cache.clear();this.track.request_draw()= }});this.prefs=3Dthis.config.values;this.painter=3DL.ReadPainter;this.updat= e_icons()};q(T.prototype,r.prototype,M.prototype,c.prototype);var d=3D{Line= Track:h,FeatureTrack:c,VcfTrack:R,ReadTrack:T,DiagonalHeatmapTrack:t,Compos= iteTrack:f,DrawableGroup:P};var p=3Dfunction(ae,ad,ac){if("copy" in ae){ret= urn ae.copy(ac)}else{var af=3Dae.obj_type;if(!af){af=3Dae.track_type}return= new d[af](ad,ac,ae)}};return{TracksterView:Z,DrawableGroup:P,LineTrack:h,F= eatureTrack:c,DiagonalHeatmapTrack:t,ReadTrack:T,VcfTrack:R,CompositeTrack:= f,object_from_template:p}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/trackster_ui.js --- a/static/scripts/packed/viz/trackster_ui.js +++ b/static/scripts/packed/viz/trackster_ui.js @@ -1,1 +1,1 @@ -define(["base","libs/underscore","viz/trackster/slotting","viz/trackster/p= ainters","viz/trackster/tracks","viz/visualization"],function(g,c,h,e,b,d){= var a=3Db.object_from_template;var f=3Dg.Base.extend({initialize:function(j= ){this.baseURL=3Dj},createButtonMenu:function(){var j=3Dthis,k=3Dcreate_ico= n_buttons_menu([{icon_class:"plus-button",title:"Add tracks",on_click:funct= ion(){d.select_datasets(select_datasets_url,add_track_async_url,view.dbkey,= function(l){c.each(l,function(m){view.add_drawable(a(m,view,view))})})}},{i= con_class:"block--plus",title:"Add group",on_click:function(){view.add_draw= able(new b.DrawableGroup(view,view,{name:"New Group"}))}},{icon_class:"book= marks",title:"Bookmarks",on_click:function(){parent.force_right_panel(($("d= iv#right").css("right")=3D=3D"0px"?"hide":"show"))}},{icon_class:"globe",ti= tle:"Circster",on_click:function(){window.location=3Dj.baseURL+"visualizati= on/circster?id=3D"+view.vis_id}},{icon_class:"disk--arrow",title:"Save",on_= click:function(){show_modal("Saving...","progress");var l=3D[];$(".bookmark= ").each(function(){l.push({position:$(this).children(".position").text(),an= notation:$(this).children(".annotation").text()})});var m=3D(view.overview_= drawable?view.overview_drawable.name:null),n=3D{view:view.to_dict(),viewpor= t:{chrom:view.chrom,start:view.low,end:view.high,overview:m},bookmarks:l};$= .ajax({url:galaxy_paths.get("visualization_url"),type:"POST",dataType:"json= ",data:{id:view.vis_id,title:view.name,dbkey:view.dbkey,type:"trackster",vi= s_json:JSON.stringify(n)}}).success(function(o){hide_modal();view.vis_id=3D= o.vis_id;view.has_changes=3Dfalse;window.history.pushState({},"",o.url+wind= ow.location.hash)}).error(function(){show_modal("Could Not Save","Could not= save visualization. Please try again later.",{Close:hide_modal})})}},{icon= _class:"cross-circle",title:"Close",on_click:function(){window.location=3Dj= .baseURL+"visualization/list"}}],{tooltip_config:{placement:"bottom"}});thi= s.buttonMenu=3Dk;return k},add_bookmarks:function(){var j=3Dthis,k=3Dthis.b= aseURL;show_modal("Select dataset for new bookmarks","progress");$.ajax({ur= l:this.baseURL+"/visualization/list_histories",data:{"f-dbkey":view.dbkey},= error:function(){alert("Grid failed")},success:function(l){show_modal("Sele= ct dataset for new bookmarks",l,{Cancel:function(){hide_modal()},Insert:fun= ction(){$("input[name=3Did]:checked,input[name=3Dldda_ids]:checked").first(= ).each(function(){var m,n=3D$(this).val();if($(this).attr("name")=3D=3D=3D"= id"){m=3D{hda_id:n}}else{m=3D{ldda_id:n}}$.ajax({url:this.baseURL+"/visuali= zation/bookmarks_from_dataset",data:m,dataType:"json"}).then(function(o){fo= r(i=3D0;i<o.data.length;i++){var p=3Do.data[i];j.add_bookmark(p[0],p[1])}})= });hide_modal()}})}})},add_bookmark:function(n,l,j){var p=3D$("#bookmarks-c= ontainer"),r=3D$("<div/>").addClass("bookmark").appendTo(p);var s=3D$("<div= />").addClass("position").appendTo(r),o=3D$("<a href=3D''/>").text(n).appen= dTo(s).click(function(){view.go_to(n);return false}),m=3D$("<div/>").text(l= ).appendTo(r);if(j){var q=3D$("<div/>").addClass("delete-icon-container").p= rependTo(r).click(function(){r.slideUp("fast");r.remove();view.has_changes= =3Dtrue;return false}),k=3D$("<a href=3D''/>").addClass("icon-button delete= ").appendTo(q);m.make_text_editable({num_rows:3,use_textarea:true,help_text= :"Edit bookmark note"}).addClass("annotation")}view.has_changes=3Dtrue;retu= rn r},create_visualization:function(o,j,n,p,m){var l=3Dthis,k=3Dnew b.View(= o);k.editor=3Dtrue;$.when(k.load_chroms_deferred).then(function(){if(j){var= y=3Dj.chrom,q=3Dj.start,v=3Dj.end,s=3Dj.overview;if(y&&(q!=3D=3Dundefined)= &&v){k.change_chrom(y,q,v)}}if(n){var t,r,u;for(var w=3D0;w<n.length;w++){k= .add_drawable(a(n[w],k,k))}}k.update_intro_div();var z;for(var w=3D0;w<k.dr= awables.length;w++){if(k.drawables[w].name=3D=3D=3Ds){k.set_overview(k.draw= ables[w]);break}}if(p){var x;for(var w=3D0;w<p.length;w++){x=3Dp[w];l.add_b= ookmark(x.position,x.annotation,m)}}k.has_changes=3Dfalse});return k},init_= keyboard_nav:function(j){$(document).keydown(function(k){if($(k.srcElement)= .is(":input")){return}switch(k.which){case 37:j.move_fraction(0.25);break;c= ase 38:var l=3DMath.round(j.viewport_container.height()/15);j.viewport_cont= ainer.scrollTop(j.viewport_container.scrollTop()-20);break;case 39:j.move_f= raction(-0.25);break;case 40:var l=3DMath.round(j.viewport_container.height= ()/15);j.viewport_container.scrollTop(j.viewport_container.scrollTop()+20);= break}})}});return{object_from_template:a,TracksterUI:f}}); \ No newline at end of file +define(["base","libs/underscore","viz/trackster/slotting","viz/trackster/p= ainters","viz/trackster/tracks","viz/visualization"],function(g,c,h,e,b,d){= var a=3Db.object_from_template;var f=3Dg.Base.extend({initialize:function(j= ){this.baseURL=3Dj},createButtonMenu:function(){var j=3Dthis,k=3Dcreate_ico= n_buttons_menu([{icon_class:"plus-button",title:"Add tracks",on_click:funct= ion(){d.select_datasets(select_datasets_url,add_track_async_url,{"f-dbkey":= view.dbkey},function(l){c.each(l,function(m){view.add_drawable(a(m,view,vie= w))})})}},{icon_class:"block--plus",title:"Add group",on_click:function(){v= iew.add_drawable(new b.DrawableGroup(view,view,{name:"New Group"}))}},{icon= _class:"bookmarks",title:"Bookmarks",on_click:function(){parent.force_right= _panel(($("div#right").css("right")=3D=3D"0px"?"hide":"show"))}},{icon_clas= s:"globe",title:"Circster",on_click:function(){window.location=3Dj.baseURL+= "visualization/circster?id=3D"+view.vis_id}},{icon_class:"disk--arrow",titl= e:"Save",on_click:function(){show_modal("Saving...","progress");var l=3D[];= $(".bookmark").each(function(){l.push({position:$(this).children(".position= ").text(),annotation:$(this).children(".annotation").text()})});var m=3D(vi= ew.overview_drawable?view.overview_drawable.name:null),n=3D{view:view.to_di= ct(),viewport:{chrom:view.chrom,start:view.low,end:view.high,overview:m},bo= okmarks:l};$.ajax({url:galaxy_paths.get("visualization_url"),type:"POST",da= taType:"json",data:{id:view.vis_id,title:view.name,dbkey:view.dbkey,type:"t= rackster",vis_json:JSON.stringify(n)}}).success(function(o){hide_modal();vi= ew.vis_id=3Do.vis_id;view.has_changes=3Dfalse;window.history.pushState({},"= ",o.url+window.location.hash)}).error(function(){show_modal("Could Not Save= ","Could not save visualization. Please try again later.",{Close:hide_modal= })})}},{icon_class:"cross-circle",title:"Close",on_click:function(){window.= location=3Dj.baseURL+"visualization/list"}}],{tooltip_config:{placement:"bo= ttom"}});this.buttonMenu=3Dk;return k},add_bookmarks:function(){var j=3Dthi= s,k=3Dthis.baseURL;show_modal("Select dataset for new bookmarks","progress"= );$.ajax({url:this.baseURL+"/visualization/list_histories",data:{"f-dbkey":= view.dbkey},error:function(){alert("Grid failed")},success:function(l){show= _modal("Select dataset for new bookmarks",l,{Cancel:function(){hide_modal()= },Insert:function(){$("input[name=3Did]:checked,input[name=3Dldda_ids]:chec= ked").first().each(function(){var m,n=3D$(this).val();if($(this).attr("name= ")=3D=3D=3D"id"){m=3D{hda_id:n}}else{m=3D{ldda_id:n}}$.ajax({url:this.baseU= RL+"/visualization/bookmarks_from_dataset",data:m,dataType:"json"}).then(fu= nction(o){for(i=3D0;i<o.data.length;i++){var p=3Do.data[i];j.add_bookmark(p= [0],p[1])}})});hide_modal()}})}})},add_bookmark:function(n,l,j){var p=3D$("= #bookmarks-container"),r=3D$("<div/>").addClass("bookmark").appendTo(p);var= s=3D$("<div/>").addClass("position").appendTo(r),o=3D$("<a href=3D''/>").t= ext(n).appendTo(s).click(function(){view.go_to(n);return false}),m=3D$("<di= v/>").text(l).appendTo(r);if(j){var q=3D$("<div/>").addClass("delete-icon-c= ontainer").prependTo(r).click(function(){r.slideUp("fast");r.remove();view.= has_changes=3Dtrue;return false}),k=3D$("<a href=3D''/>").addClass("icon-bu= tton delete").appendTo(q);m.make_text_editable({num_rows:3,use_textarea:tru= e,help_text:"Edit bookmark note"}).addClass("annotation")}view.has_changes= =3Dtrue;return r},create_visualization:function(o,j,n,p,m){var l=3Dthis,k= =3Dnew b.TracksterView(o);k.editor=3Dtrue;$.when(k.load_chroms_deferred).th= en(function(){if(j){var y=3Dj.chrom,q=3Dj.start,v=3Dj.end,s=3Dj.overview;if= (y&&(q!=3D=3Dundefined)&&v){k.change_chrom(y,q,v)}}if(n){var t,r,u;for(var = w=3D0;w<n.length;w++){k.add_drawable(a(n[w],k,k))}}k.update_intro_div();var= z;for(var w=3D0;w<k.drawables.length;w++){if(k.drawables[w].name=3D=3D=3Ds= ){k.set_overview(k.drawables[w]);break}}if(p){var x;for(var w=3D0;w<p.lengt= h;w++){x=3Dp[w];l.add_bookmark(x.position,x.annotation,m)}}k.has_changes=3D= false});return k},init_keyboard_nav:function(j){$(document).keydown(functio= n(k){if($(k.srcElement).is(":input")){return}switch(k.which){case 37:j.move= _fraction(0.25);break;case 38:var l=3DMath.round(j.viewport_container.heigh= t()/15);j.viewport_container.scrollTop(j.viewport_container.scrollTop()-20)= ;break;case 39:j.move_fraction(-0.25);break;case 40:var l=3DMath.round(j.vi= ewport_container.height()/15);j.viewport_container.scrollTop(j.viewport_con= tainer.scrollTop()+20);break}})}});return{object_from_template:a,TracksterU= I:f}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/packed/viz/visualization.js --- a/static/scripts/packed/viz/visualization.js +++ b/static/scripts/packed/viz/visualization.js @@ -1,1 +1,1 @@ -define(["libs/underscore","mvc/data","viz/trackster/util","utils/config"],= function(s,i,l,p){var a=3Dfunction(u,x,v,w){$.ajax({url:u,data:(v?{"f-dbkey= ":v}:{}),error:function(){alert("Grid failed")},success:function(y){show_mo= dal("Select datasets for new tracks",y,{Cancel:function(){hide_modal()},Add= :function(){var z=3D[];$("input[name=3Did]:checked,input[name=3Dldda_ids]:c= hecked").each(function(){var A=3D{data_type:"track_config",hda_ldda:"hda"},= B=3D$(this).val();if($(this).attr("name")!=3D=3D"id"){A.hda_ldda=3D"ldda"}z= [z.length]=3D$.ajax({url:x+"/"+B,data:A,dataType:"json"})});$.when.apply($,= z).then(function(){var A=3D(arguments[0] instanceof Array?$.map(arguments,f= unction(B){return B[0]}):[arguments[0]]);w(A)});hide_modal()}})}})};var j= =3Dfunction(u){return("isResolved" in u)};var f=3Dfunction(u){this.default_= font=3Du!=3D=3Dundefined?u:"9px Monaco, Lucida Console, monospace";this.dum= my_canvas=3Dthis.new_canvas();this.dummy_context=3Dthis.dummy_canvas.getCon= text("2d");this.dummy_context.font=3Dthis.default_font;this.char_width_px= =3Dthis.dummy_context.measureText("A").width;this.patterns=3D{};this.load_p= attern("right_strand","/visualization/strand_right.png");this.load_pattern(= "left_strand","/visualization/strand_left.png");this.load_pattern("right_st= rand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_st= rand_inv","/visualization/strand_left_inv.png")};s.extend(f.prototype,{load= _pattern:function(u,y){var v=3Dthis.patterns,w=3Dthis.dummy_context,x=3Dnew= Image();x.src=3Dgalaxy_paths.attributes.image_path+y;x.onload=3Dfunction()= {v[u]=3Dw.createPattern(x,"repeat")}},get_pattern:function(u){return this.p= atterns[u]},new_canvas:function(){var u=3D$("<canvas/>")[0];if(window.G_vml= CanvasManager){G_vmlCanvasManager.initElement(u)}u.manager=3Dthis;return u}= });var q=3DBackbone.Model.extend({defaults:{num_elements:20,obj_cache:null,= key_ary:null},initialize:function(u){this.clear()},get_elt:function(v){var = w=3Dthis.attributes.obj_cache,x=3Dthis.attributes.key_ary,u=3Dx.indexOf(v);= if(u!=3D=3D-1){if(w[v].stale){x.splice(u,1);delete w[v]}else{this.move_key_= to_end(v,u)}}return w[v]},set_elt:function(v,x){var y=3Dthis.attributes.obj= _cache,z=3Dthis.attributes.key_ary,w=3Dthis.attributes.num_elements;if(!y[v= ]){if(z.length>=3Dw){var u=3Dz.shift();delete y[u]}z.push(v)}y[v]=3Dx;retur= n x},move_key_to_end:function(v,u){this.attributes.key_ary.splice(u,1);this= .attributes.key_ary.push(v)},clear:function(){this.attributes.obj_cache=3D{= };this.attributes.key_ary=3D[]},size:function(){return this.attributes.key_= ary.length}});var d=3Dq.extend({defaults:s.extend({},q.prototype.defaults,{= dataset:null,init_data:null,filters_manager:null,data_type:"data",data_mode= _compatible:function(u,v){return true},can_subset:function(u){return false}= }),initialize:function(u){q.prototype.initialize.call(this);var v=3Dthis.ge= t("init_data");if(v){this.add_data(v)}},add_data:function(u){if(this.get("n= um_elements")<u.length){this.set("num_elements",u.length)}var v=3Dthis;s.ea= ch(u,function(w){v.set_data(w.region,w)})},data_is_ready:function(){var x= =3Dthis.get("dataset"),w=3D$.Deferred(),u=3D(this.get("data_type")=3D=3D"ra= w_data"?"state":this.get("data_type")=3D=3D"data"?"converted_datasets_state= ":"error"),v=3Dnew l.ServerStateDeferred({ajax_settings:{url:this.get("data= set").url(),data:{hda_ldda:x.get("hda_ldda"),data_type:u},dataType:"json"},= interval:5000,success_fn:function(y){return y!=3D=3D"pending"}});$.when(v.g= o()).then(function(y){w.resolve(y=3D=3D=3D"ok"||y=3D=3D=3D"data")});return = w},search_features:function(u){var v=3Dthis.get("dataset"),w=3D{query:u,hda= _ldda:v.get("hda_ldda"),data_type:"features"};return $.getJSON(v.url(),w)},= load_data:function(C,B,v,A){var y=3Dthis.get("dataset"),x=3D{data_type:this= .get("data_type"),chrom:C.get("chrom"),low:C.get("start"),high:C.get("end")= ,mode:B,resolution:v,hda_ldda:y.get("hda_ldda")};$.extend(x,A);var E=3Dthis= .get("filters_manager");if(E){var F=3D[];var u=3DE.filters;for(var z=3D0;z<= u.length;z++){F.push(u[z].name)}x.filter_cols=3DJSON.stringify(F)}var w=3Dt= his,D=3D$.getJSON(y.url(),x,function(G){w.set_data(C,G)});this.set_data(C,D= );return D},get_data:function(A,z,w,y){var B=3Dthis.get_elt(A);if(B&&(j(B)|= |this.get("data_mode_compatible")(B,z))){return B}var C=3Dthis.get("key_ary= "),v=3Dthis.get("obj_cache"),D,u;for(var x=3D0;x<C.length;x++){D=3DC[x];u= =3Dnew g({from_str:D});if(u.contains(A)){B=3Dv[D];if(j(B)||(this.get("data_= mode_compatible")(B,z)&&this.get("can_subset")(B))){this.move_key_to_end(D,= x);return B}}}return this.load_data(A,z,w,y)},set_data:function(v,u){this.s= et_elt(v,u)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:fu= nction(C,B,x,A,y){var E=3Dthis._mark_stale(C);if(!(E&&this.get("data_mode_c= ompatible")(E,B))){console.log("ERROR: problem with getting more data: curr= ent data is not compatible");return}var w=3DC.get("start");if(y=3D=3D=3Dthi= s.DEEP_DATA_REQ){$.extend(A,{start_val:E.data.length+1})}else{if(y=3D=3D=3D= this.BROAD_DATA_REQ){w=3D(E.max_high?E.max_high:E.data[E.data.length-1][2])= +1}}var D=3DC.copy().set("start",w);var v=3Dthis,z=3Dthis.load_data(D,B,x,A= ),u=3D$.Deferred();this.set_data(C,u);$.when(z).then(function(F){if(F.data)= {F.data=3DE.data.concat(F.data);if(F.max_low){F.max_low=3DE.max_low}if(F.me= ssage){F.message=3DF.message.replace(/[0-9]+/,F.data.length)}}v.set_data(C,= F);u.resolve(F)});return u},can_get_more_detailed_data:function(v){var u=3D= this.get_elt(v);return(u.dataset_type=3D=3D=3D"bigwig"&&u.data.length<8000)= },get_more_detailed_data:function(x,z,v,y,w){var u=3Dthis._mark_stale(x);if= (!u){console.log("ERROR getting more detailed data: no current data");retur= n}if(!w){w=3D{}}if(u.dataset_type=3D=3D=3D"bigwig"){w.num_samples=3D1000*y}= else{if(u.dataset_type=3D=3D=3D"summary_tree"){w.level=3DMath.min(u.level-1= ,2)}}return this.load_data(x,z,v,w)},_mark_stale:function(v){var u=3Dthis.g= et_elt(v);if(!u){console.log("ERROR: no data to mark as stale: ",this.get("= dataset"),v.toString())}u.stale=3Dtrue;return u},get_genome_wide_data:funct= ion(u){var w=3Dthis,y=3Dtrue,x=3Ds.map(u.get("chroms_info").chrom_info,func= tion(A){var z=3Dw.get_elt(new g({chrom:A.chrom,start:0,end:A.len}));if(!z){= y=3Dfalse}return z});if(y){return x}var v=3D$.Deferred();$.getJSON(this.get= ("dataset").url(),{data_type:"genome_data"},function(z){w.add_data(z.data);= v.resolve(z.data)});return v},get_elt:function(u){return q.prototype.get_el= t.call(this,u.toString())},set_elt:function(v,u){return q.prototype.set_elt= .call(this,v.toString(),u)}});var n=3Dd.extend({initialize:function(u){var = v=3Dnew Backbone.Model();v.urlRoot=3Du.data_url;this.set("dataset",v)},load= _data:function(w,x,u,v){if(u>1){return{data:null}}return d.prototype.load_d= ata.call(this,w,x,u,v)}});var c=3DBackbone.Model.extend({defaults:{name:nul= l,key:null,chroms_info:null},initialize:function(u){this.id=3Du.dbkey},get_= chroms_info:function(){return this.attributes.chroms_info.chrom_info},get_c= hrom_region:function(u){var v=3Ds.find(this.get_chroms_info(),function(w){r= eturn w.chrom=3D=3Du});return new g({chrom:v.chrom,end:v.len})}});var g=3DB= ackbone.RelationalModel.extend({defaults:{chrom:null,start:0,end:0,DIF_CHRO= MS:1000,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTA= INED_BY:1005,AFTER:1006},initialize:function(v){if(v.from_str){var x=3Dv.fr= om_str.split(":"),w=3Dx[0],u=3Dx[1].split("-");this.set({chrom:w,start:pars= eInt(u[0],10),end:parseInt(u[1],10)})}},copy:function(){return new g({chrom= :this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:fu= nction(){return this.get("end")-this.get("start")},toString:function(){retu= rn this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},toJSON:func= tion(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get(= "end")}},compute_overlap:function(B){var v=3Dthis.get("chrom"),A=3DB.get("c= hrom"),z=3Dthis.get("start"),x=3DB.get("start"),y=3Dthis.get("end"),w=3DB.g= et("end"),u;if(v&&A&&v!=3D=3DA){return this.get("DIF_CHROMS")}if(z<x){if(y<= x){u=3Dthis.get("BEFORE")}else{if(y<=3Dw){u=3Dthis.get("OVERLAP_START")}els= e{u=3Dthis.get("CONTAINS")}}}else{if(z>w){u=3Dthis.get("AFTER")}else{if(y<= =3Dw){u=3Dthis.get("CONTAINED_BY")}else{u=3Dthis.get("OVERLAP_END")}}}retur= n u},contains:function(u){return this.compute_overlap(u)=3D=3D=3Dthis.get("= CONTAINS")},overlaps:function(u){return s.intersection([this.compute_overla= p(u)],[this.get("DIF_CHROMS"),this.get("BEFORE"),this.get("AFTER")]).length= =3D=3D=3D0}});var m=3DBackbone.Collection.extend({model:g});var e=3DBackbon= e.RelationalModel.extend({defaults:{region:null,note:""},relations:[{type:B= ackbone.HasOne,key:"region",relatedModel:g}]});var r=3DBackbone.Collection.= extend({model:e});var t=3Di.Dataset.extend({initialize:function(u){this.set= ("id",u.dataset_id);this.set("config",p.ConfigSettingCollection.from_config= _dict(u.prefs));this.get("config").add([{key:"name",value:this.get("name")}= ,{key:"color"}]);var v=3Dthis.get("preloaded_data");if(v){v=3Dv.data}else{v= =3D[]}this.set("data_manager",new d({dataset:this,init_data:v}))}});var o= =3DBackbone.RelationalModel.extend({defaults:{title:"",type:""},url:galaxy_= paths.get("visualization_url"),save:function(){return $.ajax({url:this.url(= ),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var= k=3Do.extend({defaults:s.extend({},o.prototype.defaults,{dbkey:"",tracks:n= ull,bookmarks:null,viewport:null}),relations:[{type:Backbone.HasMany,key:"t= racks",relatedModel:t}],add_tracks:function(u){this.get("tracks").add(u)}})= ;var b=3DBackbone.Model.extend({});var h=3DBackbone.Router.extend({initiali= ze:function(v){this.view=3Dv.view;this.route(/([\w]+)$/,"change_location");= this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var u=3Dthis;u.view= .on("navigate",function(w){u.navigate(w)})},change_location:function(u){thi= s.view.go_to(u)}});return{BackboneTrack:t,BrowserBookmark:e,BrowserBookmark= Collection:r,Cache:q,CanvasManager:f,Genome:c,GenomeDataManager:d,GenomeReg= ion:g,GenomeRegionCollection:m,GenomeVisualization:k,ReferenceTrackDataMana= ger:n,TrackBrowserRouter:h,TrackConfig:b,Visualization:o,select_datasets:a}= }); \ No newline at end of file +define(["libs/underscore","mvc/data","viz/trackster/util","utils/config"],= function(s,i,l,p){var a=3Dfunction(u,x,w,v){$.ajax({url:u,data:w,error:func= tion(){alert("Grid failed")},success:function(y){show_modal("Select dataset= s for new tracks",y,{Cancel:function(){hide_modal()},Add:function(){var z= =3D[];$("input[name=3Did]:checked,input[name=3Dldda_ids]:checked").each(fun= ction(){var A=3D{data_type:"track_config",hda_ldda:"hda"},B=3D$(this).val()= ;if($(this).attr("name")!=3D=3D"id"){A.hda_ldda=3D"ldda"}z[z.length]=3D$.aj= ax({url:x+"/"+B,data:A,dataType:"json"})});$.when.apply($,z).then(function(= ){var A=3D(arguments[0] instanceof Array?$.map(arguments,function(B){return= B[0]}):[arguments[0]]);v(A)});hide_modal()}})}})};var j=3Dfunction(u){retu= rn("isResolved" in u)};var f=3Dfunction(u){this.default_font=3Du!=3D=3Dunde= fined?u:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=3Dthis.ne= w_canvas();this.dummy_context=3Dthis.dummy_canvas.getContext("2d");this.dum= my_context.font=3Dthis.default_font;this.char_width_px=3Dthis.dummy_context= .measureText("A").width;this.patterns=3D{};this.load_pattern("right_strand"= ,"/visualization/strand_right.png");this.load_pattern("left_strand","/visua= lization/strand_left.png");this.load_pattern("right_strand_inv","/visualiza= tion/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualiza= tion/strand_left_inv.png")};s.extend(f.prototype,{load_pattern:function(u,y= ){var v=3Dthis.patterns,w=3Dthis.dummy_context,x=3Dnew Image();x.src=3Dgala= xy_paths.attributes.image_path+y;x.onload=3Dfunction(){v[u]=3Dw.createPatte= rn(x,"repeat")}},get_pattern:function(u){return this.patterns[u]},new_canva= s:function(){var u=3D$("<canvas/>")[0];if(window.G_vmlCanvasManager){G_vmlC= anvasManager.initElement(u)}u.manager=3Dthis;return u}});var q=3DBackbone.M= odel.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initial= ize:function(u){this.clear()},get_elt:function(v){var w=3Dthis.attributes.o= bj_cache,x=3Dthis.attributes.key_ary,u=3Dx.indexOf(v);if(u!=3D=3D-1){if(w[v= ].stale){x.splice(u,1);delete w[v]}else{this.move_key_to_end(v,u)}}return w= [v]},set_elt:function(v,x){var y=3Dthis.attributes.obj_cache,z=3Dthis.attri= butes.key_ary,w=3Dthis.attributes.num_elements;if(!y[v]){if(z.length>=3Dw){= var u=3Dz.shift();delete y[u]}z.push(v)}y[v]=3Dx;return x},move_key_to_end:= function(v,u){this.attributes.key_ary.splice(u,1);this.attributes.key_ary.p= ush(v)},clear:function(){this.attributes.obj_cache=3D{};this.attributes.key= _ary=3D[]},size:function(){return this.attributes.key_ary.length}});var d= =3Dq.extend({defaults:s.extend({},q.prototype.defaults,{dataset:null,init_d= ata:null,filters_manager:null,data_type:"data",data_mode_compatible:functio= n(u,v){return true},can_subset:function(u){return false}}),initialize:funct= ion(u){q.prototype.initialize.call(this);var v=3Dthis.get("init_data");if(v= ){this.add_data(v)}},add_data:function(u){if(this.get("num_elements")<u.len= gth){this.set("num_elements",u.length)}var v=3Dthis;s.each(u,function(w){v.= set_data(w.region,w)})},data_is_ready:function(){var x=3Dthis.get("dataset"= ),w=3D$.Deferred(),u=3D(this.get("data_type")=3D=3D"raw_data"?"state":this.= get("data_type")=3D=3D"data"?"converted_datasets_state":"error"),v=3Dnew l.= ServerStateDeferred({ajax_settings:{url:this.get("dataset").url(),data:{hda= _ldda:x.get("hda_ldda"),data_type:u},dataType:"json"},interval:5000,success= _fn:function(y){return y!=3D=3D"pending"}});$.when(v.go()).then(function(y)= {w.resolve(y=3D=3D=3D"ok"||y=3D=3D=3D"data")});return w},search_features:fu= nction(u){var v=3Dthis.get("dataset"),w=3D{query:u,hda_ldda:v.get("hda_ldda= "),data_type:"features"};return $.getJSON(v.url(),w)},load_data:function(C,= B,v,A){var y=3Dthis.get("dataset"),x=3D{data_type:this.get("data_type"),chr= om:C.get("chrom"),low:C.get("start"),high:C.get("end"),mode:B,resolution:v,= hda_ldda:y.get("hda_ldda")};$.extend(x,A);var E=3Dthis.get("filters_manager= ");if(E){var F=3D[];var u=3DE.filters;for(var z=3D0;z<u.length;z++){F.push(= u[z].name)}x.filter_cols=3DJSON.stringify(F)}var w=3Dthis,D=3D$.getJSON(y.u= rl(),x,function(G){w.set_data(C,G)});this.set_data(C,D);return D},get_data:= function(A,z,w,y){var B=3Dthis.get_elt(A);if(B&&(j(B)||this.get("data_mode_= compatible")(B,z))){return B}var C=3Dthis.get("key_ary"),v=3Dthis.get("obj_= cache"),D,u;for(var x=3D0;x<C.length;x++){D=3DC[x];u=3Dnew g({from_str:D});= if(u.contains(A)){B=3Dv[D];if(j(B)||(this.get("data_mode_compatible")(B,z)&= &this.get("can_subset")(B))){this.move_key_to_end(D,x);return B}}}return th= is.load_data(A,z,w,y)},set_data:function(v,u){this.set_elt(v,u)},DEEP_DATA_= REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(C,B,x,A,y){var E= =3Dthis._mark_stale(C);if(!(E&&this.get("data_mode_compatible")(E,B))){cons= ole.log("ERROR: problem with getting more data: current data is not compati= ble");return}var w=3DC.get("start");if(y=3D=3D=3Dthis.DEEP_DATA_REQ){$.exte= nd(A,{start_val:E.data.length+1})}else{if(y=3D=3D=3Dthis.BROAD_DATA_REQ){w= =3D(E.max_high?E.max_high:E.data[E.data.length-1][2])+1}}var D=3DC.copy().s= et("start",w);var v=3Dthis,z=3Dthis.load_data(D,B,x,A),u=3D$.Deferred();thi= s.set_data(C,u);$.when(z).then(function(F){if(F.data){F.data=3DE.data.conca= t(F.data);if(F.max_low){F.max_low=3DE.max_low}if(F.message){F.message=3DF.m= essage.replace(/[0-9]+/,F.data.length)}}v.set_data(C,F);u.resolve(F)});retu= rn u},can_get_more_detailed_data:function(v){var u=3Dthis.get_elt(v);return= (u.dataset_type=3D=3D=3D"bigwig"&&u.data.length<8000)},get_more_detailed_da= ta:function(x,z,v,y,w){var u=3Dthis._mark_stale(x);if(!u){console.log("ERRO= R getting more detailed data: no current data");return}if(!w){w=3D{}}if(u.d= ataset_type=3D=3D=3D"bigwig"){w.num_samples=3D1000*y}else{if(u.dataset_type= =3D=3D=3D"summary_tree"){w.level=3DMath.min(u.level-1,2)}}return this.load_= data(x,z,v,w)},_mark_stale:function(v){var u=3Dthis.get_elt(v);if(!u){conso= le.log("ERROR: no data to mark as stale: ",this.get("dataset"),v.toString()= )}u.stale=3Dtrue;return u},get_genome_wide_data:function(u){var w=3Dthis,y= =3Dtrue,x=3Ds.map(u.get("chroms_info").chrom_info,function(A){var z=3Dw.get= _elt(new g({chrom:A.chrom,start:0,end:A.len}));if(!z){y=3Dfalse}return z});= if(y){return x}var v=3D$.Deferred();$.getJSON(this.get("dataset").url(),{da= ta_type:"genome_data"},function(z){w.add_data(z.data);v.resolve(z.data)});r= eturn v},get_elt:function(u){return q.prototype.get_elt.call(this,u.toStrin= g())},set_elt:function(v,u){return q.prototype.set_elt.call(this,v.toString= (),u)}});var n=3Dd.extend({initialize:function(u){var v=3Dnew Backbone.Mode= l();v.urlRoot=3Du.data_url;this.set("dataset",v)},load_data:function(w,x,u,= v){if(u>1){return{data:null}}return d.prototype.load_data.call(this,w,x,u,v= )}});var c=3DBackbone.Model.extend({defaults:{name:null,key:null,chroms_inf= o:null},initialize:function(u){this.id=3Du.dbkey},get_chroms_info:function(= ){return this.attributes.chroms_info.chrom_info},get_chrom_region:function(= u){var v=3Ds.find(this.get_chroms_info(),function(w){return w.chrom=3D=3Du}= );return new g({chrom:v.chrom,end:v.len})}});var g=3DBackbone.RelationalMod= el.extend({defaults:{chrom:null,start:0,end:0},initialize:function(v){if(v.= from_str){var x=3Dv.from_str.split(":"),w=3Dx[0],u=3Dx[1].split("-");this.s= et({chrom:w,start:parseInt(u[0],10),end:parseInt(u[1],10)})}},copy:function= (){return new g({chrom:this.get("chrom"),start:this.get("start"),end:this.g= et("end")})},length:function(){return this.get("end")-this.get("start")},to= String:function(){return this.get("chrom")+":"+this.get("start")+"-"+this.g= et("end")},toJSON:function(){return{chrom:this.get("chrom"),start:this.get(= "start"),end:this.get("end")}},compute_overlap:function(B){var v=3Dthis.get= ("chrom"),A=3DB.get("chrom"),z=3Dthis.get("start"),x=3DB.get("start"),y=3Dt= his.get("end"),w=3DB.get("end"),u;if(v&&A&&v!=3D=3DA){return g.overlap_resu= lts.DIF_CHROMS}if(z<x){if(y<x){u=3Dg.overlap_results.BEFORE}else{if(y<=3Dw)= {u=3Dg.overlap_results.OVERLAP_START}else{u=3Dg.overlap_results.CONTAINS}}}= else{if(z>w){u=3Dg.overlap_results.AFTER}else{if(y<=3Dw){u=3Dg.overlap_resu= lts.CONTAINED_BY}else{u=3Dg.overlap_results.OVERLAP_END}}}return u},contain= s:function(u){return this.compute_overlap(u)=3D=3D=3Dg.overlap_results.CONT= AINS},overlaps:function(u){return s.intersection([this.compute_overlap(u)],= [g.overlap_results.DIF_CHROMS,g.overlap_results.BEFORE,g.overlap_results.AF= TER]).length=3D=3D=3D0}},{overlap_results:{DIF_CHROMS:1000,BEFORE:1001,CONT= AINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006}= });var m=3DBackbone.Collection.extend({model:g});var e=3DBackbone.Relationa= lModel.extend({defaults:{region:null,note:""},relations:[{type:Backbone.Has= One,key:"region",relatedModel:g}]});var r=3DBackbone.Collection.extend({mod= el:e});var t=3Di.Dataset.extend({initialize:function(u){this.set("id",u.dat= aset_id);this.set("config",p.ConfigSettingCollection.from_config_dict(u.pre= fs));this.get("config").add([{key:"name",value:this.get("name")},{key:"colo= r"}]);var v=3Dthis.get("preloaded_data");if(v){v=3Dv.data}else{v=3D[]}this.= set("data_manager",new d({dataset:this,init_data:v}))}});var o=3DBackbone.R= elationalModel.extend({defaults:{title:"",type:""},url:galaxy_paths.get("vi= sualization_url"),save:function(){return $.ajax({url:this.url(),type:"POST"= ,dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var k=3Do.extend= ({defaults:s.extend({},o.prototype.defaults,{dbkey:"",tracks:null,bookmarks= :null,viewport:null}),relations:[{type:Backbone.HasMany,key:"tracks",relate= dModel:t}],add_tracks:function(u){this.get("tracks").add(u)}});var b=3DBack= bone.Model.extend({});var h=3DBackbone.Router.extend({initialize:function(v= ){this.view=3Dv.view;this.route(/([\w]+)$/,"change_location");this.route(/(= [\w]+\:[\d,]+-[\d,]+)$/,"change_location");var u=3Dthis;u.view.on("navigate= ",function(w){u.navigate(w)})},change_location:function(u){this.view.go_to(= u)}});return{BackboneTrack:t,BrowserBookmark:e,BrowserBookmarkCollection:r,= Cache:q,CanvasManager:f,Genome:c,GenomeDataManager:d,GenomeRegion:g,GenomeR= egionCollection:m,GenomeVisualization:k,ReferenceTrackDataManager:n,TrackBr= owserRouter:h,TrackConfig:b,Visualization:o,select_datasets:a}}); \ No newline at end of file diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 static/scripts/viz/scatterplot.js --- a/static/scripts/viz/scatterplot.js +++ b/static/scripts/viz/scatterplot.js @@ -10,7 +10,7 @@ "../libs/d3", =20 "../libs/bootstrap", - "../libs/jquery/jquery-ui-1.8.23.custom.min" + "../libs/jquery/jquery-ui" ], function(){ =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/admin/requests/select_datasets_to_transfer.mako --- a/templates/admin/requests/select_datasets_to_transfer.mako +++ b/templates/admin/requests/select_datasets_to_transfer.mako @@ -8,7 +8,7 @@ ${common_javascripts()} </%def> =20 -${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.coo= kie", "libs/jquery/jquery.dynatree" )} +${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.cookie", "libs/jquery= /jquery.dynatree" )} ${h.css( "dynatree_skin/ui.dynatree" )} =20 <script type=3D"text/javascript"> diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/admin/tool_shed_repository/browse_repository.ma= ko --- a/templates/admin/tool_shed_repository/browse_repository.mako +++ b/templates/admin/tool_shed_repository/browse_repository.mako @@ -9,7 +9,7 @@ =20 <%def name=3D"javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery= .dynatree" )} + ${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.dynatree" )} ${browse_files(repository.name, repository.repo_files_directory(trans.= app))} </%def> =20 diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/admin/tool_shed_repository/browse_tool_dependen= cy.mako --- a/templates/admin/tool_shed_repository/browse_tool_dependency.mako +++ b/templates/admin/tool_shed_repository/browse_tool_dependency.mako @@ -9,7 +9,7 @@ =20 <%def name=3D"javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery= .dynatree" )} + ${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.dynatree" )} ${browse_files(tool_dependency.name, tool_dependency.installation_dire= ctory( trans.app ))} </%def> =20 diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -23,8 +23,6 @@ <![endif]--> =20 ${render_trackster_js_files()} -${h.js( "libs/jquery/jquery.autocomplete" )} - =20 <script type=3D"text/javascript"> =20 @@ -107,7 +105,12 @@ "Create": function() { $(document).trigger("conver= t_to_values"); continue_fn(); } }); $("#new-title").focus(); - replace_big_select_inputs(); + $("select[name=3D'dbkey']").combobox({ + appendTo: $("#overlay"), + size: 40 + }); + // To support the large number of options for dbkey, e= nable scrolling in overlay. + $("#overlay").css("overflow", "auto"); } }); %endif diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/visualization/scatterplot.mako --- a/templates/visualization/scatterplot.mako +++ b/templates/visualization/scatterplot.mako @@ -5,7 +5,7 @@ ${h.css( "base", "autocomplete_tagging", - "jquery-ui/smoothness/jquery-ui-1.8.23.custom" + "jquery-ui/smoothness/jquery-ui" )} =20 <style type=3D"text/css"> diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/visualization/sweepster.mako --- a/templates/visualization/sweepster.mako +++ b/templates/visualization/sweepster.mako @@ -107,7 +107,7 @@ ${parent.javascripts()} =20 ${h.templates( "tool_link", "panel_section", "tool_search", "tool_form= " )} - ${h.js( "libs/require", "libs/jquery/jquery-ui-1.8.23.custom.min" )} + ${h.js( "libs/require", "libs/jquery/jquery-ui" )} =20 <script type=3D"text/javascript"> require.config({=20 diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/visualization/trackster_common.mako --- a/templates/visualization/trackster_common.mako +++ b/templates/visualization/trackster_common.mako @@ -5,13 +5,14 @@ ## Render needed CSS files. <%def name=3D"render_trackster_css_files()"> ${h.css( "history", "autocomplete_tagging", "trackster", "library",=20 - "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )} + "jquery-ui/smoothness/jquery-ui" )} </%def> =20 =20 ## Render needed JavaScript files. <%def name=3D"render_trackster_js_files()"> - ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.e= vent.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel= ", "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/require", "libs/farbtas= tic" )} + ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.e= vent.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel= ", "libs/jquery/jquery-ui", "libs/jquery/jquery-ui-combobox", + "libs/require", "libs/farbtastic" )} </%def> =20 ## Render a block of JavaScript that contains all necessary variables for = Trackster. diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/webapps/community/repository/browse_repository.= mako --- a/templates/webapps/community/repository/browse_repository.mako +++ b/templates/webapps/community/repository/browse_repository.mako @@ -58,7 +58,7 @@ =20 <%def name=3D"javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.rating", "libs/jquery/jquery-ui-1.8.23.cus= tom.min", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery.rating", "libs/jquery/jquery-ui", "libs/jq= uery/jquery.cookie", "libs/jquery/jquery.dynatree" )} ${common_javascripts(repository)} </%def> =20 diff -r fa045aad74e90f16995e0cbb670a59e6b9becbed -r 394c3bd89926919b3ff861d= 5bc3daa6c7d10fd12 templates/webapps/community/repository/upload.mako --- a/templates/webapps/community/repository/upload.mako +++ b/templates/webapps/community/repository/upload.mako @@ -28,7 +28,7 @@ =20 <%def name=3D"javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery= .cookie", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.cookie", "libs/jq= uery/jquery.dynatree" )} ${common_javascripts(repository)} <script type=3D"text/javascript"> $( function() { Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket