commit/galaxy-central: jgoecks: jQuery UI enhancements: (a) update to v1.8.23; (b) remove core script and replace with script that includes core, autocomplete, sliders, and dependencies; (c) replace overcast theme with smoothness theme; and (d) add directory for jQuery UI styles.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/9287f22c6920/ changeset: 9287f22c6920 user: jgoecks date: 2012-09-05 15:35:21 summary: jQuery UI enhancements: (a) update to v1.8.23; (b) remove core script and replace with script that includes core, autocomplete, sliders, and dependencies; (c) replace overcast theme with smoothness theme; and (d) add directory for jQuery UI styles. affected #: 33 files diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_222222_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_222222_256x240.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_454545_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_454545_256x240.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_888888_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_888888_256x240.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png Binary file static/june_2007_style/blue/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/jquery-ui/smoothness/jquery-ui-1.8.23.custom.css --- /dev/null +++ b/static/june_2007_style/blue/jquery-ui/smoothness/jquery-ui-1.8.23.custom.css @@ -0,0 +1,363 @@ +/*! + * 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(1px 1px 1px 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-clearfix: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=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 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/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* 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 button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/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(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; 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(images/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-widget-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-decoration: 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; color: #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-header .ui-state-highlight {border: 1px solid #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-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-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_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_256x240.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_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); } + +/* 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-border-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-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-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; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -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; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 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.2em; 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; margin-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 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png Binary file static/june_2007_style/blue/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/images/ui-bg_glass_35_dddddd_1x400.png Binary file static/june_2007_style/blue/overcast/images/ui-bg_glass_35_dddddd_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/images/ui-bg_glass_60_eeeeee_1x400.png Binary file static/june_2007_style/blue/overcast/images/ui-bg_glass_60_eeeeee_1x400.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/images/ui-bg_inset-hard_75_999999_1x100.png Binary file static/june_2007_style/blue/overcast/images/ui-bg_inset-hard_75_999999_1x100.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png Binary file static/june_2007_style/blue/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png has changed diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/june_2007_style/blue/overcast/jquery-ui-1.8.5.custom.css --- a/static/june_2007_style/blue/overcast/jquery-ui-1.8.5.custom.css +++ /dev/null @@ -1,318 +0,0 @@ -/* - * jQuery UI CSS Framework @VERSION - * - * 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/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.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:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* - * jQuery UI CSS Framework @VERSION - * - * 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/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Helvetica,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=dddddd&bgTextureHeader=02_glass.png&bgImgOpacityHeader=35&borderColorHeader=bbbbbb&fcHeader=444444&iconColorHeader=999999&bgColorContent=c9c9c9&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=50&borderColorContent=aaaaaa&fcContent=333333&iconColorContent=999999&bgColorDefault=eeeeee&bgTextureDefault=02_glass.png&bgImgOpacityDefault=60&borderColorDefault=cccccc&fcDefault=3383bb&iconColorDefault=70b2e1&bgColorHover=f8f8f8&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=bbbbbb&fcHover=599fcf&iconColorHover=3383bb&bgColorActive=999999&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=75&borderColorActive=999999&fcActive=ffffff&iconColorActive=454545&bgColorHighlight=eeeeee&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=ffffff&fcHighlight=444444&iconColorHighlight=3383bb&bgColorError=c0402a&bgTextureError=01_flat.png&bgImgOpacityError=55&borderColorError=c0402a&fcError=ffffff&iconColorError=fbc856&bgColorOverlay=eeeeee&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0pxdow=0px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Helvetica, 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 button { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #bbbbbb; background: #dddddd url(images/ui-bg_glass_35_dddddd_1x400.png) 50% 50% repeat-x; color: #444444; font-weight: bold; } -.ui-widget-header a { color: #444444; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #3383bb; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3383bb; 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-widget-header .ui-state-focus { border: 1px solid #bbbbbb; background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #599fcf; } -.ui-state-hover a, .ui-state-hover a:hover { color: #599fcf; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #999999; background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #ffffff; background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x; color: #444444; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #c0402a; background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.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-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_999999_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_70b2e1_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbc856_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-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; } -.ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } -.ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } -.ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } -.ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } -.ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } -.ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; } - -/* Overlays */ -.ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } -.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0pxdow=0px; -webkit-border-radius: 0pxdow=0px; border-radius: 0pxdow=0px; }/* - * jQuery UI Slider @VERSION - * - * 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/Slider#theming - */ -.ui-slider { position: 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-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; margin-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 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/libs/jquery/jquery-ui-1.8.23.custom.min.js --- /dev/null +++ b/static/scripts/libs/jquery/jquery-ui-1.8.23.custom.min.js @@ -0,0 +1,25 @@ +/*! 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=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND: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=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|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,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.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,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){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=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;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!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,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=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;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]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(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=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture: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=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={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={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?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(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>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=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("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=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.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.beforeunloadHandler=function(){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.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return 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(":visible")){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.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.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())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},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.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":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=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! 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(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(b.options.disabled)return;switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN: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=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{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("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._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.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.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-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a),a},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b),b;c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.23"})})(jQuery);; \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/libs/jquery/jquery.ui.core.js --- a/static/scripts/libs/jquery/jquery.ui.core.js +++ /dev/null @@ -1,519 +0,0 @@ -/* - * jQuery UI 1.7.1 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -;jQuery.ui || (function($) { - -var _remove = $.fn.remove, - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); - -//Helper functions and ui object -$.ui = { - version: "1.7.1", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set || !instance.element[0].parentNode) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - - contains: function(a, b) { - return document.compareDocumentPosition - ? a.compareDocumentPosition(b) & 16 - : a !== b && a.contains(b); - }, - - hasScroll: function(el, a) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ($(el).css('overflow') == 'hidden') { return false; } - - var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', - has = false; - - if (el[scroll] > 0) { return true; } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[scroll] = 1; - has = (el[scroll] > 0); - el[scroll] = 0; - return has; - }, - - isOverAxis: function(x, reference, size) { - //Determines when x coordinate is over "b" element axis - return (x > reference) && (x < (reference + size)); - }, - - isOver: function(y, x, top, left, height, width) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); - }, - - keyCode: { - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - 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, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38 - } -}; - -// WAI-ARIA normalization -if (isFF2) { - var attr = $.attr, - removeAttr = $.fn.removeAttr, - ariaNS = "http://www.w3.org/2005/07/aaa", - ariaState = /^aria-/, - ariaRole = /^wairole:/; - - $.attr = function(elem, name, value) { - var set = value !== undefined; - - return (name == 'role' - ? (set - ? attr.call(this, elem, name, "wairole:" + value) - : (attr.apply(this, arguments) || "").replace(ariaRole, "")) - : (ariaState.test(name) - ? (set - ? elem.setAttributeNS(ariaNS, - name.replace(ariaState, "aaa:"), value) - : attr.call(this, elem, name.replace(ariaState, "aaa:"))) - : attr.apply(this, arguments))); - }; - - $.fn.removeAttr = function(name) { - return (ariaState.test(name) - ? this.each(function() { - this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); - }) : removeAttr.call(this, name)); - }; -} - -//jQuery plugins -$.fn.extend({ - remove: function() { - // Safari has a native remove event which actually removes DOM elements, - // so we have to use triggerHandler instead of trigger (#3037). - $("*", this).add(this).each(function() { - $(this).triggerHandler("remove"); - }); - return _remove.apply(this, arguments ); - }, - - enableSelection: function() { - return this - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); - }, - - disableSelection: function() { - return this - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); - }, - - scrollParent: function() { - var scrollParent; - if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - } -}); - - -//Additional selectors -$.extend($.expr[':'], { - data: function(elem, i, match) { - return !!$.data(elem, match[3]); - }, - - focusable: function(element) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr(element, 'tabindex'); - return (/input|select|textarea|button|object/.test(nodeName) - ? !element.disabled - : 'a' == nodeName || 'area' == nodeName - ? element.href || !isNaN(tabIndex) - : !isNaN(tabIndex)) - // the element and all of its ancestors must be visible - // the browser may report that the area is hidden - && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; - }, - - tabbable: function(element) { - var tabIndex = $.attr(element, 'tabindex'); - return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); - } -}); - - -// $.widget is a factory to create jQuery plugins -// taking some boilerplate code out of the plugin code -function getter(namespace, plugin, method, args) { - function getMethods(type) { - var methods = $[namespace][plugin][type] || []; - return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); - } - - var methods = getMethods('getter'); - if (args.length == 1 && typeof args[0] == 'string') { - methods = methods.concat(getMethods('getterSetter')); - } - return ($.inArray(method, methods) != -1); -} - -$.widget = function(name, prototype) { - var namespace = name.split(".")[0]; - name = name.split(".")[1]; - - // create plugin method - $.fn[name] = function(options) { - var isMethodCall = (typeof options == 'string'), - args = Array.prototype.slice.call(arguments, 1); - - // prevent calls to internal methods - if (isMethodCall && options.substring(0, 1) == '_') { - return this; - } - - // handle getter methods - if (isMethodCall && getter(namespace, name, options, args)) { - var instance = $.data(this[0], name); - return (instance ? instance[options].apply(instance, args) - : undefined); - } - - // handle initialization and non-getter methods - return this.each(function() { - var instance = $.data(this, name); - - // constructor - (!instance && !isMethodCall && - $.data(this, name, new $[namespace][name](this, options))._init()); - - // method call - (instance && isMethodCall && $.isFunction(instance[options]) && - instance[options].apply(instance, args)); - }); - }; - - // create widget constructor - $[namespace] = $[namespace] || {}; - $[namespace][name] = function(element, options) { - var self = this; - - this.namespace = namespace; - this.widgetName = name; - this.widgetEventPrefix = $[namespace][name].eventPrefix || name; - this.widgetBaseClass = namespace + '-' + name; - - this.options = $.extend({}, - $.widget.defaults, - $[namespace][name].defaults, - $.metadata && $.metadata.get(element)[name], - options); - - this.element = $(element) - .bind('setData.' + name, function(event, key, value) { - if (event.target == element) { - return self._setData(key, value); - } - }) - .bind('getData.' + name, function(event, key) { - if (event.target == element) { - return self._getData(key); - } - }) - .bind('remove', function() { - return self.destroy(); - }); - }; - - // add widget prototype - $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); - - // TODO: merge getter and getterSetter properties from widget prototype - // and plugin prototype - $[namespace][name].getterSetter = 'option'; -}; - -$.widget.prototype = { - _init: function() {}, - destroy: function() { - this.element.removeData(this.widgetName) - .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') - .removeAttr('aria-disabled'); - }, - - option: function(key, value) { - var options = key, - self = this; - - if (typeof key == "string") { - if (value === undefined) { - return this._getData(key); - } - options = {}; - options[key] = value; - } - - $.each(options, function(key, value) { - self._setData(key, value); - }); - }, - _getData: function(key) { - return this.options[key]; - }, - _setData: function(key, value) { - this.options[key] = value; - - if (key == 'disabled') { - this.element - [value ? 'addClass' : 'removeClass']( - this.widgetBaseClass + '-disabled' + ' ' + - this.namespace + '-state-disabled') - .attr("aria-disabled", value); - } - }, - - enable: function() { - this._setData('disabled', false); - }, - disable: function() { - this._setData('disabled', true); - }, - - _trigger: function(type, event, data) { - var callback = this.options[type], - eventName = (type == this.widgetEventPrefix - ? type : this.widgetEventPrefix + type); - - event = $.Event(event); - event.type = eventName; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if (event.originalEvent) { - for (var i = $.event.props.length, prop; i;) { - prop = $.event.props[--i]; - event[prop] = event.originalEvent[prop]; - } - } - - this.element.trigger(event, data); - - return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false - || event.isDefaultPrevented()); - } -}; - -$.widget.defaults = { - disabled: false -}; - - -/** Mouse Interaction Plugin **/ - -$.ui.mouse = { - _mouseInit: function() { - var self = this; - - this.element - .bind('mousedown.'+this.widgetName, function(event) { - return self._mouseDown(event); - }) - .bind('click.'+this.widgetName, function(event) { - if(self._preventClickEvent) { - self._preventClickEvent = false; - event.stopImmediatePropagation(); - return false; - } - }); - - // Prevent text selection in IE - if ($.browser.msie) { - this._mouseUnselectable = this.element.attr('unselectable'); - this.element.attr('unselectable', 'on'); - } - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.unbind('.'+this.widgetName); - - // Restore text selection in IE - ($.browser.msie - && this.element.attr('unselectable', this._mouseUnselectable)); - }, - - _mouseDown: function(event) { - // don't let more than one widget handle mouseStart - // TODO: figure out why we have to use originalEvent - event.originalEvent = event.originalEvent || {}; - if (event.originalEvent.mouseHandled) { return; } - - // we may have missed mouseup (out of window) - (this._mouseStarted && this._mouseUp(event)); - - this._mouseDownEvent = event; - - var self = this, - btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if (!this.mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - self.mouseDelayMet = true; - }, this.options.delay); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = (this._mouseStart(event) !== false); - if (!this._mouseStarted) { - event.preventDefault(); - return true; - } - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(event) { - return self._mouseMove(event); - }; - this._mouseUpDelegate = function(event) { - return self._mouseUp(event); - }; - $(document) - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - // preventDefault() is used to prevent the selection of text here - - // however, in Safari, this causes select boxes not to be selectable - // anymore, so this fix is needed - ($.browser.safari || event.preventDefault()); - - event.originalEvent.mouseHandled = true; - return true; - }, - - _mouseMove: function(event) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !event.button) { - return this._mouseUp(event); - } - - if (this._mouseStarted) { - this._mouseDrag(event); - return event.preventDefault(); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = - (this._mouseStart(this._mouseDownEvent, event) !== false); - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); - } - - return !this._mouseStarted; - }, - - _mouseUp: function(event) { - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - if (this._mouseStarted) { - this._mouseStarted = false; - this._preventClickEvent = (event.target == this._mouseDownEvent.target); - this._mouseStop(event); - } - - return false; - }, - - _mouseDistanceMet: function(event) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - event.pageX), - Math.abs(this._mouseDownEvent.pageY - event.pageY) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function(event) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function(event) {}, - _mouseDrag: function(event) {}, - _mouseStop: function(event) {}, - _mouseCapture: function(event) { return true; } -}; - -$.ui.mouse.defaults = { - cancel: null, - distance: 1, - delay: 0 -}; - -})(jQuery); diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/packed/libs/jquery/jquery-ui-1.8.23.custom.min.js --- /dev/null +++ b/static/scripts/packed/libs/jquery/jquery-ui-1.8.23.custom.min.js @@ -0,0 +1,30 @@ +/* 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=a.nodeName.toLowerCase();if("area"===k){var j=a.parentNode,i=j.name,d;return !a.href||!i||j.nodeName.toLowerCase()!=="map"?!1:(d=f("img[usemap=#"+i+"]")[0],!!d&&g(d))}return(/input|select|textarea|button|object/.test(k)?!a.disabled:"a"==k?a.href||l:l)&&g(a)}function g(a){return !f(a).parents().andSelf().filter(function(){return f.curCSS(this,"visibility")==="hidden"||f.expr.filters.hidden(this)}).length}f.ui=f.ui||{};if(f.ui.version){return}f.extend(f.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND: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}}),f.fn.extend({propAttr:f.fn.prop||f.fn.attr,_focus:f.fn.focus,focus:function(a,d){return typeof a=="number"?this.each(function(){var b=this;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=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(f.curCSS(this,"position",1))&&/(auto|scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this,"overflow-x",1))}).eq(0):a=this.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!==e){return this.css("zIndex",j)}if(this.length){var i=f(this[0]),b,a;while(i.length&&i[0]!==document){b=i.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){a=parseInt(i.css("zIndex"),10);if(!isNaN(a)&&a!==0){return a}}i=i.parent()}}return 0},disableSelection:function(){return this.bind((f.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(b){b.preventDefault()})},enableSelection:function(){return 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,function(){p-=parseFloat(f.curCSS(m,"padding"+this,!0))||0,o&&(p-=parseFloat(f.curCSS(m,"border"+this+"Width",!0))||0),n&&(p-=parseFloat(f.curCSS(m,"margin"+this,!0))||0)}),p}var j=k==="Width"?["Left","Right"]:["Top","Bottom"],i=k.toLowerCase(),b={innerWidth:f.fn.innerWidth,innerHeight:f.fn.innerHeight,outerWidth:f.fn.outerWidth,outerHeight:f.fn.outerHeight};f.fn["inner"+k]=function(d){return d===e?b["inner"+k].call(this):this.each(function(){f(this).css(i,a(this,d)+"px")})},f.fn["outer"+k]=function(d,m){return typeof d!="number"?b["outer"+k].call(this,d):this.each(function(){f(this).css(i,a(this,d,!0,m)+"px")})}}),f.extend(f.expr[":"],{data: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=f.attr(a,"tabindex"),c=isNaN(i);return(c||i>=0)&&h(a,!c)}}),f(function(){var a=document.body,d=a.appendChild(d=document.createElement("div"));d.offsetHeight,f.extend(d.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),f.support.minHeight=d.offsetHeight===100,f.support.selectstart="onselectstart" in d,a.removeChild(d).style.display="none"}),f.curCSS||(f.curCSS=f.css),f.extend(f.ui,{plugin:{add:function(a,l,k){var j=f.ui[a].prototype;for(var i in k){j.plugins[i]=j.plugins[i]||[],j.plugins[i].push([l,k[i]])}},call:function(j,i,m){var l=j.plugins[i];if(!l||!j.element[0].parentNode){return}for(var k=0;k<l.length;k++){j.options[l[k][0]]&&l[k][1].apply(j.element,m)}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(a,k){if(f(a).css("overflow")==="hidden"){return !1}var j=k&&k==="left"?"scrollLeft":"scrollTop",i=!1;return a[j]>0?!0:(a[j]=1,i=a[j]>0,a[j]=0,i)},isOverAxis:function(i,d,j){return i>d&&i<d+j},isOver:function(a,m,l,k,j,i){return f.ui.isOverAxis(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=f.cleanData;f.cleanData=function(a){for(var j=0,i;(i=a[j])!=null;j++){try{f(i).triggerHandler("remove")}catch(c){}}h(a)}}else{var g=f.fn.remove;f.fn.remove=function(a,d){return this.each(function(){return d||(!a||f.filter(a,[this]).length)&&f("*",this).add([this]).each(function(){try{f(this).triggerHandler("remove")}catch(c){}}),g.call(f(this),a,d)})}}f.widget=function(a,m,l){var k=a.split(".")[0],j;a=a.split(".")[1],j=k+"-"+a,l||(l=m,m=f.Widget),f.expr[":"][j]=function(b){return !!f.data(b,a)},f[k]=f[k]||{},f[k][a]=function(d,c){arguments.length&&this._createWidget(d,c)};var i=new m;i.options=f.extend(!0,{},i.options),f[k][a].prototype=f.extend(!0,i,{namespace:k,widgetName:a,widgetEventPrefix:f[k][a].prototype.widgetEventPrefix||a,widgetBaseClass:j},l),f.widget.bridge(a,f[k][a])},f.widget.bridge=function(b,a){f.fn[b]=function(j){var i=typeof j=="string",d=Array.prototype.slice.call(arguments,1),c=this;return j=!i&&d.length?f.extend.apply(null,[!0,j].concat(d)):j,i&&j.charAt(0)==="_"?c:(i?this.each(function(){var l=f.data(this,b),k=l&&f.isFunction(l[j])?l[j].apply(l,d):l;if(k!==l&&k!==e){return c=k,!1}}):this.each(function(){var k=f.data(this,b);k?k.option(j||{})._init():f.data(this,b,new a(j,this))}),c)}},f.Widget=function(d,c){arguments.length&&this._createWidget(d,c)},f.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(a,j){f.data(j,this.widgetName,this),this.element=f(j),this.options=f.extend(!0,{},this.options,this._getCreateOptions(),a);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){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().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(i,b){var a=i;if(arguments.length===0){return f.extend({},this.options)}if(typeof i=="string"){if(b===e){return this.options[i]}a={},a[i]=b}return this._setOptions(a),this},_setOptions:function(a){var d=this;return f.each(a,function(i,c){d._setOption(i,c)}),this},_setOption:function(d,c){return this.options[d]=c,d==="disabled"&&this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(a,m,l){var k,j,i=this.options[a];l=l||{},m=f.Event(m),m.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase(),m.target=this.element[0],j=m.originalEvent;if(j){for(k in j){k in m||(m[k]=j[k])}}return this.element.trigger(m,l),!(f.isFunction(i)&&i.call(this.element[0],m,l)===!1||m.isDefaultPrevented())}}})(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=!1;e(document).mouseup(function(b){f=!1}),e.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(!0===e.data(b.target,a.widgetName+".preventClickEvent")){return e.removeData(b.target,a.widgetName+".preventClickEvent"),b.stopImmediatePropagation(),!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(a){if(f){return}this._mouseStarted&&this._mouseUp(a),this._mouseDownEvent=a;var h=this,g=a.which==1,c=typeof this.options.cancel=="string"&&a.target.nodeName?e(a.target).closest(this.options.cancel).length:!1;if(!g||c||!this._mouseCapture(a)){return !0}this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){h.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==!1;if(!this._mouseStarted){return a.preventDefault(),!0}}return !0===e.data(a.target,this.widgetName+".preventClickEvent")&&e.removeData(a.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(b){return h._mouseMove(b)},this._mouseUpDelegate=function(b){return h._mouseUp(b)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),a.preventDefault(),f=!0,!0},_mouseMove:function(a){return !e.browser.msie||document.documentMode>=9||!!a.button?this._mouseStarted?(this._mouseDrag(a),a.preventDefault()):(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==!1,this._mouseStarted?this._mouseDrag(a):this._mouseUp(a)),!this._mouseStarted):this._mouseUp(a)},_mouseUp:function(a){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,a.target==this._mouseDownEvent.target&&e.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a)),!1},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(b){return this.mouseDelayMet},_mouseStart: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=j.ui||{};var p=/left|center|right/,o=/top|center|bottom/,n="center",m={},l=j.fn.position,k=j.fn.offset;j.fn.position=function(c){if(!c||!c.of){return l.apply(this,arguments)}c=j.extend({},c);var q=j(c.of),g=q[0],f=(c.collision||"flip").split(" "),e=c.offset?c.offset.split(" "):[0,0],d,a,r;return g.nodeType===9?(d=q.width(),a=q.height(),r={top:0,left:0}):g.setTimeout?(d=q.width(),a=q.height(),r={top:q.scrollTop(),left:q.scrollLeft()}):g.preventDefault?(c.at="left top",d=a=0,r={top:c.of.pageY,left:c.of.pageX}):(d=q.outerWidth(),a=q.outerHeight(),r=q.offset()),j.each(["my","at"],function(){var b=(c[this]||"").split(" ");b.length===1&&(b=p.test(b[0])?b.concat([n]):o.test(b[0])?[n].concat(b):[n,n]),b[0]=p.test(b[0])?b[0]:n,b[1]=o.test(b[1])?b[1]:n,c[this]=b}),f.length===1&&(f[1]=f[0]),e[0]=parseInt(e[0],10)||0,e.length===1&&(e[1]=e[0]),e[1]=parseInt(e[1],10)||0,c.at[0]==="right"?r.left+=d:c.at[0]===n&&(r.left+=d/2),c.at[1]==="bottom"?r.top+=a:c.at[1]===n&&(r.top+=a/2),r.left+=e[0],r.top+=e[1],this.each(function(){var z=j(this),y=z.outerWidth(),x=z.outerHeight(),w=parseInt(j.curCSS(this,"marginLeft",!0))||0,v=parseInt(j.curCSS(this,"marginTop",!0))||0,u=y+w+(parseInt(j.curCSS(this,"marginRight",!0))||0),t=x+v+(parseInt(j.curCSS(this,"marginBottom",!0))||0),s=j.extend({},r),b;c.my[0]==="right"?s.left-=y:c.my[0]===n&&(s.left-=y/2),c.my[1]==="bottom"?s.top-=x:c.my[1]===n&&(s.top-=x/2),m.fractions||(s.left=Math.round(s.left),s.top=Math.round(s.top)),b={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={fit:{left:function(a,h){var g=j(window),f=h.collisionPosition.left+h.collisionWidth-g.width()-g.scrollLeft();a.left=f>0?a.left-f:Math.max(a.left-h.collisionPosition.left,a.left)},top:function(a,h){var g=j(window),f=h.collisionPosition.top+h.collisionHeight-g.height()-g.scrollTop();a.top=f>0?a.top-f:Math.max(a.top-h.collisionPosition.top,a.top)}},flip:{left:function(a,u){if(u.at[0]===n){return}var t=j(window),s=u.collisionPosition.left+u.collisionWidth-t.width()-t.scrollLeft(),r=u.my[0]==="left"?-u.elemWidth:u.my[0]==="right"?u.elemWidth:0,q=u.at[0]==="left"?u.targetWidth:-u.targetWidth,e=-2*u.offset[0];a.left+=u.collisionPosition.left<0?r+q+e:s>0?r+q+e:0},top:function(a,u){if(u.at[1]===n){return}var t=j(window),s=u.collisionPosition.top+u.collisionHeight-t.height()-t.scrollTop(),r=u.my[1]==="top"?-u.elemHeight:u.my[1]==="bottom"?u.elemHeight:0,q=u.at[1]==="top"?u.targetHeight:-u.targetHeight,e=-2*u.offset[1];a.top+=u.collisionPosition.top<0?r+q+e:s>0?r+q+e:0}}},j.offset.setOffset||(j.offset.setOffset=function(a,v){/static/.test(j.curCSS(a,"position"))&&(a.style.position="relative");var u=j(a),t=u.offset(),s=parseInt(j.curCSS(a,"top",!0),10)||0,r=parseInt(j.curCSS(a,"left",!0),10)||0,q={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=function(a){var d=this[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=j.css),function(){var a=document.getElementsByTagName("body")[0],v=document.createElement("div"),u,t,s,r,q;u=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&j.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(var f in s){u.style[f]=s[f]}u.appendChild(v),t=a||document.documentElement,t.insertBefore(u,t.firstChild),v.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",r=j(v).offset(function(d,c){return c}).offset(),u.innerHTML="",t.removeChild(u),q=r.top+r.left+(a?2000:0),m.fractions=q>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=0;e.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,h=this.element[0].ownerDocument,g;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(i){if(a.options.disabled||a.element.propAttr("readOnly")){return}g=!1;var b=e.ui.keyCode;switch(i.keyCode){case b.PAGE_UP:a._move("previousPage",i);break;case b.PAGE_DOWN:a._move("nextPage",i);break;case b.UP:a._keyEvent("previous",i);break;case b.DOWN:a._keyEvent("next",i);break;case b.ENTER:case b.NUMPAD_ENTER:a.menu.active&&(g=!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;default:clearTimeout(a.searching),a.searching=setTimeout(function(){a.term!=a.element.val()&&(a.selectedItem=null,a.search(null,i))},a.options.delay)}}).bind("keypress.autocomplete",function(b){g&&(g=!1,b.preventDefault())}).bind("focus.autocomplete",function(){if(a.options.disabled){return}a.selectedItem=null,a.previous=a.element.val()}).bind("blur.autocomplete",function(b){if(a.options.disabled){return}clearTimeout(a.searching),a.closing=setTimeout(function(){a.close(b),a._change(b)},150)}),this._initSource(),this.menu=e("<ul></ul>").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",h)[0]).mousedown(function(i){var b=a.menu.element[0];e(i.target).closest(".ui-menu-item").length||setTimeout(function(){e(document).one("mousedown",function(j){j.target!==a.element[0]&&j.target!==b&&!e.ui.contains(b,j.target)&&a.close()})},1),setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(b,j){var i=j.item.data("item.autocomplete");!1!==a._trigger("focus",b,{item:i})&&/^key/.test(b.originalEvent.type)&&a.element.val(i.value)},selected:function(b,j){var i=j.item.data("item.autocomplete"),c=a.previous;a.element[0]!==h.activeElement&&(a.element.focus(),a.previous=c,setTimeout(function(){a.previous=c,a.selectedItem=i},1)),!1!==a._trigger("select",b,{item:i})&&a.element.val(i.value),a.term=a.element.val(),a.close(b),a.selectedItem=i},blur:function(b,i){a.menu.element.is(":visible")&&a.element.val()!==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=function(){a.element.removeAttr("autocomplete")},e(window).bind("beforeunload",a.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),e(window).unbind("beforeunload",this.beforeunloadHandler),e.Widget.prototype.destroy.call(this)},_setOption:function(a,g){e.Widget.prototype._setOption.apply(this,arguments),a==="source"&&this._initSource(),a==="appendTo"&&this.menu.element.appendTo(e(g||"body",this.element[0].ownerDocument)[0]),a==="disabled"&&g&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,h,g;e.isArray(this.options.source)?(h=this.options.source,this.source=function(c,i){i(e.ui.autocomplete.filter(h,c.term))}):typeof this.options.source=="string"?(g=this.options.source,this.source=function(i,b){a.xhr&&a.xhr.abort(),a.xhr=e.ajax({url:g,data:i,dataType:"json",success:function(j,c){b(j)},error:function(){b([])}})}):this.source=this.options.source},search:function(g,c){g=g!=null?g:this.element.val(),this.term=this.element.val();if(g.length<this.options.minLength){return this.close(c)}clearTimeout(this.closing);if(this._trigger("search",c)===!1){return}return this._search(g)},_search:function(b){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:b},this._response())},_response:function(){var g=this,c=++f;return function(a){c===f&&g.__response(a),g.pending--,g.pending||g.element.removeClass("ui-autocomplete-loading")}},__response:function(b){!this.options.disabled&&b&&b.length?(b=this._normalize(b),this._suggest(b),this._trigger("open")):this.close()},close:function(b){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",b))},_change:function(b){this.previous!==this.element.val()&&this._trigger("change",b,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:e.map(a,function(c){return typeof c=="string"?{label:c,value:c}:e.extend({label:c.label||c.value,value:c.value||c.label},c)})},_suggest:function(a){var g=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(g,a),this.menu.deactivate(),this.menu.refresh(),g.show(),this._resizeMenu(),g.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new e.Event("mouseover"))},_resizeMenu:function(){var b=this.menu.element;b.outerWidth(Math.max(b.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,h){var g=this;e.each(h,function(b,i){g._renderItem(a,i)})},_renderItem:function(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),this.menu.deactivate();return}this.menu[g](c)},widget:function(){return this.menu.element},_keyEvent:function(g,c){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(g,c),c.preventDefault()}}}),e.extend(e.ui.autocomplete,{escapeRegex:function(b){return b.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,h){var g=new RegExp(e.ui.autocomplete.escapeRegex(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=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(d){if(!b(d.target).closest(".ui-menu-item a").length){return}d.preventDefault(),a.select(d)}),this.refresh()},refresh:function(){var a=this,d=this.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).parent())}).mouseleave(function(){a.deactivate()})},activate:function(g,f){this.deactivate();if(this.hasScroll()){var j=f.offset().top-this.element.offset().top,i=this.element.scrollTop(),h=this.element.height();j<0?this.element.scrollTop(i+j):j>=h&&this.element.scrollTop(i+j-h+f.height())}this.active=f.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-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=null},next:function(c){this.move("next",".ui-menu-item:first",c)},previous:function(c){this.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=this.active[f+"All"](".ui-menu-item").eq(0);g.length?this.activate(h,g):this.activate(h,this.element.children(e))},nextPage:function(a){if(this.hasScroll()){if(!this.active||this.last()){this.activate(a,this.element.children(".ui-menu-item:first"));return}var h=this.active.offset().top,g=this.element.height(),f=this.element.children(".ui-menu-item").filter(function(){var c=b(this).offset().top-h-g+b(this).height();return c<10&&c>-10});f.length||(f=this.element.children(".ui-menu-item:last")),this.activate(a,f)}else{this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(a){if(this.hasScroll()){if(!this.active||this.first()){this.activate(a,this.element.children(".ui-menu-item:last"));return}var h=this.active.offset().top,g=this.element.height(),f=this.element.children(".ui-menu-item").filter(function(){var c=b(this).offset().top-h+g-b(this).height();return c<10&&c>-10});f.length||(f=this.element.children(".ui-menu-item:first")),this.activate(a,f)}else{this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[b.fn.prop?"prop":"attr"]("scrollHeight")},select:function(c){this._trigger("selected",c,{item:this.active})}})}(jQuery); +/* 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=5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var a=this,n=this.options,m=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),l="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",k=n.values&&n.values.length||1,j=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(n.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),n.range&&(n.range===!0&&(n.values||(n.values=[this._valueMin(),this._valueMin()]),n.values.length&&n.values.length!==2&&(n.values=[n.values[0],n.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(n.range==="min"||n.range==="max"?" ui-slider-range-"+n.range:"")));for(var c=m.length;c<k;c+=1){j.push(l)}this.handles=m.add(e(j.join("")).appendTo(a.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){n.disabled||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-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(g){e(this).data("index.ui-slider-handle",g)}),this.handles.keydown(function(s){var r=e(this).data("index.ui-slider-handle"),q,p,o,b;if(a.options.disabled){return}switch(s.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:s.preventDefault();if(!a._keySliding){a._keySliding=!0,e(this).addClass("ui-state-active"),q=a._start(s,r);if(q===!1){return}}}b=a.options.step,a.options.values&&a.options.values.length?p=o=a.values(r):p=o=a.value();switch(s.keyCode){case e.ui.keyCode.HOME:o=a._valueMin();break;case e.ui.keyCode.END:o=a._valueMax();break;case e.ui.keyCode.PAGE_UP:o=a._trimAlignValue(p+(a._valueMax()-a._valueMin())/f);break;case e.ui.keyCode.PAGE_DOWN:o=a._trimAlignValue(p-(a._valueMax()-a._valueMin())/f);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(p===a._valueMax()){return}o=a._trimAlignValue(p+b);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(p===a._valueMin()){return}o=a._trimAlignValue(p-b)}a._slide(s,r,o)}).keyup(function(g){var b=e(this).data("index.ui-slider-handle");a._keySliding&&(a._keySliding=!1,a._stop(g,b),a._change(g,b),e(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(v){var u=this.options,t,s,r,q,p,o,n,m,a;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:v.pageX,y:v.pageY},s=this._normValueFromMouse(t),r=this._valueMax()-this._valueMin()+1,p=this,this.handles.each(function(g){var h=Math.abs(s-p.values(g));r>h&&(r=h,q=e(this),o=g)}),u.range===!0&&this.values(1)===u.min&&(o+=1,q=e(this.handles[o])),n=this._start(v,o),n===!1?!1:(this._mouseSliding=!0,p._handleIndex=o,q.addClass("ui-state-active").focus(),m=q.offset(),a=!e(v.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=a?{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("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(v,o,s),this._animateOff=!0,!0))},_mouseStart:function(b){return !0},_mouseDrag:function(h){var g={x:h.pageX,y:h.pageY},i=this._normValueFromMouse(g);return this._slide(h,this._handleIndex,i),!1},_mouseStop:function(b){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(b,this._handleIndex),this._change(b,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(h){var g,l,k,j,i;return this.orientation==="horizontal"?(g=this.elementSize.width,l=h.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(g=this.elementSize.height,l=h.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),k=l/g,k>1&&(k=1),k<0&&(k=0),this.orientation==="vertical"&&(k=1-k),j=this._valueMax()-this._valueMin(),i=this._valueMin()+k*j,this._trimAlignValue(i)},_start:function(h,g){var i={handle:this.handles[g],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values()),this._trigger("start",h,i)},_slide:function(h,g,l){var k,j,i;this.options.values&&this.options.values.length?(k=this.values(g?0:1),this.options.values.length===2&&this.options.range===!0&&(g===0&&l>k||g===1&&l<k)&&(l=k),l!==this.values(g)&&(j=this.values(),j[g]=l,i=this._trigger("slide",h,{handle:this.handles[g],value:l,values:j}),k=this.values(g?0:1),i!==!1&&this.values(g,l,!0))):l!==this.value()&&(i=this._trigger("slide",h,{handle:this.handles[g],value:l}),i!==!1&&this.value(l))},_stop:function(h,g){var i={handle:this.handles[g],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values()),this._trigger("stop",h,i)},_change:function(h,g){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[g],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values()),this._trigger("change",h,i)}},value:function(b){if(arguments.length){this.options.value=this._trimAlignValue(b),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(a,j){var i,h,g;if(arguments.length>1){this.options.values[a]=this._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.length?this._values(a):this.value()}i=this.options.values,h=arguments[0];for(g=0;g<i.length;g+=1){i[g]=this._trimAlignValue(h[g]),this._change(null,g)}this._refreshValue()},_setOption:function(a,i){var h,g=0;e.isArray(this.options.values)&&(g=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":i?(this.handles.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-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(h=0;h<g;h+=1){this._change(null,h)}this._animateOff=!1}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b),b},_values:function(h){var g,j,i;if(arguments.length){return g=this.options.values[h],g=this._trimAlignValue(g),g}j=this.options.values.slice();for(i=0;i<j.length;i+=1){j[i]=this._trimAlignValue(j[i])}return j},_trimAlignValue:function(h){if(h<=this._valueMin()){return this._valueMin()}if(h>=this._valueMax()){return this._valueMax()}var g=this.options.step>0?this.options.step:1,j=(h-this._valueMin())%g,i=h-j;return Math.abs(j)*2>=g&&(i+=j>0?g:-g),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t=this.options.range,s=this.options,r=this,q=this._animateOff?!1:s.animate,p,o={},n,m,l,a;this.options.values&&this.options.values.length?this.handles.each(function(c,g){p=(r.values(c)-r._valueMin())/(r._valueMax()-r._valueMin())*100,o[r.orientation==="horizontal"?"left":"bottom"]=p+"%",e(this).stop(1,1)[q?"animate":"css"](o,s.animate),r.options.range===!0&&(r.orientation==="horizontal"?(c===0&&r.range.stop(1,1)[q?"animate":"css"]({left:p+"%"},s.animate),c===1&&r.range[q?"animate":"css"]({width:p-n+"%"},{queue:!1,duration:s.animate})):(c===0&&r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},s.animate),c===1&&r.range[q?"animate":"css"]({height:p-n+"%"},{queue:!1,duration:s.animate}))),n=p}):(m=this.value(),l=this._valueMin(),a=this._valueMax(),p=a!==l?(m-l)/(a-l)*100:0,o[r.orientation==="horizontal"?"left":"bottom"]=p+"%",this.handle.stop(1,1)[q?"animate":"css"](o,s.animate),t==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[q?"animate":"css"]({width:p+"%"},s.animate),t==="max"&&this.orientation==="horizontal"&&this.range[q?"animate":"css"]({width:100-p+"%"},{queue:!1,duration:s.animate}),t==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},s.animate),t==="max"&&this.orientation==="vertical"&&this.range[q?"animate":"css"]({height:100-p+"%"},{queue:!1,duration:s.animate}))}}),e.extend(e.ui.slider,{version:"1.8.23"})})(jQuery); \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/packed/libs/jquery/jquery.ui.core.js --- a/static/scripts/packed/libs/jquery/jquery.ui.core.js +++ /dev/null @@ -1,1 +0,0 @@ -jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,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,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery); \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/packed/mvc/history.js --- a/static/scripts/packed/mvc/history.js +++ b/static/scripts/packed/mvc/history.js @@ -1,1 +1,1 @@ -var HistoryItem=BaseModel.extend({display:function(){},edit_attr:function(){},remove:function(){},download:function(){},details:function(){},rerun:function(){},tags:function(){},annotations:function(){},peek:function(){}});var HistoryItemView=BaseView.extend({tagName:"div",className:"historyItemContainer",icons:{display:"path to icon",edit_attr:"path to icon",remove:"path to icon",download:"path to icon",details:"path to icon",rerun:"path to icon",tags:"path to icon",annotations:"path to icon"},render:function(){this.$el.append("div")}});var History=Backbone.Collection.extend({});var HistoryCollectionView=BaseView.extend({tagName:"body",className:"historyCollection",render:function(){}}); \ No newline at end of file +_=_;var Loggable={logger:null,log:function(){return(this.logger)?(this.logger.debug.apply(this,arguments)):(undefined)}};var LoggingModel=BaseModel.extend(Loggable);var LoggingView=BaseView.extend(Loggable);var Localizable={localizedStrings:{},setLocalizedString:function(b,a){this.localizedStrings[b]=a},localize:function(a){if(a in this.localizedStrings){return this.localizedStrings[a]}return a}};var LocalizableView=LoggingView.extend(Localizable);function linkHTMLTemplate(b,a){if(!b){return"<a></a>"}a=a||"a";var c=["<"+a];for(key in b){var d=b[key];if(d===""){continue}switch(key){case"text":continue;case"classes":key="class";d=(b.classes.join)?(b.classes.join(" ")):(b.classes);default:c.push([" ",key,'="',d,'"'].join(""))}}c.push(">");if("text" in b){c.push(b.text)}c.push("</"+a+">");return c.join("")}var HistoryItem=LoggingModel.extend({defaults:{id:null,name:"",data_type:null,file_size:0,genome_build:null,metadata_data_lines:0,metadata_dbkey:null,metadata_sequences:0,misc_blurb:"",misc_info:"",model_class:"",state:"",deleted:false,purged:false,visible:true,for_editing:true,bodyIsShown:false},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"))},isEditable:function(){return(!(this.get("deleted")||this.get("purged")))},hasData:function(){return(this.get("file_size")>0)},toString:function(){return"HistoryItem("+(this.get("name")||this.get("id")||"")+")"}});HistoryItem.STATES={NEW:"new",UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",OK:"ok",EMPTY:"empty",ERROR:"error",DISCARDED:"discarded",SETTING_METADATA:"setting_metadata",FAILED_METADATA:"failed_metadata"};var HistoryItemView=LoggingView.extend({logger:console,tagName:"div",className:"historyItemContainer",initialize:function(){this.log(this+".initialize:",this,this.model);return this},render:function(){this.log(this+".model:",this.model);var d=this.model.get("id"),c=this.model.get("state");this.$el.attr("id","historyItemContainer-"+d);var a=$("<div/>").attr("id","historyItem-"+d).addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_purgedWarning());a.append(this._render_deletionWarning());a.append(this._render_visibleWarning());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);a.find(".tooltip").tooltip({placement:"bottom"});var b=a.find("[popupmenu]");b.each(function(e,f){f=$(f);make_popupmenu(f)});this.$el.children().remove();return this.$el.append(a)},_render_purgedWarning:function(){var a=null;if(this.model.get("purged")){a=$(HistoryItemView.STRINGS.purgedMsg)}return a},_render_deletionWarning:function(){var b=null;if(this.model.get("deleted")){var a="";if(this.model.get("undelete_url")){a+=HistoryItemView.TEMPLATES.undeleteLink(this.model.attributes)}if(this.model.get("purge_url")){a+=HistoryItemView.TEMPLATES.purgeLink(this.model.attributes)}b=$(HistoryItemView.TEMPLATES.warningMsg({warning:a}))}return b},_render_visibleWarning:function(){var b=null;if(!this.model.get("visible")&&this.model.get("unhide_url")){var a=HistoryItemView.TEMPLATES.hiddenMsg(this.model.attributes);b=$(HistoryItemView.TEMPLATES.warningMsg({warning:a}))}return b},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>'),b=this.model.get("for_editing");if(this.model.get("state")!==HistoryItem.STATES.UPLOAD){a.append(this._render_displayButton());if(b){a.append(this._render_editButton())}}if(b){a.append(this._render_deleteButton())}return a},_render_displayButton:function(){if(this.model.get("purged")){return $('<span class="icon-button display_disabled tooltip" title="Cannot display datasets removed from disk"></span>')}var b=this.model.get("id"),a={title:"Display data in browser",href:"/datasets/"+b+"/display/?preview=True",target:(this.model.get("for_editing"))?("galaxy_main"):(""),classes:["icon-button","tooltip","display"],dataset_id:b};return $(linkHTMLTemplate(a))},_render_editButton:function(){var c=this.model.get("id"),b=this.model.get("purged"),a=this.model.get("deleted");if(a||b){if(!b){return $('<span class="icon-button edit_disabled tooltip" title="Undelete dataset to edit attributes"></span>')}else{return $('<span class="icon-button edit_disabled tooltip" title="Cannot edit attributes of datasets removed from disk"></span>')}}return $(linkHTMLTemplate({title:"Edit attributes",href:"/datasets/"+c+"/edit",target:"galaxy_main",classes:["icon-button","tooltip","edit"]}))},_render_deleteButton:function(){var c=this.model.get("id"),b=this.model.get("purged"),a=this.model.get("deleted");if(b||a){return $('<span title="Dataset is already deleted" class="icon-button delete_disabled tooltip"></span>')}return $(linkHTMLTemplate({title:"Delete",href:"/datasets/"+c+"/delete?show_deleted_on_refresh=False",target:"galaxy_main",id:"historyItemDeleter-"+c,classes:["icon-button","tooltip","delete"]}))},_render_titleLink:function(){var b=this.model.get("name"),a=this.model.get("hid");title=(a+": "+b);return $(linkHTMLTemplate({href:"javascript:void(0);",text:'<span class="historyItemTitle">'+title+"</span>"}))},_render_body_not_viewable:function(a){a.append($("<div>You do not have permission to view dataset.</div>"))},_render_body_uploading:function(a){a.append($("<div>Dataset is uploading</div>"))},_render_body_queued:function(a){a.append($("<div>Job is waiting to run.</div>"));a.append(this._render_showParamsAndRerun())},_render_body_running:function(a){a.append("<div>Job is currently running.</div>");a.append(this._render_showParamsAndRerun())},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append(("An error occurred running this job: <i>"+$.trim(this.model.get("misc_info"))+"</i>"));var b=$(this._render_showParamsAndRerun());if(this.model.get("for_editing")){b.prepend($(linkHTMLTemplate({title:"View or report this error",href:this.model.get("report_errors_url"),target:"galaxy_main",classes:["icon-button","tooltip","bug"]})))}if(this.model.hasData()){b.prepend(this._render_downloadLinks())}a.append(b)},_render_body_discarded:function(a){a.append("<div>The job creating this dataset was cancelled before completion.</div>");a.append(this._render_showParamsAndRerun())},_render_body_setting_metadata:function(a){a.append($("<div>Metadata is being auto-detected.</div>"))},_render_body_empty:function(a){a.append($("<div>No data: <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_showParamsAndRerun())},_render_body_failed_metadata:function(b){var c="An error occurred setting the metadata for this dataset.";if(this.model.isEditable()){var a=linkHTMLTemplate({text:"set it manually or retry auto-detection",href:this.model.get("edit_url"),target:"galaxy_main"});c+="You may be able to "+a+"."}b.append($(HistoryItemView.TEMPLATES.warningMsg({warning:c})));this._render_body_ok(b)},_render_body_ok:function(i){i.append(this._render_hdaSummary());if(this.model.get("misc_info")){i.append($('<div class="info">Info: '+this.model.get("misc_info")+"</div>"))}if(this.model.hasData()){var d=$("<div/>");d.append(this._render_downloadLinks());d.append($(linkHTMLTemplate({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",classes:["icon-button","tooltip","information"]})));if(this.model.get("for_editing")){d.append($(linkHTMLTemplate({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",classes:["icon-button","tooltip","arrow-circle"]})));if(this.model.get("trackster_urls")){var a=this.model.get("trackster_urls");d.append($(linkHTMLTemplate({title:"View in Trackster",href:"javascript:void(0)",classes:["icon-button","tooltip","chart_curve","trackster-add"],"data-url":a["data-url"],"action-url":a["action-url"],"new-url":a["new-url"]})))}if(this.model.get("retag_url")&&this.model.get("annotate_url")){var e=$('<div style="float: right;"></div>');e.append($(linkHTMLTemplate({title:"Edit dataset tags",target:"galaxy_main",href:this.model.get("retag_url"),classes:["icon-button","tooltip","tags"]})));e.append($(linkHTMLTemplate({title:"Edit dataset annotation",target:"galaxy_main",href:this.model.get("annotation_url"),classes:["icon-button","tooltip","annotate"]})));d.append(e);d.append('<div style="clear: both"></div>');var c=$('<div class="tag-area" style="display: none">');c.append("<strong>Tags:</strong>");c.append('<div class="tag-elt"></div>');d.append(c);var f=$(('<div id="${dataset_id}-annotation-area" class="annotation-area" style="display: none">'));f.append("<strong>Annotation:</strong>");f.append(('<div id="${dataset_id}-annotation-elt" style="margin: 1px 0px 1px 0px" class="annotation-elt tooltip editable-text" title="Edit dataset annotation"></div>'));d.append(f)}}d.append('<div style="clear: both;"></div>');i.append(d);var j=$("<div/>");if(this.model.get("display_apps")){var k=this.model.get("display_apps"),b=$("<span/>");for(app_name in k){var h=k[app_name],g=app_name+" ";for(location_name in h){g+=linkHTMLTemplate({text:location_name,href:h[location_name].url,target:h[location_name].target})+" "}b.append(g)}j.append(b)}i.append(j)}else{if(this.model.get("for_editing")){i.append(this._render_showParamsAndRerun())}}i.append(this._render_peek())},_render_body:function(){this.log(this+"_render_body");var b=this.model.get("state"),c=this.model.get("for_editing");this.log("state:",b,"for_editing",c);var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: block");switch(b){case HistoryItem.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryItem.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryItem.STATES.QUEUED:this._render_body_queued(a);break;case HistoryItem.STATES.RUNNING:this._render_body_running(a);break;case HistoryItem.STATES.ERROR:this._render_body_error(a);break;case HistoryItem.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryItem.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryItem.STATES.EMPTY:this._render_body_empty(a);break;case HistoryItem.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryItem.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+b+'".</div>'))}a.append('<div style="clear: both"></div>');if(this.model.get("bodyIsShown")===false){a.hide()}return a},_render_hdaSummary:function(){var a=_.template('<span class="<%= dbkey %>"><%= dbkey %></span>',{dbkey:this.model.get("metadata_dbkey")});if(this.model.get("metadata_dbkey")==="?"&&this.model.isEditable()){a=linkHTMLTemplate({text:this.model.get("metadata_dbkey"),href:this.model.get("edit_url"),target:"galaxy_main"})}return(HistoryItemView.TEMPLATES.hdaSummary(_.extend({dbkeyHTML:a},this.model.attributes)))},_render_showParamsAndRerun:function(){var a=$("<div/>");a.append($(linkHTMLTemplate({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",classes:["icon-button","tooltip","information"]})));if(this.model.get("for_editing")){a.append($(linkHTMLTemplate({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",classes:["icon-button","tooltip","arrow-circle"]})))}return a},_render_downloadLinks:function(){if(this.model.get("purged")){return null}var a=linkHTMLTemplate({title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]});var d=this.model.get("download_meta_urls");if(!d){return a}var c=$('<div popupmenu="dataset-'+this.model.get("id")+'-popup"></div>');c.append(linkHTMLTemplate({text:"Download Dataset",title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]}));c.append("<a>Additional Files</a>");for(file_type in d){c.append(linkHTMLTemplate({text:"Download "+file_type,href:d[file_type],classes:["action-button"]}))}var b=$(('<div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup"></div>'));b.append(a);c.append(b);return c},_render_peek:function(){if(!this.model.get("peek")){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(){this.log(this+".toggleBodyVisibility");this.$el.find(".historyItemBody").toggle()},toString:function(){var a=(this.model)?(this.model+""):("");return"HistoryItemView("+a+")"}});HistoryItemView.TEMPLATES={};HistoryItemView.TEMPLATES.warningMsg=_.template("<div class=warningmessagesmall><strong><%= warning %></strong></div>");HistoryItemView.TEMPLATES.undeleteLink=_.template('This dataset has been deleted. Click <a href="<%= undelete_url %>" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}" target="galaxy_history">here</a> to undelete it.');HistoryItemView.TEMPLATES.purgeLink=_.template(' or <a href="<%= purge_url %>" class="historyItemPurge" id="historyItemPurger-{{ id }}" target="galaxy_history">here</a> to immediately remove it from disk.');HistoryItemView.TEMPLATES.hiddenMsg=_.template('This dataset has been hidden. Click <a href="<%= unhide_url %>" class="historyItemUnhide" id="historyItemUnhider-{{ id }}" target="galaxy_history">here</a> to unhide it.');HistoryItemView.TEMPLATES.hdaSummary=_.template(["<%= misc_blurb %><br />",'format: <span class="<%= data_type %>"><%= data_type %></span>, ',"database: <%= dbkeyHTML %>"].join(""));HistoryItemView.STRINGS={};HistoryItemView.STRINGS.purgedMsg=HistoryItemView.TEMPLATES.warningMsg({warning:"This dataset has been deleted and removed from disk."});var HistoryCollection=Backbone.Collection.extend({model:HistoryItem,toString:function(){return("HistoryCollection()")}});var History=LoggingModel.extend({logger:console,defaults:{id:"",name:"",state:"",state_details:{discarded:0,empty:0,error:0,failed_metadata:0,ok:0,queued:0,running:0,setting_metadata:0,upload:0}},initialize:function(b,a){this.log(this+".initialize",b,a);this.items=new HistoryCollection()},loadDatasetsAsHistoryItems:function(c){var a=this,b=this.get("id"),d=this.get("state_details");_.each(c,function(f,e){a.log("loading dataset: ",f,e);var h=new HistoryItem(_.extend(f,{history_id:b}));a.log("as History:",h);a.items.add(h);var g=f.state;d[g]+=1});this.set("state_details",d);this._stateFromStateDetails();return this},_stateFromStateDetails:function(){this.set("state","");var a=this.get("state_details");if((a.error>0)||(a.failed_metadata>0)){this.set("state",HistoryItem.STATES.ERROR)}else{if((a.running>0)||(a.setting_metadata>0)){this.set("state",HistoryItem.STATES.RUNNING)}else{if(a.queued>0){this.set("state",HistoryItem.STATES.QUEUED)}else{if(a.ok===this.items.length){this.set("state",HistoryItem.STATES.OK)}else{throw ("_stateFromStateDetails: unable to determine history state from state details: "+this.state_details)}}}}return this},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});var HistoryView=LoggingView.extend({logger:console,el:"body.historyPage",initialize:function(){this.log(this+".initialize");this.itemViews=[];var a=this;this.model.items.each(function(c){var b=new HistoryItemView({model:c});a.itemViews.push(b)})},render:function(){this.log(this+".render");var a=$("<div/>");_.each(this.itemViews,function(b){a.prepend(b.render())});this.$el.append(a.children());a.remove()},toString:function(){var a=this.model.get("name")||"";return"HistoryView("+a+")"}});if(window.USE_MOCK_DATA){mockHistory={};mockHistory.data={template:{id:"a799d38679e985db",name:"template",data_type:"fastq",file_size:226297533,genome_build:"?",metadata_data_lines:0,metadata_dbkey:"?",metadata_sequences:0,misc_blurb:"215.8 MB",misc_info:"uploaded fastq file",model_class:"HistoryDatasetAssociation",download_url:"",state:"ok",visible:true,deleted:false,purged:false,hid:0,for_editing:true,undelete_url:"example.com/undelete",purge_url:"example.com/purge",unhide_url:"example.com/unhide",display_url:"example.com/display",edit_url:"example.com/edit",delete_url:"example.com/delete",show_params_url:"example.com/show_params",rerun_url:"example.com/rerun",retag_url:"example.com/retag",annotate_url:"example.com/annotate",peek:['<table cellspacing="0" cellpadding="3"><tr><th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th><th>5.MAPQ</th><th>6.CIGAR</th><th>7.MRNM</th><th>8.MPOS</th><th>9.ISIZE</th><th>10.SEQ</th><th>11.QUAL</th><th>12.OPT</th></tr>','<tr><td colspan="100%">@SQ SN:gi|87159884|ref|NC_007793.1| LN:2872769</td></tr>','<tr><td colspan="100%">@PG ID:bwa PN:bwa VN:0.5.9-r16</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 73 gi|87159884|ref|NC_007793.1| 2720169 37 101M = 2720169 0 NAATATGACATTATTTTCAAAACAGCTGAAAATTTAGACGTACCGATTTATCTACATCCCGCGCCAGTTAACAGTGACATTTATCAATCATACTATAAAGG !!!!!!!!!!$!!!$!!!!!$!!!!!!$!$!$$$!!$!!$!!!!!!!!!!!$!</td></tr>','<tr><td colspan="100%">!!!$!$!$$!!$$!!$!!!!!!!!!!!!!!!!!!!!!!!!!!$!!$!! XT:A:U NM:i:1 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:0A100</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 133 gi|87159884|ref|NC_007793.1| 2720169 0 * = 2720169 0 NAAACTGTGGCTTCGTTNNNNNNNNNNNNNNNGTGANNNNNNNNNNNNNNNNNNNGNNNNNNNNNNNNNNNNNNNNCNAANNNNNNNNNNNNNNNNNNNNN !!!!!!!!!!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>','<tr><td colspan="100%">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',"</table>"].join("")}};_.extend(mockHistory.data,{deleted:_.extend(_.clone(mockHistory.data.template),{deleted:true}),purgedNotDeleted:_.extend(_.clone(mockHistory.data.template),{purged:true}),notvisible:_.extend(_.clone(mockHistory.data.template),{visible:false}),hasDisplayApps:_.extend(_.clone(mockHistory.data.template),{display_apps:{"display in IGB":{Web:"/display_application/63cd3858d057a6d1/igb_bam/Web",Local:"/display_application/63cd3858d057a6d1/igb_bam/Local"}}}),canTrackster:_.extend(_.clone(mockHistory.data.template),{trackster_urls:{"data-url":"example.com/trackster-data","action-url":"example.com/trackster-action","new-url":"example.com/trackster-new"}}),zeroSize:_.extend(_.clone(mockHistory.data.template),{file_size:0}),hasMetafiles:_.extend(_.clone(mockHistory.data.template),{download_meta_urls:{bam_index:"example.com/bam-index"}}),upload:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.UPLOAD}),queued:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.QUEUED}),running:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.RUNNING}),empty:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.EMPTY}),error:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.ERROR}),discarded:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.DISCARDED}),setting_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.SETTING_METADATA}),failed_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.FAILED_METADATA})});$(document).ready(function(){mockHistory.items={};mockHistory.views={};for(key in mockHistory.data){mockHistory.items[key]=new HistoryItem(mockHistory.data[key]);mockHistory.items[key].set("name",key);mockHistory.views[key]=new HistoryItemView({model:mockHistory.items[key]});$("body").append(mockHistory.views[key].render())}})}; \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/packed/viz/phyloviz.js --- /dev/null +++ b/static/scripts/packed/viz/phyloviz.js @@ -0,0 +1,1 @@ +var UserMenuBase=Backbone.View.extend({className:"UserMenuBase",isAcceptableValue:function(e,c,a){var b=this,f=e.val(),g=e.attr("displayLabel")||e.attr("id").replace("phyloViz","");function d(h){return !isNaN(parseFloat(h))&&isFinite(h)}if(!d(f)){alert(g+" is not a number!");return false}if(f>a){alert(g+" is too large.");return false}else{if(f<c){alert(g+" is too small.");return false}}return true},hasIllegalJsonCharacters:function(a){if(a.val().search(/"|'|\\/)!==-1){alert("Named fields cannot contain these illegal characters: double quote(\"), single guote('), or back slash(\\). ");return true}return false}});function PhyloTreeLayout(){var j=this,e=d3.layout.hierarchy().sort(null).value(null),i=360,d="Linear",h=18,f=200,g=0,c=0.5,a=50;j.leafHeight=function(k){if(typeof k==="undefined"){return h}else{h=k;return j}};j.layoutMode=function(k){if(typeof k==="undefined"){return d}else{d=k;return j}};j.layoutAngle=function(k){if(typeof k==="undefined"){return i}if(isNaN(k)||k<0||k>360){return j}else{i=k;return j}};j.separation=function(k){if(typeof k==="undefined"){return f}else{f=k;return j}};j.links=function(k){return d3.layout.tree().links(k)};j.nodes=function(n,l){var m=e.call(j,n,l),k=[],p=0,o=0;m.forEach(function(q){var r=q.data;r.depth=q.depth;p=r.depth>p?r.depth:p;k.push(r)});k.forEach(function(q){if(!q.children){o+=1;q.depth=p}});h=d==="Circular"?i/o:h;g=0;b(k[0],p,h,null);return k};function b(o,q,n,m){var l=o.children,k=0;var p=o.dist||c;p=p>1?1:p;o.dist=p;if(m!==null){o.y0=m.y0+p*f}else{o.y0=a}if(!l){o.x0=g++*n}else{l.forEach(function(r){r.parent=o;k+=b(r,q,n,o)});o.x0=k/l.length}o.x=o.x0;o.y=o.y0;return o.x0}return j}var PhyloTree=Visualization.extend({defaults:{layout:"Linear",separation:250,leafHeight:18,type:"phyloviz",title:"Title",scaleFactor:1,translate:[0,0],fontSize:12,selectedNode:null,nodeAttrChangedTime:0},root:{},toggle:function(a){if(typeof a==="undefined"){return}if(a.children){a._children=a.children;a.children=null}else{a.children=a._children;a._children=null}},toggleAll:function(a){if(a.children&&a.children.length!==0){a.children.forEach(this.toggleAll);toggle(a)}},getData:function(){return this.root},save:function(){var a=this.root;b(a);this.set("root",a);function b(d){delete d.parent;if(d._selected){delete d._selected}d.children?d.children.forEach(b):0;d._children?d._children.forEach(b):0}var c=jQuery.extend(true,{},this.attributes);c.selectedNode=null;show_message("Saving to Galaxy","progress");return $.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(c)},success:function(d){var e=d.url.split("id=")[1].split("&")[0],f="/phyloviz/visualization?id="+e;window.history.pushState({},"",f+window.location.hash);hide_modal()}})}});var PhylovizLayoutBase=Backbone.View.extend({defaults:{nodeRadius:4.5},stdInit:function(b){var a=this;a.model.on("change:separation change:leafHeight change:fontSize change:nodeAttrChangedTime",a.updateAndRender,a);a.vis=b.vis;a.i=0;a.maxDepth=-1;a.width=b.width;a.height=b.height},updateAndRender:function(c){var b=d3.select(".vis"),a=this;c=c||a.model.root;a.renderNodes(c);a.renderLinks(c);a.addTooltips()},renderLinks:function(a){var j=this;var b=j.diagonal;var c=j.duration;var e=j.layoutMode;var g=j.vis.selectAll("g.completeLink").data(j.tree.links(j.nodes),function(k){return k.target.id});var i=function(k){k.pos0=k.source.y0+" "+k.source.x0;k.pos1=k.source.y0+" "+k.target.x0;k.pos2=k.target.y0+" "+k.target.x0};var h=g.enter().insert("svg:g","g.node").attr("class","completeLink");h.append("svg:path").attr("class","link").attr("d",function(k){i(k);return"M "+k.pos0+" L "+k.pos1});var f=g.transition().duration(500);f.select("path.link").attr("d",function(k){i(k);return"M "+k.pos0+" L "+k.pos1+" L "+k.pos2});var d=g.exit().remove()},selectNode:function(b){var a=this;d3.selectAll("g.node").classed("selectedHighlight",function(c){if(b.id===c.id){if(b._selected){delete b._selected;return false}else{b._selected=true;return true}}return false});a.model.set("selectedNode",b);$("#phyloVizSelectedNodeName").val(b.name);$("#phyloVizSelectedNodeDist").val(b.dist);$("#phyloVizSelectedNodeAnnotation").val(b.annotation||"")},addTooltips:function(){$(".bs-tooltip").remove();$(".node").attr("data-original-title",function(){var b=this.__data__,a=b.annotation||"None";return b?(b.name?b.name+"<br/>":"")+"Dist: "+b.dist+" <br/>Annotation: "+a:""}).tooltip({placement:"top",trigger:"hover"})}});var PhylovizLinearView=PhylovizLayoutBase.extend({initialize:function(b){var a=this;a.margins=b.margins;a.layoutMode="Linear";a.stdInit(b);a.layout();a.updateAndRender(a.model.root)},layout:function(){var a=this;a.tree=new PhyloTreeLayout().layoutMode("Linear");a.diagonal=d3.svg.diagonal().projection(function(b){return[b.y,b.x]})},renderNodes:function(a){var h=this,i=h.model.get("fontSize")+"px";h.tree.separation(h.model.get("separation")).leafHeight(h.model.get("leafHeight"));var d=500,b=h.tree.separation(h.model.get("separation")).nodes(h.model.root);var c=h.vis.selectAll("g.node").data(b,function(j){return j.name+j.id||(j.id=++h.i)});h.nodes=b;h.duration=d;var e=c.enter().append("svg:g").attr("class","node").on("dblclick",function(){d3.event.stopPropagation()}).on("click",function(j){if(d3.event.altKey){h.selectNode(j)}else{if(j.children&&j.children.length===0){return}h.model.toggle(j);h.updateAndRender(j)}});e.attr("transform",function(j){return"translate("+a.y0+","+a.x0+")"});e.append("svg:circle").attr("r",0.000001).style("fill",function(j){return j._children?"lightsteelblue":"#fff"});e.append("svg:text").attr("class","nodeLabel").attr("x",function(j){return j.children||j._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(j){return j.children||j._children?"end":"start"}).style("fill-opacity",0.000001);var f=c.transition().duration(d);f.attr("transform",function(j){return"translate("+j.y+","+j.x+")"});f.select("circle").attr("r",h.defaults.nodeRadius).style("fill",function(j){return j._children?"lightsteelblue":"#fff"});f.select("text").style("fill-opacity",1).style("font-size",i).text(function(j){return j.name});var g=c.exit().transition().duration(d).remove();g.select("circle").attr("r",0.000001);g.select("text").style("fill-opacity",0.000001);b.forEach(function(j){j.x0=j.x;j.y0=j.y})}});var PhylovizView=Backbone.View.extend({className:"phyloviz",initialize:function(b){var a=this;a.MIN_SCALE=0.05;a.MAX_SCALE=5;a.MAX_DISPLACEMENT=500;a.margins=[10,60,10,80];a.width=$("#PhyloViz").width();a.height=$("#PhyloViz").height();a.radius=a.width;a.data=b.data;$(window).resize(function(){a.width=$("#PhyloViz").width();a.height=$("#PhyloViz").height();a.render()});a.phyloTree=new PhyloTree(b.config);a.phyloTree.root=a.data;a.zoomFunc=d3.behavior.zoom().scaleExtent([a.MIN_SCALE,a.MAX_SCALE]);a.zoomFunc.translate(a.phyloTree.get("translate"));a.zoomFunc.scale(a.phyloTree.get("scaleFactor"));a.navMenu=new HeaderButtons(a);a.settingsMenu=new SettingsMenu({phyloTree:a.phyloTree});a.nodeSelectionView=new NodeSelectionView({phyloTree:a.phyloTree});a.search=new PhyloVizSearch();setTimeout(function(){a.zoomAndPan()},1000)},render:function(){var b=this;$("#PhyloViz").empty();b.mainSVG=d3.select("#PhyloViz").append("svg:svg").attr("width",b.width).attr("height",b.height).attr("pointer-events","all").call(b.zoomFunc.on("zoom",function(){b.zoomAndPan()}));b.boundingRect=b.mainSVG.append("svg:rect").attr("class","boundingRect").attr("width",b.width).attr("height",b.height).attr("stroke","black").attr("fill","white");b.vis=b.mainSVG.append("svg:g").attr("class","vis");b.layoutOptions={model:b.phyloTree,width:b.width,height:b.height,vis:b.vis,margins:b.margins};$("#title").text("Phylogenetic Tree from "+b.phyloTree.get("title")+":");var a=new PhylovizLinearView(b.layoutOptions)},zoomAndPan:function(a){if(typeof a!=="undefined"){var g=a.zoom,c=a.translate}var j=this,e=j.zoomFunc.scale(),i=j.zoomFunc.translate(),f="",h="";switch(g){case"reset":e=1;i=[0,0];break;case"+":e*=1.1;break;case"-":e*=0.9;break;default:if(typeof g==="number"){e=g}else{if(d3.event!==null){e=d3.event.scale}}}if(e<j.MIN_SCALE||e>j.MAX_SCALE){return}j.zoomFunc.scale(e);f="translate("+j.margins[3]+","+j.margins[0]+") scale("+e+")";if(d3.event!==null){h="translate("+d3.event.translate+")"}else{if(typeof c!=="undefined"){var d=c.split(",")[0];var b=c.split(",")[1];if(!isNaN(d)&&!isNaN(b)){i=[i[0]+parseFloat(d),i[1]+parseFloat(b)]}}j.zoomFunc.translate(i);h="translate("+i+")"}j.phyloTree.set("scaleFactor",e);j.phyloTree.set("translate",i);j.vis.attr("transform",h+f)},reloadViz:function(){var b=this,d=$("#phylovizNexSelector :selected").val(),a=b.phyloTree.get("dataset_id"),c="phyloviz/getJsonData?dataset_id="+a+"&treeIndex="+String(d);$.getJSON(c,function(e){window.initPhyloViz(e.data,e.config)})}});var HeaderButtons=Backbone.View.extend({initialize:function(b){var a=this;a.phylovizView=b;$("#panelHeaderRightBtns").empty();$("#phyloVizNavBtns").empty();$("#phylovizNexSelector").off();a.initNavBtns();a.initRightHeaderBtns();$("#phylovizNexSelector").off().on("change",function(){a.phylovizView.reloadViz()})},initRightHeaderBtns:function(){var a=this;rightMenu=create_icon_buttons_menu([{icon_class:"gear",title:"PhyloViz Settings",on_click:function(){$("#SettingsMenu").show();a.settingsMenu.updateUI()}},{icon_class:"disk",title:"Save visualization",on_click:function(){var b=$("#phylovizNexSelector option:selected").text();if(b){a.phylovizView.phyloTree.set("title",b)}a.phylovizView.phyloTree.save()}},{icon_class:"chevron-expand",title:"Search / Edit Nodes",on_click:function(){$("#nodeSelectionView").show()}},{icon_class:"information",title:"Phyloviz Help",on_click:function(){window.open("http://wiki.g2.bx.psu.edu/Learn/Visualization/PhylogeneticTree")}}],{tooltip_config:{placement:"bottom"}});$("#panelHeaderRightBtns").append(rightMenu.$el)},initNavBtns:function(){var a=this,b=create_icon_buttons_menu([{icon_class:"zoom-in",title:"Zoom in",on_click:function(){a.phylovizView.zoomAndPan({zoom:"+"})}},{icon_class:"zoom-out",title:"Zoom out",on_click:function(){a.phylovizView.zoomAndPan({zoom:"-"})}},{icon_class:"arrow-circle",title:"Reset Zoom/Pan",on_click:function(){a.phylovizView.zoomAndPan({zoom:"reset"})}}],{tooltip_config:{placement:"bottom"}});$("#phyloVizNavBtns").append(b.$el)}});var SettingsMenu=UserMenuBase.extend({className:"Settings",initialize:function(b){var a=this;a.phyloTree=b.phyloTree;a.el=$("#SettingsMenu");a.inputs={separation:$("#phyloVizTreeSeparation"),leafHeight:$("#phyloVizTreeLeafHeight"),fontSize:$("#phyloVizTreeFontSize")};$("#settingsCloseBtn").off().on("click",function(){a.el.hide()});$("#phylovizResetSettingsBtn").off().on("click",function(){a.resetToDefaults()});$("#phylovizApplySettingsBtn").off().on("click",function(){a.apply()})},apply:function(){var a=this;if(!a.isAcceptableValue(a.inputs.separation,50,2500)||!a.isAcceptableValue(a.inputs.leafHeight,5,30)||!a.isAcceptableValue(a.inputs.fontSize,5,20)){return}$.each(a.inputs,function(b,c){a.phyloTree.set(b,c.val())})},updateUI:function(){var a=this;$.each(a.inputs,function(b,c){c.val(a.phyloTree.get(b))})},resetToDefaults:function(){$(".bs-tooltip").remove();var a=this;$.each(a.phyloTree.defaults,function(b,c){a.phyloTree.set(b,c)});a.updateUI()},render:function(){}});var NodeSelectionView=UserMenuBase.extend({className:"Settings",initialize:function(b){var a=this;a.el=$("#nodeSelectionView");a.phyloTree=b.phyloTree;a.UI={enableEdit:$("#phylovizEditNodesCheck"),saveChanges:$("#phylovizNodeSaveChanges"),cancelChanges:$("#phylovizNodeCancelChanges"),name:$("#phyloVizSelectedNodeName"),dist:$("#phyloVizSelectedNodeDist"),annotation:$("#phyloVizSelectedNodeAnnotation")};a.valuesOfConcern={name:null,dist:null,annotation:null};$("#nodeSelCloseBtn").off().on("click",function(){a.el.hide()});a.UI.saveChanges.off().on("click",function(){a.updateNodes()});a.UI.cancelChanges.off().on("click",function(){a.cancelChanges()});(function(c){c.fn.enable=function(d){return c(this).each(function(){if(d){c(this).removeAttr("disabled")}else{c(this).attr("disabled","disabled")}})}})(jQuery);a.UI.enableEdit.off().on("click",function(){a.toggleUI()})},toggleUI:function(){var a=this,b=a.UI.enableEdit.is(":checked");!b?a.cancelChanges():"";$.each(a.valuesOfConcern,function(c,d){a.UI[c].enable(b)});if(b){a.UI.saveChanges.show();a.UI.cancelChanges.show()}else{a.UI.saveChanges.hide();a.UI.cancelChanges.hide()}},cancelChanges:function(){var a=this,b=a.phyloTree.get("selectedNode");if(b){$.each(a.valuesOfConcern,function(c,d){a.UI[c].val(b[c])})}},updateNodes:function(){var a=this,b=a.phyloTree.get("selectedNode");if(b){if(!a.isAcceptableValue(a.UI.dist,0,1)||a.hasIllegalJsonCharacters(a.UI.name)||a.hasIllegalJsonCharacters(a.UI.annotation)){return}$.each(a.valuesOfConcern,function(c,d){(b[c])=a.UI[c].val()});a.phyloTree.set("nodeAttrChangedTime",new Date())}else{alert("No node selected")}}});var PhyloVizSearch=UserMenuBase.extend({initialize:function(){var a=this;$("#phyloVizSearchBtn").on("click",function(){var c=$("#phyloVizSearchTerm"),d=$("#phyloVizSearchCondition").val().split("-"),b=d[0],e=d[1];a.hasIllegalJsonCharacters(c);if(b==="dist"){a.isAcceptableValue(c,0,1)}a.searchTree(b,e,c.val())})},searchTree:function(a,c,b){d3.selectAll("g.node").classed("searchHighlight",function(f){var e=f[a];if(typeof e!=="undefined"&&e!==null){if(a==="dist"){switch(c){case"greaterEqual":return e>=+b;case"lesserEqual":return e<=+b;default:return}}else{if(a==="name"||a==="annotation"){return e.toLowerCase().indexOf(b.toLowerCase())!==-1}}}})}}); \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da static/scripts/packed/viz/trackster.js --- a/static/scripts/packed/viz/trackster.js +++ b/static/scripts/packed/viz/trackster.js @@ -1,1 +1,1 @@ -var class_module=function(b,a){var c=function(){var g=arguments[0];for(var f=1;f<arguments.length;f++){var d=arguments[f];for(var e in d){g[e]=d[e]}}return g};a.extend=c};var requestAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b,a){window.setTimeout(b,1000/60)}})();var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(e,b){var g=e[0],f=e[1],d=b[0],c=b[1],a;if(g<d){if(f<d){a=BEFORE}else{if(f<=c){a=OVERLAP_START}else{a=CONTAINS}}}else{if(g>c){a=AFTER}else{if(f<=c){a=CONTAINED_BY}else{a=OVERLAP_END}}}return a};var is_overlap=function(c,b){var a=compute_overlap(c,b);return(a!==BEFORE&&a!==AFTER)};var is_deferred=function(a){return("isResolved" in a)};var get_random_color=function(a){if(!a){a="#ffffff"}if(typeof(a)==="string"){a=[a]}for(var j=0;j<a.length;j++){a[j]=parseInt(a[j].slice(1),16)}var n=function(t,s,i){return((t*299)+(s*587)+(i*114))/1000};var e=function(v,u,w,s,i,t){return(Math.max(v,s)-Math.min(v,s))+(Math.max(u,i)-Math.min(u,i))+(Math.max(w,t)-Math.min(w,t))};var g,o,f,k,q,h,r,c,d,b,p,m=false,l=0;do{g=Math.round(Math.random()*16777215);o=(g&16711680)>>16;f=(g&65280)>>8;k=g&255;d=n(o,f,k);m=true;for(j=0;j<a.length;j++){q=a[j];h=(q&16711680)>>16;r=(q&65280)>>8;c=q&255;b=n(h,r,c);p=e(o,f,k,h,r,c);if((Math.abs(d-b)<40)||(p<200)){m=false;break}}l++}while(!m&&l<=10);return"#"+(16777216+g).toString(16).substr(1,6)};var create_action_icon=function(c,b,a){return $("<a/>").attr("href","javascript:void(0);").attr("title",c).addClass("icon-button").addClass(b).tooltip().click(a)};var trackster_module=function(d,S){var o=d("class").extend,s=d("slotting"),I=d("painters");var m={};var k=function(Z,aa){m[Z.attr("id")]=aa};var l=function(Z,ab,ad,ac){ad=".group";var aa={};m[Z.attr("id")]=ac;Z.bind("drag",{handle:"."+ab,relative:true},function(al,am){var ak=$(this),ap=$(this).parent(),ah=ap.children(),aj=m[$(this).attr("id")],ag,af,an,ae,ai;af=$(this).parents(ad);if(af.length!==0){an=af.position().top;ae=an+af.outerHeight();if(am.offsetY<an){$(this).insertBefore(af);var ao=m[af.attr("id")];ao.remove_drawable(aj);ao.container.add_drawable_before(aj,ao);return}else{if(am.offsetY>ae){$(this).insertAfter(af);var ao=m[af.attr("id")];ao.remove_drawable(aj);ao.container.add_drawable(aj);return}}}af=null;for(ai=0;ai<ah.length;ai++){ag=$(ah.get(ai));an=ag.position().top;ae=an+ag.outerHeight();if(ag.is(ad)&&this!==ag.get(0)&&am.offsetY>=an&&am.offsetY<=ae){if(am.offsetY-an<ae-am.offsetY){ag.find(".content-div").prepend(this)}else{ag.find(".content-div").append(this)}if(aj.container){aj.container.remove_drawable(aj)}m[ag.attr("id")].add_drawable(aj);return}}for(ai=0;ai<ah.length;ai++){ag=$(ah.get(ai));if(am.offsetY<ag.position().top&&!(ag.hasClass("reference-track")||ag.hasClass("intro"))){break}}if(ai===ah.length){if(this!==ah.get(ai-1)){ap.append(this);m[ap.attr("id")].move_drawable(aj,ai)}}else{if(this!==ah.get(ai)){$(this).insertBefore(ah.get(ai));m[ap.attr("id")].move_drawable(aj,(am.deltaY>0?ai-1:ai))}}}).bind("dragstart",function(){aa["border-top"]=Z.css("border-top");aa["border-bottom"]=Z.css("border-bottom");$(this).css({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind("dragend",function(){$(this).css(aa)})};S.moveable=l;var Y=16,D=9,A=20,x=100,F=12000,P=400,H=5000,u=100,n="There was an error in indexing this dataset. ",G="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",B="No data for this chrom/contig.",t="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",v="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",N=10,E=20;function U(aa,Z){if(!Z){Z=0}var ab=Math.pow(10,Z);return Math.round(aa*ab)/ab}var p=function(aa,Z,ac){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.name=ac.name;this.view=aa;this.container=Z;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name}],saved_values:ac.prefs,onchange:function(){this.track.set_name(this.track.config.values.name)}});this.prefs=this.config.values;this.drag_handle_class=ac.drag_handle_class;this.is_overview=false;this.action_icons={};this.content_visible=true;this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").css("float","left").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(ad){ad.stopPropagation()});var ab=this;this.container_div.hover(function(){ab.icons_div.show()},function(){ab.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(Z){if(Z.content_visible){Z.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");Z.hide_contents();Z.content_visible=false}else{Z.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");Z.content_visible=true;Z.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"settings-icon",on_click_fn:function(aa){var ac=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},Z=function(){aa.config.update_from_form($(".dialog-box"));hide_modal();$(window).unbind("keypress.check_enter_esc")},ab=function(ad){if((ad.keyCode||ad.which)===27){ac()}else{if((ad.keyCode||ad.which)===13){Z()}}};$(window).bind("keypress.check_enter_esc",ab);show_modal("Configure",aa.config.build_form(),{Cancel:ac,OK:Z})}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.remove()}}];o(p.prototype,{init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.content_visible){return true}return false},request_draw:function(){},_draw:function(){},to_dict:function(){},set_name:function(Z){this.old_name=this.name;this.name=Z;this.name_div.text(this.name)},revert_name:function(){if(this.old_name){this.name=this.old_name;this.name_div.text(this.name)}},remove:function(){this.changed();this.container.remove_drawable(this);var Z=this.view;this.container_div.hide(0,function(){$(this).remove();Z.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(aa,af,ae,ad,Z,ac){var ab=this;this.action_icons[aa]=$("<a/>").attr("href","javascript:void(0);").attr("title",af).addClass("icon-button").addClass(ae).tooltip().click(function(){ad(ab)}).appendTo(this.icons_div);if(ac){this.action_icons[aa].hide()}},build_action_icons:function(Z){var ab;for(var aa=0;aa<Z.length;aa++){ab=Z[aa];this.add_action_icon(ab.name,ab.title,ab.css_class,ab.on_click_fn,ab.prepend,ab.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){}});var w=function(aa,Z,ab){p.call(this,aa,Z,ab);this.obj_type=ab.obj_type;this.drawables=[]};o(w.prototype,p.prototype,{unpack_drawables:function(ab){this.drawables=[];var aa;for(var Z=0;Z<ab.length;Z++){aa=object_from_template(ab[Z],this.view,this);this.add_drawable(aa)}},init:function(){for(var Z=0;Z<this.drawables.length;Z++){this.drawables[Z].init()}},_draw:function(){for(var Z=0;Z<this.drawables.length;Z++){this.drawables[Z]._draw()}},to_dict:function(){var aa=[];for(var Z=0;Z<this.drawables.length;Z++){aa.push(this.drawables[Z].to_dict())}return{name:this.name,prefs:this.prefs,obj_type:this.obj_type,drawables:aa}},add_drawable:function(Z){this.drawables.push(Z);Z.container=this;this.changed()},add_drawable_before:function(ab,Z){this.changed();var aa=this.drawables.indexOf(Z);if(aa!==-1){this.drawables.splice(aa,0,ab);return true}return false},replace_drawable:function(ab,Z,aa){var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables[ac]=Z;if(aa){ab.container_div.replaceWith(Z.container_div)}this.changed()}return ac},remove_drawable:function(aa){var Z=this.drawables.indexOf(aa);if(Z!==-1){this.drawables.splice(Z,1);aa.container=null;this.changed();return true}return false},move_drawable:function(aa,ab){var Z=this.drawables.indexOf(aa);if(Z!==-1){this.drawables.splice(Z,1);this.drawables.splice(ab,0,aa);this.changed();return true}return false}});var M=function(aa,Z,ac){o(ac,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});w.call(this,aa,Z,ac);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);k(this.container_div,this);k(this.content_div,this);l(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new V(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ac){this.unpack_drawables(ac.drawables)}if("filters" in ac){var ab=this.filters_manager;this.filters_manager=new V(this,ac.filters);ab.parent_div.replaceWith(this.filters_manager.parent_div);if(ac.filters.visible){this.setup_multitrack_filtering()}}};o(M.prototype,p.prototype,w.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(Z){if(Z.filters_manager.visible()){Z.filters_manager.clear_filters();Z._restore_filter_managers()}else{Z.setup_multitrack_filtering();Z.request_draw(true)}Z.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var Z=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(Z)}return Z},build_header_div:function(){var Z=$("<div/>").addClass("track-header");Z.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.name).appendTo(Z);return Z},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ab=this.drawables.length;if(ab===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ab===1){if(this.drawables[0] instanceof g){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ai,ah,af,al=true,ad=this.drawables[0].get_type(),Z=0;for(ai=0;ai<ab;ai++){af=this.drawables[ai];if(af.get_type()!==ad){can_composite=false;break}if(af instanceof c){Z++}}if(al||Z===1){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".bs-tooltip").remove()}if(Z>1&&Z===this.drawables.length){var am={},aa;af=this.drawables[0];for(ah=0;ah<af.filters_manager.filters.length;ah++){aa=af.filters_manager.filters[ah];am[aa.name]=[aa]}for(ai=1;ai<this.drawables.length;ai++){af=this.drawables[ai];for(ah=0;ah<af.filters_manager.filters.length;ah++){aa=af.filters_manager.filters[ah];if(aa.name in am){am[aa.name].push(aa)}}}this.filters_manager.remove_all();var ac,ae,ag,aj;for(var ak in am){ac=am[ak];if(ac.length===Z){ae=new Q({name:ac[0].name,index:ac[0].index});this.filters_manager.add_filter(ae)}}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 Z=0;Z<this.drawables.length;Z++){this.drawables[Z].filters_manager=this.saved_filters_managers[Z]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var Z=0;Z<this.drawables.length;Z++){drawable=this.drawables[Z];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ad=[];for(var aa=0;aa<this.drawables.length;aa++){ad.push(this.drawables[aa].name)}var ab="Composite Track of "+this.drawables.length+" tracks ("+ad.join(", ")+")";var ac=new g(this.view,this.view,{name:ab,drawables:this.drawables});var Z=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(Z){w.prototype.add_drawable.call(this,Z);this.update_icons()},remove_drawable:function(Z){w.prototype.remove_drawable.call(this,Z);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var Z=o(w.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return Z},request_draw:function(Z,ab){for(var aa=0;aa<this.drawables.length;aa++){this.drawables[aa].request_draw(Z,ab)}}});var X=function(Z){o(Z,{obj_type:"View"});w.call(this,"View",Z.container,Z);this.chrom=null;this.vis_id=Z.vis_id;this.dbkey=Z.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.init();this.canvas_manager=new CanvasManager(this.container.get(0).ownerDocument);this.reset()};_.extend(X.prototype,Backbone.Events);o(X.prototype,w.prototype,{init:function(){this.requested_redraw=false;var ab=this.container,Z=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ab);this.browser_content_div=$("<div/>").addClass("content").css("position","relative").appendTo(ab);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ab);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;k(this.viewport_container,Z);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ac=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){add_datasets(add_datasets_url,add_track_async_url,function(ad){_.each(ad,function(ae){Z.add_drawable(object_from_template(ae,Z,Z))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("href","javascript:void(0);").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var aa=function(ad){if(ad.type==="focusout"||(ad.keyCode||ad.which)===13||(ad.keyCode||ad.which)===27){if((ad.keyCode||ad.which)!==27){Z.go_to($(this).val())}$(this).hide();$(this).val("");Z.location_span.show();Z.chrom_select.show()}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",aa).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("original-title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){Z.location_span.hide();Z.chrom_select.hide();Z.nav_input.val(Z.chrom+":"+Z.low+"-"+Z.high);Z.nav_input.css("display","inline-block");Z.nav_input.select();Z.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){Z.zoom_out();Z.request_redraw()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){Z.zoom_in();Z.request_redraw()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){Z.change_chrom(Z.chrom_select.val())});this.browser_content_div.click(function(ad){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(ad){Z.zoom_in(ad.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(ad,ae){this.current_x=ae.offsetX}).bind("drag",function(ad,af){var ag=af.offsetX-this.current_x;this.current_x=af.offsetX;var ae=Math.round(ag/Z.viewport_container.width()*(Z.max_high-Z.max_low));Z.move_delta(-ae)});this.overview_close.click(function(){Z.reset_overview()});this.viewport_container.bind("draginit",function(ad,ae){if(ad.clientX>Z.viewport_container.width()-16){return false}}).bind("dragstart",function(ad,ae){ae.original_low=Z.low;ae.current_height=ad.clientY;ae.current_x=ae.offsetX}).bind("drag",function(af,ah){var ad=$(this);var ai=ah.offsetX-ah.current_x;var ae=ad.scrollTop()-(af.clientY-ah.current_height);ad.scrollTop(ae);ah.current_height=af.clientY;ah.current_x=ah.offsetX;var ag=Math.round(ai/Z.viewport_container.width()*(Z.high-Z.low));Z.move_delta(ag)}).bind("mousewheel",function(af,ah,ae,ad){if(ae){ae*=50;var ag=Math.round(-ae/Z.viewport_container.width()*(Z.high-Z.low));Z.move_delta(ag)}});this.top_labeltrack.bind("dragstart",function(ad,ae){return $("<div />").css({height:Z.browser_content_div.height()+Z.top_labeltrack.height()+Z.nav_labeltrack.height()+1,top:"0px",position:"absolute","background-color":"#ccf",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(ah,ai){$(ai.proxy).css({left:Math.min(ah.pageX,ai.startX)-Z.container.offset().left,width:Math.abs(ah.pageX-ai.startX)});var ae=Math.min(ah.pageX,ai.startX)-Z.container.offset().left,ad=Math.max(ah.pageX,ai.startX)-Z.container.offset().left,ag=(Z.high-Z.low),af=Z.viewport_container.width();Z.update_location(Math.round(ae/af*ag)+Z.low,Math.round(ad/af*ag)+Z.low)}).bind("dragend",function(ai,aj){var ae=Math.min(ai.pageX,aj.startX),ad=Math.max(ai.pageX,aj.startX),ag=(Z.high-Z.low),af=Z.viewport_container.width(),ah=Z.low;Z.low=Math.round(ae/af*ag)+ah;Z.high=Math.round(ad/af*ag)+ah;$(aj.proxy).remove();Z.request_redraw()});this.add_label_track(new W(this,{content_div:this.top_labeltrack}));this.add_label_track(new W(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){Z.resize_window()},500)});$(document).bind("redraw",function(){Z.redraw()});this.reset();$(window).trigger("resize")},changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(aa,ac,Z,ad){if(this.timer){clearTimeout(this.timer)}if(ad){var ab=this;this.timer=setTimeout(function(){ab.trigger("navigate",aa+":"+ac+"-"+Z)},500)}else{view.trigger("navigate",aa+":"+ac+"-"+Z)}},update_location:function(Z,ab){this.location_span.text(commatize(Z)+" - "+commatize(ab));this.nav_input.val(this.chrom+":"+commatize(Z)+"-"+commatize(ab));var aa=view.chrom_select.val();if(aa!==""){this.trigger_navigate(aa,view.low,view.high,true)}},load_chroms:function(ab){ab.num=u;ab.dbkey=this.dbkey;var Z=this,aa=$.Deferred();$.ajax({url:chrom_url,data:ab,dataType:"json",success:function(ad){if(ad.chrom_info.length===0){alert("Invalid chromosome: "+ab.chrom);return}if(ad.reference){Z.add_label_track(new y(Z))}Z.chrom_data=ad.chrom_info;var ag='<option value="">Select Chrom/Contig</option>';for(var af=0,ac=Z.chrom_data.length;af<ac;af++){var ae=Z.chrom_data[af].chrom;ag+='<option value="'+ae+'">'+ae+"</option>"}if(ad.prev_chroms){ag+='<option value="previous">Previous '+u+"</option>"}if(ad.next_chroms){ag+='<option value="next">Next '+u+"</option>"}Z.chrom_select.html(ag);Z.chrom_start_index=ad.start_index;aa.resolve(ad)},error:function(){alert("Could not load chroms for this dbkey:",Z.dbkey)}});return aa},change_chrom:function(ae,aa,ag){var ab=this;if(!ab.chrom_data){ab.load_chroms_deferred.then(function(){ab.change_chrom(ae,aa,ag)});return}if(!ae||ae==="None"){return}if(ae==="previous"){ab.load_chroms({low:this.chrom_start_index-u});return}if(ae==="next"){ab.load_chroms({low:this.chrom_start_index+u});return}var af=$.grep(ab.chrom_data,function(ah,ai){return ah.chrom===ae})[0];if(af===undefined){ab.load_chroms({chrom:ae},function(){ab.change_chrom(ae,aa,ag)});return}else{if(ae!==ab.chrom){ab.chrom=ae;ab.chrom_select.val(ab.chrom);ab.max_high=af.len-1;ab.reset();ab.request_redraw(true);for(var ad=0,Z=ab.drawables.length;ad<Z;ad++){var ac=ab.drawables[ad];if(ac.init){ac.init()}}if(ab.reference_track){ab.reference_track.init()}}if(aa!==undefined&&ag!==undefined){ab.low=Math.max(aa,0);ab.high=Math.min(ag,ab.max_high)}else{ab.low=0;ab.high=ab.max_high}ab.reset_overview();ab.request_redraw()}},go_to:function(ad){ad=ad.replace(/ |,/g,"");var ah=this,Z,ac,aa=ad.split(":"),af=aa[0],ag=aa[1];if(ag!==undefined){try{var ae=ag.split("-");Z=parseInt(ae[0],10);ac=parseInt(ae[1],10)}catch(ab){return false}}ah.change_chrom(af,Z,ac)},move_fraction:function(ab){var Z=this;var aa=Z.high-Z.low;this.move_delta(ab*aa)},move_delta:function(ac){var Z=this;var ab=Z.high-Z.low;if(Z.low-ac<Z.max_low){Z.low=Z.max_low;Z.high=Z.max_low+ab}else{if(Z.high-ac>Z.max_high){Z.high=Z.max_high;Z.low=Z.max_high-ab}else{Z.high-=ac;Z.low-=ac}}Z.request_redraw();var aa=Z.chrom_select.val();this.trigger_navigate(aa,Z.low,Z.high,true)},add_drawable:function(Z){w.prototype.add_drawable.call(this,Z);Z.init();this.changed();this.update_intro_div()},add_label_track:function(Z){Z.view=this;Z.init();this.label_tracks.push(Z)},remove_drawable:function(ab,aa){w.prototype.remove_drawable.call(this,ab);if(aa){var Z=this;ab.container_div.hide(0,function(){$(this).remove();Z.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ah,Z,ag,ai){var af=this,ae=(ai?[ai]:af.drawables),ab;var aa;for(var ad=0;ad<ae.length;ad++){aa=ae[ad];ab=-1;for(var ac=0;ac<af.tracks_to_be_redrawn.length;ac++){if(af.tracks_to_be_redrawn[ac][0]===aa){ab=ac;break}}if(ab<0){af.tracks_to_be_redrawn.push([aa,Z,ag])}else{af.tracks_to_be_redrawn[ad][1]=Z;af.tracks_to_be_redrawn[ad][2]=ag}}if(!this.requested_redraw){requestAnimationFrame(function(){af._redraw(ah)});this.requested_redraw=true}},_redraw:function(aj){this.requested_redraw=false;var ag=this.low,ac=this.high;if(ag<this.max_low){ag=this.max_low}if(ac>this.max_high){ac=this.max_high}var ai=this.high-this.low;if(this.high!==0&&ai<this.min_separation){ac=ag+this.min_separation}this.low=Math.floor(ag);this.high=Math.ceil(ac);this.update_location(this.low,this.high);this.resolution_b_px=(this.high-this.low)/this.viewport_container.width();this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var Z=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var af=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ak=13;this.overview_box.css({left:Z,width:Math.max(ak,af)}).show();if(af<ak){this.overview_box.css("left",Z-(ak-af)/2)}if(this.overview_highlight){this.overview_highlight.css({left:Z,width:af})}if(!aj){var ab,aa,ah;for(var ad=0,ae=this.tracks_to_be_redrawn.length;ad<ae;ad++){ab=this.tracks_to_be_redrawn[ad][0];aa=this.tracks_to_be_redrawn[ad][1];ah=this.tracks_to_be_redrawn[ad][2];if(ab){ab._draw(aa,ah)}}this.tracks_to_be_redrawn=[];for(ad=0,ae=this.label_tracks.length;ad<ae;ad++){this.label_tracks[ad]._draw()}}},zoom_in:function(aa,ab){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ac=this.high-this.low,ad=ac/2+this.low,Z=(ac/this.zoom_factor)/2;if(aa){ad=aa/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(ad-Z);this.high=Math.round(ad+Z);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var aa=this.high-this.low,ab=aa/2+this.low,Z=(aa*this.zoom_factor)/2;this.low=Math.round(ab-Z);this.high=Math.round(ab+Z);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ab){if(this.overview_drawable){if(this.overview_drawable.dataset_id===ab.dataset_id){return}this.overview_viewport.find(".track").remove()}var aa=ab.copy({content_div:this.overview_viewport}),Z=this;aa.header_div.hide();aa.is_overview=true;Z.overview_drawable=aa;this.overview_drawable.postdraw_actions=function(){Z.overview_highlight.show().height(Z.overview_drawable.content_div.height());Z.overview_viewport.height(Z.overview_drawable.content_div.height()+Z.overview_box.outerHeight());Z.overview_close.show();Z.resize_window()};Z.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=null}});var q=function(ab,ag,ac){this.track=ab;this.name=ag.name;this.params=[];var an=ag.params;for(var ad=0;ad<an.length;ad++){var ai=an[ad],aa=ai.name,am=ai.label,ae=unescape(ai.html),ao=ai.value,ak=ai.type;if(ak==="number"){this.params.push(new e(aa,am,ae,(aa in ac?ac[aa]:ao),ai.min,ai.max))}else{if(ak==="select"){this.params.push(new K(aa,am,ae,(aa in ac?ac[aa]:ao)))}else{console.log("WARNING: unrecognized tool parameter type:",aa,ak)}}}this.parent_div=$("<div/>").addClass("dynamic-tool").hide();this.parent_div.bind("drag",function(aq){aq.stopPropagation()}).click(function(aq){aq.stopPropagation()}).bind("dblclick",function(aq){aq.stopPropagation()});var al=$("<div class='tool-name'>").appendTo(this.parent_div).text(this.name);var aj=this.params;var ah=this;$.each(this.params,function(ar,av){var au=$("<div>").addClass("param-row").appendTo(ah.parent_div);var aq=$("<div>").addClass("param-label").text(av.label).appendTo(au);var at=$("<div/>").addClass("param-input").html(av.html).appendTo(au);at.find(":input").val(av.value);$("<div style='clear: both;'/>").appendTo(au)});this.parent_div.find("input").click(function(){$(this).select()});var ap=$("<div>").addClass("param-row").appendTo(this.parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ap);var Z=$("<input type='submit'>").attr("value","Run on visible region").css("margin-left","3em").appendTo(ap);Z.click(function(){ah.run_on_region()});af.click(function(){ah.run_on_dataset()});if("visible" in ac&&ac.visible){this.parent_div.show()}};o(q.prototype,{update_params:function(){for(var Z=0;Z<this.params.length;Z++){this.params[Z].update_value()}},state_dict:function(){var aa={};for(var Z=0;Z<this.params.length;Z++){aa[this.params[Z].name]=this.params[Z].value}aa.visible=this.parent_div.is(":visible");return aa},get_param_values_dict:function(){var Z={};this.parent_div.find(":input").each(function(){var aa=$(this).attr("name"),ab=$(this).val();Z[aa]=ab});return Z},get_param_values:function(){var Z=[];this.parent_div.find(":input").each(function(){var aa=$(this).attr("name"),ab=$(this).val();if(aa){Z[Z.length]=ab}});return Z},run_on_dataset:function(){var Z=this;Z.run({target_dataset_id:this.track.original_dataset_id,tool_id:Z.name},null,function(aa){show_modal(Z.name+" is Running",Z.name+" is running on the complete dataset. Tool outputs are in dataset's history.",{Close:hide_modal})})},run_on_region:function(){var aa={target_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:this.track.view.high}]},ae=this.track,ab=aa.tool_id+ae.tool_region_and_parameters_str(aa.chrom,aa.low,aa.high),Z;if(ae.container===view){var ad=new M(view,view,{name:this.name});var ac=ae.container.replace_drawable(ae,ad,false);ad.container_div.insertBefore(ae.view.content_div.children()[ac]);ad.add_drawable(ae);ae.container_div.appendTo(ad.content_div);Z=ad}else{Z=ae.container}var af=new ae.constructor(view,Z,{name:ab,hda_ldda:"hda"});af.init_for_tool_data();af.change_mode(ae.mode);af.set_filters_manager(ae.filters_manager.copy(af));af.update_icons();Z.add_drawable(af);af.tiles_div.text("Starting job.");this.update_params();this.run(aa,af,function(ag){af.set_dataset(new Dataset(ag));af.tiles_div.text("Running job.");af.init()})},run:function(Z,ab,ac){Z.inputs=this.get_param_values_dict();var aa=new ServerStateDeferred({ajax_settings:{url:galaxy_paths.get("tool_url"),data:JSON.stringify(Z),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(ad){return ad!=="pending"}});$.when(aa.go()).then(function(ad){if(ad==="no converter"){ab.container_div.addClass("error");ab.content_div.text(G)}else{if(ad.error){ab.container_div.addClass("error");ab.content_div.text(v+ad.message)}else{ac(ad)}}})}});var K=function(aa,Z,ab,ac){this.name=aa;this.label=Z;this.html=$(ab);this.value=ac};o(K.prototype,{update_value:function(){this.value=$(this.html).val()}});var e=function(ab,aa,ad,ae,ac,Z){K.call(this,ab,aa,ad,ae);this.min=ac;this.max=Z};o(e.prototype,K.prototype,{update_value:function(){K.prototype.update_value.call(this);this.value=parseFloat(this.value)}});var f=function(Z){this.manager=null;this.name=Z.name;this.index=Z.index;this.tool_id=Z.tool_id;this.tool_exp_name=Z.tool_exp_name};o(f.prototype,{to_dict:function(){return{name:this.name,index:this.index,tool_id:this.tool_id,tool_exp_name:this.tool_exp_name}}});var Q=function(ah){f.call(this,ah);this.low=("low" in ah?ah.low:-Number.MAX_VALUE);this.high=("high" in ah?ah.high:Number.MAX_VALUE);this.min=("min" in ah?ah.min:Number.MAX_VALUE);this.max=("max" in ah?ah.max:-Number.MAX_VALUE);this.container=null;this.slider=null;this.slider_label=null;var ad=function(ai,aj,ak){ai.click(function(){var ap=aj.text(),an=parseFloat(ak.slider("option","max")),am=(an<=1?4:an<=1000000?an.toString().length:6),ao=false,al=$(this).parents(".slider-row");al.addClass("input");if(ak.slider("option","values")){am=2*am+1;ao=true}aj.text("");$("<input type='text'/>").attr("size",am).attr("maxlength",am).attr("value",ap).appendTo(aj).focus().select().click(function(aq){aq.stopPropagation()}).blur(function(){$(this).remove();aj.text(ap);al.removeClass("input")}).keyup(function(av){if(av.keyCode===27){$(this).trigger("blur")}else{if(av.keyCode===13){var at=ak.slider("option","min"),aq=ak.slider("option","max"),au=function(aw){return(isNaN(aw)||aw>aq||aw<at)},ar=$(this).val();if(!ao){ar=parseFloat(ar);if(au(ar)){alert("Parameter value must be in the range ["+at+"-"+aq+"]");return $(this)}}else{ar=ar.split("-");ar=[parseFloat(ar[0]),parseFloat(ar[1])];if(au(ar[0])||au(ar[1])){alert("Parameter value must be in the range ["+at+"-"+aq+"]");return $(this)}}ak.slider((ao?"values":"value"),ar);al.removeClass("input")}}})})};var aa=this;aa.parent_div=$("<div/>").addClass("filter-row slider-row");var Z=$("<div/>").addClass("elt-label").appendTo(aa.parent_div),af=$("<span/>").addClass("slider-name").text(aa.name+" ").appendTo(Z),ab=$("<span/>").text(this.low+"-"+this.high),ac=$("<span/>").addClass("slider-value").appendTo(Z).append("[").append(ab).append("]");aa.values_span=ab;var ae=$("<div/>").addClass("slider").appendTo(aa.parent_div);aa.control_element=$("<div/>").attr("id",aa.name+"-filter-control").appendTo(ae);aa.control_element.slider({range:true,min:this.min,max:this.max,step:this.get_slider_step(this.min,this.max),values:[this.low,this.high],slide:function(ai,aj){aa.slide(ai,aj)},change:function(ai,aj){aa.control_element.slider("option","slide").call(aa.control_element,ai,aj)}});aa.slider=aa.control_element;aa.slider_label=ab;ad(ac,ab,aa.control_element);var ag=$("<div/>").addClass("display-controls").appendTo(aa.parent_div);this.transparency_icon=create_action_icon("Use filter for data transparency","layer-transparent",function(){if(aa.manager.alpha_filter!==aa){aa.manager.alpha_filter=aa;aa.manager.parent_div.find(".layer-transparent").removeClass("active").hide();aa.transparency_icon.addClass("active").show()}else{aa.manager.alpha_filter=null;aa.transparency_icon.removeClass("active")}aa.manager.track.request_draw(true,true)}).appendTo(ag).hide();this.height_icon=create_action_icon("Use filter for data height","arrow-resize-090",function(){if(aa.manager.height_filter!==aa){aa.manager.height_filter=aa;aa.manager.parent_div.find(".arrow-resize-090").removeClass("active").hide();aa.height_icon.addClass("active").show()}else{aa.manager.height_filter=null;aa.height_icon.removeClass("active")}aa.manager.track.request_draw(true,true)}).appendTo(ag).hide();aa.parent_div.hover(function(){aa.transparency_icon.show();aa.height_icon.show()},function(){if(aa.manager.alpha_filter!==aa){aa.transparency_icon.hide()}if(aa.manager.height_filter!==aa){aa.height_icon.hide()}});$("<div style='clear: both;'/>").appendTo(aa.parent_div)};o(Q.prototype,{to_dict:function(){var Z=f.prototype.to_dict.call(this);return o(Z,{type:"number",min:this.min,max:this.max,low:this.low,high:this.high})},copy:function(){return new Q({name:this.name,index:this.index,tool_id:this.tool_id,tool_exp_name:this.tool_exp_name})},get_slider_step:function(ab,Z){var aa=Z-ab;return(aa<=2?0.01:1)},slide:function(ab,ac){var aa=ac.values;this.values_span.text(aa[0]+"-"+aa[1]);this.low=aa[0];this.high=aa[1];var Z=this;setTimeout(function(){if(aa[0]===Z.low&&aa[1]===Z.high){Z.manager.track.request_draw(true,true)}},25)},applies_to:function(Z){if(Z.length>this.index){return true}return false},_keep_val:function(Z){return(isNaN(Z)||(Z>=this.low&&Z<=this.high))},keep:function(aa){if(!this.applies_to(aa)){return true}var ac=this;var ad=aa[this.index];if(ad instanceof Array){var ab=true;for(var Z=0;Z<ad.length;Z++){if(!this._keep_val(ad[Z])){ab=false;break}}return ab}else{return this._keep_val(aa[this.index])}},update_attrs:function(ac){var Z=false;if(!this.applies_to(ac)){return Z}var aa=ac[this.index];if(!(aa instanceof Array)){aa=[aa]}for(var ab=0;ab<aa.length;ab++){var ad=aa[ab];if(ad<this.min){this.min=Math.floor(ad);Z=true}if(ad>this.max){this.max=Math.ceil(ad);Z=true}}return Z},update_ui_elt:function(){if(this.min<this.max){this.parent_div.show()}else{this.parent_div.hide()}var aa=this.slider.slider("option","min"),Z=this.slider.slider("option","max");if(this.min<aa||this.max>Z){this.slider.slider("option","min",this.min);this.slider.slider("option","max",this.max);this.slider.slider("option","step",this.get_slider_step(this.min,this.max));this.slider.slider("option","values",[this.min,this.max])}}});var V=function(ab,ah){this.track=ab;this.alpha_filter=null;this.height_filter=null;this.filters=[];this.parent_div=$("<div/>").addClass("filters").hide();this.parent_div.bind("drag",function(aj){aj.stopPropagation()}).click(function(aj){aj.stopPropagation()}).bind("dblclick",function(aj){aj.stopPropagation()}).bind("keydown",function(aj){aj.stopPropagation()});if(ah&&"filters" in ah){var Z=("alpha_filter" in ah?ah.alpha_filter:null),ac=("height_filter" in ah?ah.height_filter:null),ae=ah.filters,aa;for(var af=0;af<ae.length;af++){if(ae[af].type==="number"){aa=new Q(ae[af]);this.add_filter(aa);if(aa.name===Z){this.alpha_filter=aa;aa.transparency_icon.addClass("active").show()}if(aa.name===ac){this.height_filter=aa;aa.height_icon.addClass("active").show()}}else{console.log("ERROR: unsupported filter: ",name,type)}}if("visible" in ah&&ah.visible){this.parent_div.show()}}if(this.filters.length!==0){var ai=$("<div/>").addClass("param-row").appendTo(this.parent_div);var ag=$("<input type='submit'/>").attr("value","Run on complete dataset").appendTo(ai);var ad=this;ag.click(function(){ad.run_on_dataset()})}};o(V.prototype,{show:function(){this.parent_div.show()},hide:function(){this.parent_div.hide()},toggle:function(){this.parent_div.toggle()},visible:function(){return this.parent_div.is(":visible")},to_dict:function(){var ac={},ab=[],aa;for(var Z=0;Z<this.filters.length;Z++){aa=this.filters[Z];ab.push(aa.to_dict())}ac.filters=ab;ac.alpha_filter=(this.alpha_filter?this.alpha_filter.name:null);ac.height_filter=(this.height_filter?this.height_filter.name:null);ac.visible=this.parent_div.is(":visible");return ac},copy:function(aa){var ab=new V(aa);for(var Z=0;Z<this.filters.length;Z++){ab.add_filter(this.filters[Z].copy())}return ab},add_filter:function(Z){Z.manager=this;this.parent_div.append(Z.parent_div);this.filters.push(Z)},remove_all:function(){this.filters=[];this.parent_div.children().remove()},init_filters:function(){for(var Z=0;Z<this.filters.length;Z++){var aa=this.filters[Z];aa.update_ui_elt()}},clear_filters:function(){for(var Z=0;Z<this.filters.length;Z++){var aa=this.filters[Z];aa.slider.slider("option","values",[aa.min,aa.max])}this.alpha_filter=null;this.height_filter=null;this.parent_div.find(".icon-button").hide()},run_on_dataset:function(){var af=function(aj,ah,ai){if(!(ah in aj)){aj[ah]=ai}return aj[ah]};var ae={},ag,Z;for(var ad=0;ad<this.filters.length;ad++){ag=this.filters[ad];if(ag.tool_id){if(ag.min!==ag.low){Z=af(ae,ag.tool_id,[]);Z[Z.length]=ag.tool_exp_name+" >= "+ag.low}if(ag.max!==ag.high){Z=af(ae,ag.tool_id,[]);Z[Z.length]=ag.tool_exp_name+" <= "+ag.high}}}var aa=[];for(var ac in ae){aa[aa.length]=[ac,ae[ac]]}(function ab(an,ak){var ai=ak[0],aj=ai[0],am=ai[1],al="("+am.join(") and (")+")",ah={cond:al,input:an,target_dataset_id:an,tool_id:aj},ak=ak.slice(1);$.getJSON(run_tool_url,ah,function(ao){if(ao.error){show_modal("Filter Dataset","Error running tool "+aj,{Close:hide_modal})}else{if(ak.length===0){show_modal("Filtering Dataset","Filter(s) are running on the complete dataset. Outputs are in dataset's history.",{Close:hide_modal})}else{ab(ao.dataset_id,ak)}}})})(this.track.dataset_id,aa)}});var z=function(Z,aa){I.Scaler.call(this,aa);this.filter=Z};z.prototype.gen_val=function(Z){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(Z[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var C=function(Z){this.track=Z.track;this.params=Z.params;this.values={};this.restore_values((Z.saved_values?Z.saved_values:{}));this.onchange=Z.onchange};o(C.prototype,{restore_values:function(Z){var aa=this;$.each(this.params,function(ab,ac){if(Z[ac.key]!==undefined){aa.values[ac.key]=Z[ac.key]}else{aa.values[ac.key]=ac.default_value}})},build_form:function(){var ac=this;var Z=$("<div />");var ab;function aa(ah,ad){for(var al=0;al<ah.length;al++){ab=ah[al];if(ab.hidden){continue}var af="param_"+al;var ap=ac.values[ab.key];var ar=$("<div class='form-row' />").appendTo(ad);ar.append($("<label />").attr("for",af).text(ab.label+":"));if(ab.type==="bool"){ar.append($('<input type="checkbox" />').attr("id",af).attr("name",af).attr("checked",ap))}else{if(ab.type==="text"){ar.append($('<input type="text"/>').attr("id",af).val(ap).click(function(){$(this).select()}))}else{if(ab.type==="select"){var an=$("<select />").attr("id",af);for(var aj=0;aj<ab.options.length;aj++){$("<option/>").text(ab.options[aj].label).attr("value",ab.options[aj].value).appendTo(an)}an.val(ap);ar.append(an)}else{if(ab.type==="color"){var aq=$("<div/>").appendTo(ar),am=$("<input />").attr("id",af).attr("name",af).val(ap).css("float","left").appendTo(aq).click(function(au){$(".bs-tooltip").removeClass("in");var at=$(this).siblings(".bs-tooltip").addClass("in");at.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-($(at).height()/2)+($(this).height()/2)}).show();at.click(function(av){av.stopPropagation()});$(document).bind("click.color-picker",function(){at.hide();$(document).unbind("click.color-picker")});au.stopPropagation()}),ak=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(aq).attr("title","Set new random color").tooltip(),ao=$("<div class='bs-tooltip right' style='position: absolute;' />").appendTo(aq).hide(),ag=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(ao),ae=$("<div class='tooltip-arrow'></div>").appendTo(ao),ai=$.farbtastic(ag,{width:100,height:100,callback:am,color:ap});aq.append($("<div/>").css("clear","both"));(function(at){ak.click(function(){at.setColor(get_random_color())})})(ai)}else{ar.append($("<input />").attr("id",af).attr("name",af).val(ap))}}}}if(ab.help){ar.append($("<div class='help'/>").text(ab.help))}}}aa(this.params,Z);return Z},update_from_form:function(Z){var ab=this;var aa=false;$.each(this.params,function(ac,ae){if(!ae.hidden){var af="param_"+ac;var ad=Z.find("#"+af).val();if(ae.type==="float"){ad=parseFloat(ad)}else{if(ae.type==="int"){ad=parseInt(ad)}else{if(ae.type==="bool"){ad=Z.find("#"+af).is(":checked")}}}if(ad!==ab.values[ae.key]){ab.values[ae.key]=ad;aa=true}}});if(aa){this.onchange();this.track.changed()}}});var b=function(Z,ad,ab,aa,ac){this.track=Z;this.region=ad;this.low=ad.get("start");this.high=ad.get("end");this.resolution=ab;this.html_elt=$("<div class='track-tile'/>").append(aa).height($(aa).attr("height"));this.data=ac;this.stale=false};b.prototype.predisplay_actions=function(){};var j=function(Z,ae,ab,aa,ac,ad){b.call(this,Z,ae,ab,aa,ac);this.max_val=ad};o(j.prototype,b.prototype);var L=function(ac,ak,ad,ab,af,am,ag,an,aa,aj){b.call(this,ac,ak,ad,ab,af);this.mode=ag;this.all_slotted=aa;this.feature_mapper=aj;this.has_icons=false;if(an){this.has_icons=true;var ah=this;ab=this.html_elt.children()[0],message_div=$("<div/>").addClass("tile-message").css({height:A-1,width:ab.width}).prependTo(this.html_elt);var ai=new GenomeRegion({chrom:ac.view.chrom,start:this.low,end:this.high}),al=af.length,ae=$("<a href='javascript:void(0);'/>").addClass("icon more-down").attr("title","For speed, only the first "+al+" features in this region were obtained from server. Click to get more data including depth").tooltip().appendTo(message_div),Z=$("<a href='javascript:void(0);'/>").addClass("icon more-across").attr("title","For speed, only the first "+al+" features in this region were obtained from server. Click to get more data excluding depth").tooltip().appendTo(message_div);ae.click(function(){ah.stale=true;ac.data_manager.get_more_data(ai,ac.mode,ah.resolution,{},ac.data_manager.DEEP_DATA_REQ);$(".bs-tooltip").hide();ac.request_draw(true)}).dblclick(function(ao){ao.stopPropagation()});Z.click(function(){ah.stale=true;ac.data_manager.get_more_data(ai,ac.mode,ah.resolution,{},ac.data_manager.BROAD_DATA_REQ);$(".bs-tooltip").hide();ac.request_draw(true)}).dblclick(function(ao){ao.stopPropagation()})}};o(L.prototype,b.prototype);L.prototype.predisplay_actions=function(){var aa=this,Z={};if(aa.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(al){if(!this.hovered){return}var ag=$(this).offset(),ak=al.pageX-ag.left,aj=al.pageY-ag.top,ap=aa.feature_mapper.get_feature_data(ak,aj),ah=(ap?ap[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!ah||$(this).attr("id")!==ah.toString()){$(this).remove()}});if(ap){var ac=Z[ah];if(!ac){var ah=ap[0],am={name:ap[3],start:ap[1],end:ap[2],strand:ap[4]},af=aa.track.filters_manager.filters,ae;for(var ai=0;ai<af.length;ai++){ae=af[ai];am[ae.name]=ap[ae.index]}var ac=$("<div/>").attr("id",ah).addClass("feature-popup"),aq=$("<table/>"),ao,an,ar;for(ao in am){an=am[ao];ar=$("<tr/>").appendTo(aq);$("<th/>").appendTo(ar).text(ao);$("<td/>").attr("align","left").appendTo(ar).text(typeof(an)==="number"?U(an,2):an)}ac.append($("<div class='feature-popup-inner'>").append(aq));Z[ah]=ac}ac.appendTo($(this).parents(".track-content").children(".overlay"));var ad=ak+parseInt(aa.html_elt.css("left"))-ac.width()/2,ab=aj+parseInt(aa.html_elt.css("top"))+7;ac.css("left",ad+"px").css("top",ab+"px")}else{if(!al.isPropagationStopped()){al.stopPropagation();$(this).siblings().each(function(){$(this).trigger(al)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var h=function(ab,aa,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ab,aa,ad);this.data_url=("data_url" in ad?ad.data_url:default_data_url);this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:H);this.dataset_check_url=("converted_datasets_state_url" in ad?ad.converted_datasets_state_url:converted_datasets_state_url);var Z=this,ac=new Dataset({id:ad.dataset_id,hda_ldda:ad.hda_ldda});this.data_manager=("data_manager" in ad?ad.data_manager:new GenomeDataManager({dataset:ac,data_url:Z.data_url,dataset_state_url:Z.dataset_check_url,data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=0;this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(h.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"overview-icon",on_click_fn:function(Z){Z.view.set_overview(Z)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(Z){if(Z.filters_manager.visible()){Z.filters_manager.clear_filters()}else{Z.filters_manager.init_filters()}Z.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(Z){Z.dynamic_tool_div.toggle();if(Z.dynamic_tool_div.is(":visible")){Z.set_name(Z.name+Z.tool_region_and_parameters_str())}else{Z.revert_name()}$(".bs-tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(Z){var ac='<strong>Tool</strong>: <%= track.tool.name %><br/><strong>Dataset</strong>: <%= track.name %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ab=_.template(ac,{track:Z});var ae=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},aa=function(){var ag=$('select[name="regions"] option:selected').val(),ai,af=new GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),ah=_.map($(".bookmark"),function(aj){return new GenomeRegion({from_str:$(aj).children(".position").text()})});if(ag==="cur"){ai=[af]}else{if(ag==="bookmarks"){ai=ah}else{ai=[af].concat(ah)}}hide_modal();window.location.href=galaxy_paths.get("sweepster_url")+"?"+$.param({dataset_id:Z.dataset_id,hda_ldda:Z.hda_ldda,regions:JSON.stringify(new Backbone.Collection(ai).toJSON())})},ad=function(af){if((af.keyCode||af.which)===27){ae()}else{if((af.keyCode||af.which)===13){aa()}}};show_modal("Visualize tool parameter space and output from different parameter settings?",ab,{No:ae,Yes:aa})}},p.prototype.action_icons_def[2]],can_draw:function(){if(this.dataset_id&&p.prototype.can_draw.call(this)){return true}return false},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id).css("position","relative")},build_header_div:function(){var Z=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(Z)}this.name_div=$("<div/>").addClass("track-name").appendTo(Z).text(this.name).attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return Z},on_resize:function(){},add_resize_handle:function(){var Z=this;var ac=false;var ab=false;var aa=$("<div class='track-resize'>");$(Z.container_div).hover(function(){if(Z.content_visible){ac=true;aa.show()}},function(){ac=false;if(!ab){aa.hide()}});aa.hide().bind("dragstart",function(ad,ae){ab=true;ae.original_height=$(Z.content_div).height()}).bind("drag",function(ae,af){var ad=Math.min(Math.max(af.original_height+af.deltaY,Z.min_height_px),Z.max_height_px);$(Z.tiles_div).css("height",ad);Z.visible_height_px=(Z.max_height_px===ad?0:ad);Z.on_resize()}).bind("dragend",function(ad,ae){Z.tile_cache.clear();ab=false;if(!ac){aa.hide()}Z.config.values.height=Z.visible_height_px;Z.changed()}).appendTo(Z.container_div)},set_display_modes:function(ac,af){this.display_modes=ac;this.mode=(af?af:(this.config&&this.config.values.mode?this.config.values.mode:this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var aa=this,ad={};for(var ab=0,Z=aa.display_modes.length;ab<Z;ab++){var ae=aa.display_modes[ab];ad[ae]=function(ag){return function(){aa.change_mode(ag);aa.icons_div.show();aa.container_div.mouseleave(function(){aa.icons_div.hide()})}}(ae)}make_popupmenu(this.action_icons.mode_icon,ad)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof W){return"LabelTrack"}else{if(this instanceof y){return"ReferenceTrack"}else{if(this instanceof i){return"LineTrack"}else{if(this instanceof R){return"ReadTrack"}else{if(this instanceof O){return"VcfTrack"}else{if(this instanceof g){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},init:function(){var aa=this;aa.enabled=false;aa.tile_cache.clear();aa.data_manager.clear();aa.content_div.css("height","auto");aa.tiles_div.children().remove();aa.container_div.removeClass("nodata error pending");if(!aa.dataset_id){return}var Z=$.Deferred();$.getJSON(this.dataset_check_url,{hda_ldda:aa.hda_ldda,dataset_id:aa.dataset_id,chrom:aa.view.chrom},function(ab){if(!ab||ab==="error"||ab.kind==="error"){aa.container_div.addClass("error");aa.tiles_div.text(n);if(ab.message){var ac=$(" <a href='javascript:void(0);'></a>").text("View error").click(function(){show_modal("Trackster Error","<pre>"+ab.message+"</pre>",{Close:hide_modal})});aa.tiles_div.append(ac)}}else{if(ab==="no converter"){aa.container_div.addClass("error");aa.tiles_div.text(G)}else{if(ab==="no data"||(ab.data!==undefined&&(ab.data===null||ab.data.length===0))){aa.container_div.addClass("nodata");aa.tiles_div.text(B)}else{if(ab==="pending"){aa.container_div.addClass("pending");aa.tiles_div.html(t);setTimeout(function(){aa.init()},aa.data_query_wait)}else{if(ab==="data"||ab.status==="data"){if(ab.valid_chroms){aa.valid_chroms=ab.valid_chroms;aa.update_icons()}aa.tiles_div.text(T);if(aa.view.chrom){aa.tiles_div.text("");aa.tiles_div.css("height",aa.visible_height_px+"px");aa.enabled=true;$.when(aa.predraw_init()).done(function(){Z.resolve();aa.container_div.removeClass("nodata error pending");aa.request_draw()})}else{Z.resolve()}}}}}}});this.update_icons();return Z},predraw_init:function(){}});var J=function(ab,aa,ac){h.call(this,ab,aa,ac);var Z=this;l(Z.container_div,Z.drag_handle_class,".group",Z);this.filters_manager=new V(this,("filters" in ac?ac.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=("tool" in ac&&ac.tool?new q(this,ac.tool,ac.tool_state):null);this.tile_cache=new Cache(N);if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){this.dynamic_tool_div=this.tool.parent_div;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(ac.mode){this.change_mode(ac.mode)}};o(J.prototype,p.prototype,h.prototype,{action_icons_def:h.prototype.action_icons_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(Z){$(".bs-tooltip").remove();Z.slotters[Z.view.resolution_px_b].max_rows*=2;Z.request_draw(true)},hide:true}]),copy:function(Z){var aa=this.to_dict();o(aa,{data_manager:this.data_manager});var ab=new this.constructor(this.view,Z,aa);ab.change_mode(this.mode);ab.enabled=this.enabled;return ab},set_filters_manager:function(Z){this.filters_manager=Z;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),name:this.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(aa){var Z=this;Z.mode=aa;Z.config.values.mode=aa;Z.tile_cache.clear();Z.request_draw();this.action_icons.mode_icon.attr("title","Set display mode (now: "+Z.mode+")");return Z},update_icons:function(){var Z=this;if(Z.filters_available){Z.action_icons.filters_icon.show()}else{Z.action_icons.filters_icon.hide()}if(Z.tool){Z.action_icons.tools_icon.show();Z.action_icons.param_space_viz_icon.show()}else{Z.action_icons.tools_icon.hide();Z.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(aa,ab,Z){return aa+"_"+ab+"_"+Z},request_draw:function(aa,Z){this.view.request_redraw(false,aa,Z,this)},before_draw:function(){},_draw:function(aa,ak){if(!this.can_draw()){return}var ai=this.view.low,ae=this.view.high,ag=ae-ai,ab=this.view.container.width(),am=this.view.resolution_px_b,ad=this.view.resolution_b_px;if(this.is_overview){ai=this.view.max_low;ae=this.view.max_high;ad=(view.max_high-view.max_low)/ab;am=1/ad}this.before_draw();this.tiles_div.children().addClass("remove");var Z=Math.floor(ai/(ad*P)),ah=true,al=[],af=function(an){return(an&&"track" in an)};while((Z*P*ad)<ae){var aj=this.draw_helper(aa,ab,Z,ad,this.tiles_div,am);if(af(aj)){al.push(aj)}else{ah=false}Z+=1}if(!ak){this.tiles_div.children(".remove").removeClass("remove").remove()}var ac=this;if(ah){this.tiles_div.children(".remove").remove();ac.postdraw_actions(al,ab,am,ak)}},postdraw_actions:function(ab,ac,ae,Z){var ad=false;for(var aa=0;aa<ab.length;aa++){if(ab[aa].has_icons){ad=true;break}}if(ad){for(var aa=0;aa<ab.length;aa++){tile=ab[aa];if(!tile.has_icons){tile.html_elt.css("padding-top",A)}}}},draw_helper:function(Z,al,aq,ao,ae,af,am){var ak=this,au=this._gen_tile_cache_key(al,af,aq),ac=this._get_tile_bounds(aq,ao);if(!am){am={}}var at=(Z?undefined:ak.tile_cache.get_elt(au));if(at){ak.show_tile(at,ae,af);return at}var ai=true;var ap=ak.data_manager.get_data(ac,ak.mode,ao,ak.data_url_extra_params);if(is_deferred(ap)){ai=false}var ag;if(view.reference_track&&af>view.canvas_manager.char_width_px){ag=view.reference_track.data_manager.get_data(ac,ak.mode,ao,view.reference_track.data_url_extra_params);if(is_deferred(ag)){ai=false}}if(ai){o(ap,am.more_tile_data);var ah=ak.mode;if(ah==="Auto"){ah=ak.get_mode(ap);ak.update_auto_mode(ah)}var ab=ak.view.canvas_manager.new_canvas(),ar=ac.get("start"),aa=ac.get("end"),al=Math.ceil((aa-ar)*af)+ak.left_offset,aj=ak.get_canvas_height(ap,ah,af,al);ab.width=al;ab.height=aj;var an=ab.getContext("2d");an.translate(this.left_offset,0);var at=ak.draw_tile(ap,an,ah,ao,ac,af,ag);if(at!==undefined){ak.tile_cache.set_elt(au,at);ak.show_tile(at,ae,af)}return at}var ad=$.Deferred();$.when(ap,ag).then(function(){view.request_redraw(false,false,false,ak);ad.resolve()});return ad},get_canvas_height:function(Z,ab,ac,aa){return this.visible_height_px},draw_tile:function(Z,aa,ae,ac,ad,af,ab){console.log("Warning: TiledTrack.draw_tile() not implemented.")},show_tile:function(ab,ad,ae){var aa=this,Z=ab.html_elt;ab.predisplay_actions();var ac=(ab.low-(this.is_overview?this.view.max_low:this.view.low))*ae;if(this.left_offset){ac-=this.left_offset}Z.css({position:"absolute",top:0,left:ac});if(Z.hasClass("remove")){Z.removeClass("remove")}else{ad.append(Z)}aa.after_show_tile(ab)},after_show_tile:function(Z){this.max_height_px=Math.max(this.max_height_px,Z.html_elt.height());Z.html_elt.parent().children().css("height",this.max_height_px+"px");var aa=this.max_height_px;if(this.visible_height_px!==0){aa=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",aa+"px")},_get_tile_bounds:function(Z,aa){var ac=Math.floor(Z*P*aa),ad=Math.ceil(P*aa),ab=(ac+ad<=this.view.max_high?ac+ad:this.view.max_high);return new GenomeRegion({chrom:this.view.chrom,start:ac,end:ab})},tool_region_and_parameters_str:function(ab,Z,ac){var aa=this,ad=(ab!==undefined&&Z!==undefined&&ac!==undefined?ab+":"+Z+"-"+ac:"all");return" - region=["+ad+"], parameters=["+aa.tool.get_param_values().join(", ")+"]"},data_and_mode_compatible:function(Z,aa){return true},can_subset:function(Z){return false},init_for_tool_data:function(){this.data_manager.set("data_url",raw_data_url);this.data_query_wait=1000;this.dataset_check_url=dataset_state_url;this.normal_postdraw_actions=this.postdraw_actions;this.postdraw_actions=function(ab,ac,ae,Z){var aa=this;aa.normal_postdraw_actions(ab,ac,ae,Z);aa.dataset_state_url=converted_datasets_state_url;aa.data_query_wait=H;var ad=new ServerStateDeferred({url:aa.dataset_state_url,url_params:{dataset_id:aa.dataset_id,hda_ldda:aa.hda_ldda},interval:aa.data_query_wait,success_fn:function(af){return af!=="pending"}});$.when(ad.go()).then(function(){aa.data_manager.set("data_url",default_data_url)});aa.postdraw_actions=aa.normal_postdraw_actions}}});var W=function(aa,Z){var ab={resize:false};h.call(this,aa,Z,ab);this.container_div.addClass("label-track")};o(W.prototype,h.prototype,{build_header_div:function(){},init:function(){this.enabled=true},_draw:function(){var ab=this.view,ac=ab.high-ab.low,af=Math.floor(Math.pow(10,Math.floor(Math.log(ac)/Math.log(10)))),Z=Math.floor(ab.low/af)*af,ad=this.view.container.width(),aa=$("<div style='position: relative; height: 1.3em;'></div>");while(Z<ab.high){var ae=(Z-ab.low)/ac*ad;aa.append($("<div class='label'>"+commatize(Z)+"</div>").css({position:"absolute",left:ae-1}));Z+=af}this.content_div.children(":first").remove();this.content_div.append(aa)}});var g=function(aa,Z,ad){J.call(this,aa,Z,ad);this.drawables=[];this.left_offset=0;if("drawables" in ad){var ac;for(var ab=0;ab<ad.drawables.length;ab++){ac=ad.drawables[ab];this.drawables[ab]=object_from_template(ac,aa,null);if(ac.left_offset>this.left_offset){this.left_offset=ac.left_offset}}this.enabled=true}if(this.drawables.length!==0){this.set_display_modes(this.drawables[0].display_modes,this.drawables[0].mode)}this.update_icons();this.obj_type="CompositeTrack"};o(g.prototype,J.prototype,{action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.show_group()}}].concat(J.prototype.action_icons_def),to_dict:w.prototype.to_dict,add_drawable:w.prototype.add_drawable,unpack_drawables:w.prototype.unpack_drawables,change_mode:function(Z){J.prototype.change_mode.call(this,Z);for(var aa=0;aa<this.drawables.length;aa++){this.drawables[aa].change_mode(Z)}},init:function(){var ab=[];for(var aa=0;aa<this.drawables.length;aa++){ab.push(this.drawables[aa].init())}var Z=this;$.when.apply($,ab).then(function(){Z.enabled=true;Z.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,draw_helper:function(aa,ap,aw,at,ah,aj,aq){var ao=this,aA=this._gen_tile_cache_key(ap,aj,aw),ae=this._get_tile_bounds(aw,at);if(!aq){aq={}}var az=(aa?undefined:ao.tile_cache.get_elt(aA));if(az){ao.show_tile(az,ah,aj);return az}var ai=[],ao,am=true,au,ak;for(var av=0;av<this.drawables.length;av++){ao=this.drawables[av];au=ao.data_manager.get_data(ae,ao.mode,at,ao.data_url_extra_params);if(is_deferred(au)){am=false}ai.push(au);ak=null;if(view.reference_track&&aj>view.canvas_manager.char_width_px){ak=view.reference_track.data_manager.get_data(ae,ao.mode,at,view.reference_track.data_url_extra_params);if(is_deferred(ak)){am=false}}ai.push(ak)}if(am){o(au,aq.more_tile_data);this.tile_predraw_init();var ad=ao.view.canvas_manager.new_canvas(),af=ao._get_tile_bounds(aw,at),ax=ae.get("start"),ab=ae.get("end"),ay=0,ap=Math.ceil((ab-ax)*aj)+this.left_offset,an=0,ac=[],av;var Z=0;for(av=0;av<this.drawables.length;av++,ay+=2){ao=this.drawables[av];au=ai[ay];var al=ao.mode;if(al==="Auto"){al=ao.get_mode(au);ao.update_auto_mode(al)}ac.push(al);Z=ao.get_canvas_height(au,al,aj,ap);if(Z>an){an=Z}}ad.width=ap;ad.height=(aq.height?aq.height:an);ay=0;var ar=ad.getContext("2d");ar.translate(this.left_offset,0);ar.globalAlpha=0.5;ar.globalCompositeOperation="source-over";for(av=0;av<this.drawables.length;av++,ay+=2){ao=this.drawables[av];au=ai[ay];ak=ai[ay+1];az=ao.draw_tile(au,ar,ac[av],at,ae,aj,ak)}this.tile_cache.set_elt(aA,az);this.show_tile(az,ah,aj);return az}var ag=$.Deferred(),ao=this;$.when.apply($,ai).then(function(){view.request_redraw(false,false,false,ao);ag.resolve()});return ag},show_group:function(){var ac=new M(this.view,this.container,{name:this.name}),Z;for(var ab=0;ab<this.drawables.length;ab++){Z=this.drawables[ab];Z.update_icons();ac.add_drawable(Z);Z.container=ac;ac.content_div.append(Z.container_div)}var aa=this.container.replace_drawable(this,ac,true);ac.request_draw()},tile_predraw_init:function(){var ac=Number.MAX_VALUE,Z=-ac,aa;for(var ab=0;ab<this.drawables.length;ab++){aa=this.drawables[ab];if(aa instanceof i){if(aa.prefs.min_value<ac){ac=aa.prefs.min_value}if(aa.prefs.max_value>Z){Z=aa.prefs.max_value}}}for(var ab=0;ab<this.drawables.length;ab++){aa=this.drawables[ab];aa.prefs.min_value=ac;aa.prefs.max_value=Z}},postdraw_actions:function(ab,ae,ag,aa){J.prototype.postdraw_actions.call(this,ab,ae,ag,aa);var ad=-1;for(var ac=0;ac<ab.length;ac++){var Z=ab[ac].html_elt.find("canvas").height();if(Z>ad){ad=Z}}for(var ac=0;ac<ab.length;ac++){var af=ab[ac];if(af.html_elt.find("canvas").height()!==ad){this.draw_helper(true,ae,af.index,af.resolution,af.html_elt.parent(),ag,{height:ad});af.html_elt.remove()}}}});var y=function(Z){J.call(this,Z,{content_div:Z.top_labeltrack},{resize:false});Z.reference_track=this;this.left_offset=200;this.visible_height_px=12;this.container_div.addClass("reference-track");this.content_div.css("background","none");this.content_div.css("min-height","0px");this.content_div.css("border","none");this.data_url=reference_url;this.data_url_extra_params={dbkey:Z.dbkey};this.data_manager=new ReferenceTrackDataManager({data_url:reference_url});this.hide_contents()};o(y.prototype,p.prototype,J.prototype,{build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},can_draw:p.prototype.can_draw,draw_helper:function(ad,ab,Z,aa,ae,af,ac){if(af>this.view.canvas_manager.char_width_px){return J.prototype.draw_helper.call(this,ad,ab,Z,aa,ae,af,ac)}else{this.hide_contents();return null}},draw_tile:function(ah,ai,ad,ac,af,aj){var ab=this;if(aj>this.view.canvas_manager.char_width_px){if(ah.data===null){this.hide_contents();return}var aa=ai.canvas;ai.font=ai.canvas.manager.default_font;ai.textAlign="center";ah=ah.data;for(var ae=0,ag=ah.length;ae<ag;ae++){var Z=Math.floor(ae*aj);ai.fillText(ah[ae],Z,10)}this.show_contents();return new b(ab,af,ac,aa,ah)}this.hide_contents()}});var i=function(ab,aa,ac){var Z=this;this.display_modes=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";J.call(this,ab,aa,ac);this.hda_ldda=ac.hda_ldda;this.dataset_id=ac.dataset_id;this.original_dataset_id=this.dataset_id;this.left_offset=0;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"color",label:"Color",type:"color",default_value:get_random_color()},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:32,hidden:true}],saved_values:ac.prefs,onchange:function(){Z.set_name(Z.prefs.name);Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.set_min_value(Z.prefs.min_value);Z.set_max_value(Z.prefs.max_value)}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.vertical_range=this.config.values.max_value-this.config.values.min_value};o(i.prototype,p.prototype,J.prototype,{on_resize:function(){this.request_draw(true)},set_min_value:function(Z){this.prefs.min_value=Z;$("#linetrack_"+this.dataset_id+"_minval").text(this.prefs.min_value);this.tile_cache.clear();this.request_draw()},set_max_value:function(Z){this.prefs.max_value=Z;$("#linetrack_"+this.dataset_id+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.request_draw()},predraw_init:function(){var Z=this;Z.vertical_range=undefined;return $.getJSON(Z.data_url,{stats:true,chrom:Z.view.chrom,low:0,high:Z.view.max_high,hda_ldda:Z.hda_ldda,dataset_id:Z.dataset_id},function(aa){Z.container_div.addClass("line-track");var ad=aa.data;if(isNaN(parseFloat(Z.prefs.min_value))||isNaN(parseFloat(Z.prefs.max_value))){var ab=ad.min,af=ad.max;ab=Math.floor(Math.min(0,Math.max(ab,ad.mean-2*ad.sd)));af=Math.ceil(Math.max(0,Math.min(af,ad.mean+2*ad.sd)));Z.prefs.min_value=ab;Z.prefs.max_value=af;$("#track_"+Z.dataset_id+"_minval").val(Z.prefs.min_value);$("#track_"+Z.dataset_id+"_maxval").val(Z.prefs.max_value)}Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.total_frequency=ad.total_frequency;Z.container_div.find(".yaxislabel").remove();var ae=$("<div/>").text(U(Z.prefs.min_value,3)).make_text_editable({num_cols:6,on_finish:function(ag){$(".bs-tooltip").remove();var ag=parseFloat(ag);if(!isNaN(ag)){Z.set_min_value(ag)}},help_text:"Set min value"}).addClass("yaxislabel bottom").attr("id","linetrack_"+Z.dataset_id+"_minval").prependTo(Z.container_div),ac=$("<div/>").text(U(Z.prefs.max_value,3)).make_text_editable({num_cols:6,on_finish:function(ag){$(".bs-tooltip").remove();var ag=parseFloat(ag);if(!isNaN(ag)){Z.set_max_value(ag)}},help_text:"Set max value"}).addClass("yaxislabel top").attr("id","linetrack_"+Z.dataset_id+"_maxval").prependTo(Z.container_div)})},draw_tile:function(ai,ag,ab,aa,ad,ah){var Z=ag.canvas,ac=ad.get("start"),af=ad.get("end"),ae=new I.LinePainter(ai.data,ac,af,this.prefs,ab);ae.draw(ag,Z.width,Z.height,ah);return new b(this,ad,aa,Z,ai.data)},can_subset:function(Z){return false}});var r=function(ab,aa,ac){var Z=this;this.display_modes=["Heatmap"];this.mode="Heatmap";J.call(this,ab,aa,ac);this.hda_ldda=ac.hda_ldda;this.dataset_id=ac.dataset_id;this.original_dataset_id=this.dataset_id;this.left_offset=0;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"pos_color",label:"Positive Color",type:"color",default_value:"4169E1"},{key:"negative_color",label:"Negative Color",type:"color",default_value:"FF8C00"},{key:"min_value",label:"Min Value",type:"float",default_value:0},{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:ac.prefs,onchange:function(){Z.set_name(Z.prefs.name);Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.set_min_value(Z.prefs.min_value);Z.set_max_value(Z.prefs.max_value)}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.vertical_range=this.config.values.max_value-this.config.values.min_value};o(r.prototype,p.prototype,J.prototype,{on_resize:function(){this.request_draw(true)},set_min_value:function(Z){this.prefs.min_value=Z;this.tile_cache.clear();this.request_draw()},set_max_value:function(Z){this.prefs.max_value=Z;this.tile_cache.clear();this.request_draw()},draw_tile:function(aj,ah,ae,ac,aa,ai){var ab=ah.canvas,Z=this._get_tile_bounds(aa,ac),ad=Z[0],ag=Z[1],af=new I.DiagonalHeatmapPainter(aj.data,ad,ag,this.prefs,ae);af.draw(ah,ab.width,ab.height,ai);return new b(this,aa,ac,ab,aj.data)}});var c=function(ac,ab,ae){var aa=this;this.display_modes=["Auto","Coverage","Dense","Squish","Pack"];J.call(this,ac,ab,ae);var ad=get_random_color(),Z=get_random_color([ad,"#ffffff"]);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block color",type:"color",default_value:ad},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:Z},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"histogram_max",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:this.visible_height_px,hidden:true}],saved_values:ae.prefs,onchange:function(){aa.set_name(aa.prefs.name);aa.tile_cache.clear();aa.set_painter_from_config();aa.request_draw()}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.container_div.addClass("feature-track");this.hda_ldda=ae.hda_ldda;this.dataset_id=ae.dataset_id;this.original_dataset_id=ae.dataset_id;this.show_labels_scale=0.001;this.showing_details=false;this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,J.prototype,{set_dataset:function(Z){this.dataset_id=Z.get("id");this.hda_ldda=Z.get("hda_ldda");this.data_manager.set("dataset",Z)},set_painter_from_config:function(){if(this.config.values.connector_style==="arcs"){this.painter=I.ArcLinkedFeaturePainter}else{this.painter=I.LinkedFeaturePainter}},before_draw:function(){this.max_height_px=0},postdraw_actions:function(ao,aj,ae,ad){J.prototype.postdraw_actions.call(this,ao,ad);var ai=this,al;if(ai.mode==="Coverage"){var aa=-1;for(al=0;al<ao.length;al++){var ak=ao[al].max_val;if(ak>aa){aa=ak}}for(al=0;al<ao.length;al++){var aq=ao[al];if(aq.max_val!==aa){aq.html_elt.remove();ai.draw_helper(true,aj,aq.index,aq.resolution,aq.html_elt.parent(),ae,{more_tile_data:{max:aa}})}}}if(ai.filters_manager){var af=ai.filters_manager.filters;for(var an=0;an<af.length;an++){af[an].update_ui_elt()}var ap=false,Z,ag;for(al=0;al<ao.length;al++){if(ao[al].data.length){Z=ao[al].data[0];for(var an=0;an<af.length;an++){ag=af[an];if(ag.applies_to(Z)&&ag.min!==ag.max){ap=true;break}}}}if(ai.filters_available!==ap){ai.filters_available=ap;if(!ai.filters_available){ai.filters_manager.hide()}ai.update_icons()}}this.container_div.find(".yaxislabel").remove();var ac=ao[0];if(ac instanceof j){var ah=(this.prefs.histogram_max?this.prefs.histogram_max:ac.max_val),ab=$("<div/>").text(ah).make_text_editable({num_cols:12,on_finish:function(ar){$(".bs-tooltip").remove();var ar=parseFloat(ar);ai.prefs.histogram_max=(!isNaN(ar)?ar:null);ai.tile_cache.clear();ai.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(ab)}if(ac instanceof L){var am=true;for(al=0;al<ao.length;al++){if(!ao[al].all_slotted){am=false;break}}if(!am){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(Z){var Z;if(this.mode==="Auto"){if(Z==="no_detail"){Z="feature spans"}else{if(Z==="summary_tree"){Z="coverage histogram"}}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+Z+")")}},incremental_slots:function(ad,Z,ac){var aa=this.view.canvas_manager.dummy_context,ab=this.slotters[ad];if(!ab||(ab.mode!==ac)){ab=new (s.FeatureSlotter)(ad,ac,x,function(ae){return aa.measureText(ae)});this.slotters[ad]=ab}return ab.slot_features(Z)},get_mode:function(Z){if(Z.dataset_type==="summary_tree"){mode="summary_tree"}else{if(Z.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>F){mode="Squish"}else{mode="Pack"}}}return mode},get_canvas_height:function(Z,ad,ae,aa){if(ad==="summary_tree"||ad==="Coverage"){return this.summary_draw_height}else{var ac=this.incremental_slots(ae,Z.data,ad);var ab=new (this.painter)(null,null,null,this.prefs,ad);return Math.max(Y,ab.get_required_height(ac,aa))}},draw_tile:function(aj,an,al,ao,ac,ag,ab){var am=this,aa=an.canvas,av=ac.get("start"),Z=ac.get("end"),ad=this.left_offset;if(al==="summary_tree"||al==="Coverage"){var ax=new I.SummaryTreePainter(aj,av,Z,this.prefs);ax.draw(an,aa.width,aa.height,ag);return new j(am,ac,ao,aa,aj.data,aj.max)}var af=[],ak=this.slotters[ag].slots;all_slotted=true;if(aj.data){var ah=this.filters_manager.filters;for(var ap=0,ar=aj.data.length;ap<ar;ap++){var ae=aj.data[ap];var aq=false;var ai;for(var au=0,az=ah.length;au<az;au++){ai=ah[au];ai.update_attrs(ae);if(!ai.keep(ae)){aq=true;break}}if(!aq){af.push(ae);if(!(ae[0] in ak)){all_slotted=false}}}}var ay=(this.filters_manager.alpha_filter?new z(this.filters_manager.alpha_filter):null);var aw=(this.filters_manager.height_filter?new z(this.filters_manager.height_filter):null);var ax=new (this.painter)(af,av,Z,this.prefs,al,ay,aw,ab);var at=null;an.fillStyle=this.prefs.block_color;an.font=an.canvas.manager.default_font;an.textAlign="right";if(aj.data){at=ax.draw(an,aa.width,aa.height,ag,ak);at.translation=-ad}return new L(am,ac,ao,aa,aj.data,ag,al,aj.message,all_slotted,at)},data_and_mode_compatible:function(Z,aa){if(aa==="Auto"){return true}else{if(aa==="Coverage"){return Z.dataset_type==="summary_tree"}else{if(Z.extra_info==="no_detail"||Z.dataset_type==="summary_tree"){return false}else{return true}}}},can_subset:function(Z){if(Z.dataset_type==="summary_tree"||Z.message||Z.extra_info==="no_detail"){return false}return true}});var O=function(aa,Z,ab){c.call(this,aa,Z,ab);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block color",type:"color",default_value:get_random_color()},{key:"label_color",label:"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",type:"string",default_value:this.mode,hidden:true}],saved_values:ab.prefs,onchange:function(){this.track.set_name(this.track.prefs.name);this.track.tile_cache.clear();this.track.request_draw()}});this.prefs=this.config.values;this.painter=I.ReadPainter};o(O.prototype,p.prototype,J.prototype,c.prototype);var R=function(ab,aa,ad){c.call(this,ab,aa,ad);var ac=get_random_color(),Z=get_random_color([ac,"#ffffff"]);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block and sense strand color",type:"color",default_value:ac},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:Z},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",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:true},{key:"histogram_max",label:"Histogram maximum",type:"float",default_value:null,help:"Clear value to set automatically"},{key:"mode",type:"string",default_value:this.mode,hidden:true}],saved_values:ad.prefs,onchange:function(){this.track.set_name(this.track.prefs.name);this.track.tile_cache.clear();this.track.request_draw()}});this.prefs=this.config.values;this.painter=I.ReadPainter;this.update_icons()};o(R.prototype,p.prototype,J.prototype,c.prototype);S.View=X;S.DrawableGroup=M;S.LineTrack=i;S.FeatureTrack=c;S.DiagonalHeatmapTrack=r;S.ReadTrack=R;S.VcfTrack=O;S.CompositeTrack=g};var slotting_module=function(c,b){var e=c("class").extend;var d=2,a=5;b.FeatureSlotter=function(i,h,f,g){this.slots={};this.start_end_dct={};this.w_scale=i;this.mode=h;this.include_label=(h==="Pack");this.max_rows=f;this.measureText=g};e(b.FeatureSlotter.prototype,{slot_features:function(m){var p=this.w_scale,h=this.start_end_dct,x=[],z=[],n=0,y=this.max_rows;for(var v=0,w=m.length;v<w;v++){var k=m[v],o=k[0];if(this.slots[o]!==undefined){n=Math.max(n,this.slots[o]);z.push(this.slots[o])}else{x.push(v)}}var q=function(E,F){for(var D=0;D<=y;D++){var B=false,G=h[D];if(G!==undefined){for(var A=0,C=G.length;A<C;A++){var i=G[A];if(F>i[0]&&E<i[1]){B=true;break}}}if(!B){return D}}return -1};for(var v=0,w=x.length;v<w;v++){var k=m[x[v]],o=k[0],t=k[1],f=k[2],r=k[3],g=Math.floor(t*p),l=Math.ceil(f*p),u=this.measureText(r).width,j;if(r!==undefined&&this.include_label){u+=(d+a);if(g-u>=0){g-=u;j="left"}else{l+=u;j="right"}}var s=q(g,l);if(s>=0){if(h[s]===undefined){h[s]=[]}h[s].push([g,l]);this.slots[o]=s;n=Math.max(n,s)}}return n+1}})};var painters_module=function(require,exports){var extend=require("class").extend;var dashedLine=function(ctx,x1,y1,x2,y2,dashLen){if(dashLen===undefined){dashLen=4}var dX=x2-x1;var dY=y2-y1;var dashes=Math.floor(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=dX/dashes;var dashY=dY/dashes;var q;for(q=0;q<dashes;q++,x1+=dashX,y1+=dashY){if(q%2!==0){continue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle=function(ctx,down_vertex_x,down_vertex_y,side_len){var x1=down_vertex_x-side_len/2,x2=down_vertex_x+side_len/2,y=down_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=this.fillStyle;ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=function(default_val){this.default_val=(default_val?default_val:1)};Scaler.prototype.gen_val=function(input){return this.default_val};var Painter=function(data,view_start,view_end,prefs,mode){this.data=data;this.view_start=view_start;this.view_end=view_end;this.prefs=extend({},this.default_prefs,prefs);this.mode=mode};Painter.prototype.default_prefs={};Painter.prototype.draw=function(ctx,width,height,w_scale){};var SummaryTreePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode)};SummaryTreePainter.prototype.default_prefs={show_counts:false};SummaryTreePainter.prototype.draw=function(ctx,width,height,w_scale){var view_start=this.view_start,points=this.data.data,max=(this.prefs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=height;delta_x_px=Math.ceil(this.data.delta*w_scale);ctx.save();for(var i=0,len=points.length;i<len;i++){var x=Math.floor((points[i][0]-view_start)*w_scale);var y=points[i][1];if(!y){continue}var y_px=y/max*height;if(y!==0&&y_px<1){y_px=1}ctx.fillStyle=this.prefs.block_color;ctx.fillRect(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=4;if(this.prefs.show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.fillStyle=this.prefs.label_color;ctx.textAlign="center";ctx.fillText(y,x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][1])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][1])}this.prefs.max_value=max_value}};LinePainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};LinePainter.prototype.draw=function(ctx,width,height,w_scale){var in_path=false,min_value=this.prefs.min_value,max_value=this.prefs.max_value,vertical_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data;ctx.save();var y_zero=Math.round(height+min_value/vertical_range*height);if(mode!=="Intensity"){ctx.fillStyle="#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=Math.ceil((data[1][0]-data[0][0])*w_scale)}else{delta_x_px=10}var pref_color=parseInt(this.prefs.color.slice(1),16),pref_r=(pref_color&16711680)>>16,pref_g=(pref_color&65280)>>8,pref_b=pref_color&255;for(var i=0,len=data.length;i<len;i++){ctx.fillStyle=ctx.strokeStyle=this.prefs.color;x_scaled=Math.round((data[i][0]-view_start-1)*w_scale);y=data[i][1];var top_overflow=false,bot_overflow=false;if(y===null){if(in_path&&mode==="Filled"){ctx.lineTo(x_scaled,height_px)}in_path=false;continue}if(y<min_value){bot_overflow=true;y=min_value}else{if(y>max_value){top_overflow=true;y=max_value}}if(mode==="Histogram"){y=Math.round(y/vertical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(mode==="Intensity"){var saturation=(y-min_value)/vertical_range,new_r=Math.round(pref_r+(255-pref_r)*(1-saturation)),new_g=Math.round(pref_g+(255-pref_g)*(1-saturation)),new_b=Math.round(pref_b+(255-pref_b)*(1-saturation));ctx.fillStyle="rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRect(x_scaled,0,delta_x_px,height_px)}else{y=Math.round(height_px-(y-min_value)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_path=true;if(mode==="Filled"){ctx.moveTo(x_scaled,height_px);ctx.lineTo(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=this.prefs.overflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode==="Histogram"||mode==="Intensity"){overflow_x=delta_x_px}else{x_scaled-=2;overflow_x=4}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.fillStyle=this.prefs.color}if(mode==="Filled"){if(in_path){ctx.lineTo(x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.restore()};var FeaturePositionMapper=function(slot_height){this.feature_positions={};this.slot_height=slot_height;this.translation=0;this.y_translation=0};FeaturePositionMapper.prototype.map_feature_data=function(feature_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature_positions[slot]=[]}this.feature_positions[slot].push({data:feature_data,x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_data=function(x,y){var slot=Math.floor((y-this.y_translation)/this.slot_height),feature_dict;if(!this.feature_positions[slot]){return null}x+=this.translation;for(var i=0;i<this.feature_positions[slot].length;i++){feature_dict=this.feature_positions[slot][i];if(x>=feature_dict.x_start&&x<=feature_dict.x_end){return feature_dict.data}}};var FeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Painter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=(alpha_scaler?alpha_scaler:new Scaler());this.height_scaler=(height_scaler?height_scaler:new Scaler())};FeaturePainter.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_required_height:function(rows_required,width){var required_height=this.get_row_height(),y_scale=required_height,mode=this.mode;if(mode==="no_detail"||mode==="Squish"||mode==="Pack"){required_height=rows_required*y_scale}return required_height+this.get_top_padding(width)+this.get_bottom_padding(width)},get_top_padding:function(width){return 0},get_bottom_padding:function(width){return Math.max(Math.round(this.get_row_height()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=this.data,view_start=this.view_start,view_end=this.view_end;ctx.save();ctx.fillStyle=this.prefs.block_color;ctx.textAlign="right";var y_scale=this.get_row_height(),feature_mapper=new FeaturePositionMapper(y_scale),x_draw_coords;for(var i=0,len=data.length;i<len;i++){var feature=data[i],feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],slot=(slots&&slots[feature_uid]!==undefined?slots[feature_uid]:null);if((feature_start<view_end&&feature_end>view_start)&&(this.mode==="Dense"||slot!==null)){x_draw_coords=this.draw_element(ctx,this.mode,feature,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_feature_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();feature_mapper.y_translation=this.get_top_padding(width);return feature_mapper},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=10,NO_DETAIL_TRACK_HEIGHT=3,SQUISH_TRACK_HEIGHT=5,PACK_TRACK_HEIGHT=10,NO_DETAIL_FEATURE_HEIGHT=1,DENSE_FEATURE_HEIGHT=9,SQUISH_FEATURE_HEIGHT=3,PACK_FEATURE_HEIGHT=9,LABEL_SPACING=2,CONNECTOR_COLOR="#ccc";var LinkedFeaturePainter=function(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.draw_background_connector=true;this.draw_individual_connectors=false};extend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var mode=this.mode,height;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="no_detail"){height=NO_DETAIL_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2]-1,feature_name=feature[3],feature_strand=feature[4],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),draw_start=f_start,draw_end=f_end,y_center=(mode==="Dense"?0:(0+slot))*y_scale+this.get_top_padding(width),thickness,y_start,thick_start=null,thick_end=null,block_color=(!feature_strand||feature_strand==="+"||feature_strand==="."?this.prefs.block_color:this.prefs.reverse_strand_color);label_color=this.prefs.label_color;ctx.globalAlpha=this.alpha_scaler.gen_val(feature);if(mode==="Dense"){slot=1}if(mode==="no_detail"){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HEIGHT)}else{var feature_ts=feature[5],feature_te=feature[6],feature_blocks=feature[7],full_height=true;if(feature_ts&&feature_te){thick_start=Math.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=Math.ceil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_height,thick_height;if(mode==="Squish"){thin_height=1;thick_height=SQUISH_FEATURE_HEIGHT;full_height=false}else{if(mode==="Dense"){thin_height=5;thick_height=DENSE_FEATURE_HEIGHT}else{thin_height=5;thick_height=PACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_strand&&full_height){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_center,cur_height;if(mode==="Squish"||mode==="Dense"){cur_y_center=y_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}else{if(feature_strand){cur_y_center=y_center;cur_height=thick_height}else{cur_y_center+=(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}}if(this.draw_background_connector){if(mode==="Squish"||mode==="Dense"){ctx.fillStyle=CONNECTOR_COLOR}else{if(feature_strand){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand")}}}else{ctx.fillStyle=CONNECTOR_COLOR}}ctx.fillRect(f_start,cur_y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=0,k_len=feature_blocks.length;k<k_len;k++){var block=feature_blocks[k],block_start=Math.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=Math.ceil(Math.min(width,Math.max((block[1]-1-tile_low)*w_scale))),last_block_start,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=block_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,block_end-block_start,thin_height);if(thick_start!==undefined&&feature_te>feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thick_start=Math.max(block_start,thick_start),block_thick_end=Math.min(block_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height);if(feature_blocks.length===1&&mode==="Pack"){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}if(block_thick_start+14<block_thick_end){block_thick_start+=2;block_thick_end-=2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_end,y_center)}last_block_start=block_start;last_block_end=block_end}if(mode==="Pack"){ctx.globalAlpha=1;ctx.fillStyle="white";var hscale_factor=this.height_scaler.gen_val(feature),new_height=Math.ceil(thick_height*hscale_factor),ws_height=Math.round((thick_height-new_height)/2);if(hscale_factor!==1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,ws_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-f_start,ws_height)}}}ctx.globalAlpha=1;if(mode==="Pack"&&feature_start>tile_low){ctx.fillStyle=label_color;if(tile_low===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=ctx.measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=ctx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=1;return[draw_start,draw_end]}});var ReadPainter=function(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_seq=(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var height,mode=this.mode;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT;if(this.prefs.show_insertions){height*=2}}}return height},draw_read:function(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,orig_seq){ctx.textAlign="center";var tile_region=[tile_low,tile_high],base_offset=0,seq_offset=0,gap=0,char_width_px=ctx.canvas.manager.char_width_px,block_color=(strand==="+"?this.prefs.block_color:this.prefs.reverse_strand_color);var draw_last=[];if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){gap=Math.round(w_scale/2)}if(!cigar){cigar=[[0,orig_seq.length]]}for(var cig_id=0,len=cigar.length;cig_id<len;cig_id++){var cig=cigar[cig_id],cig_op="MIDNSHP=X"[cig[0]],cig_len=cig[1];if(cig_op==="H"||cig_op==="S"){base_offset-=cig_len}var seq_start=(feature_start-1)+base_offset,s_start=Math.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=Math.floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start===s_end){s_end+=1}switch(cig_op){case"H":break;case"S":case"M":case"=":if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=orig_seq.slice(seq_offset,seq_offset+cig_len);if(gap>0){ctx.fillStyle=block_color;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=CONNECTOR_COLOR;for(var c=0,str_len=seq.length;c<str_len;c++){if(this.prefs.show_differences){if(this.ref_seq){var ref_char=this.ref_seq[seq_start-tile_low+c];if(!ref_char||ref_char.toLowerCase()===seq[c].toLowerCase()){continue}}else{continue}}if(seq_start+c>=tile_low&&seq_start+c<=tile_high){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=block_color;ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_offset+=cig_len;base_offset+=cig_len;break;case"N":ctx.fillStyle=CONNECTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset+=cig_len;break;case"D":ctx.fillStyle="red";ctx.fillRect(s_start-gap,y_center+4,s_end-s_start,3);base_offset+=cig_len;break;case"P":break;case"I":var insert_x_coord=s_start-gap;if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=orig_seq.slice(seq_offset,seq_offset+cig_len);if(this.prefs.show_insertions){var x_center=s_start-(s_end-s_start)/2;if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){ctx.fillStyle="yellow";ctx.fillRect(x_center-gap,y_center-9,s_end-s_start,9);draw_last[draw_last.length]={type:"triangle",data:[insert_x_coord,y_center+4,5]};ctx.fillStyle=CONNECTOR_COLOR;switch(compute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_START):seq=seq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=seq.slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS):seq=seq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c=0,str_len=seq.length;c<str_len;c++){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_start)/2,y_center)}}else{ctx.fillStyle="yellow";ctx.fillRect(x_center,y_center+(this.mode!=="Dense"?2:5),s_end-s_start,(mode!=="Dense"?SQUISH_FEATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){draw_last.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}seq_offset+=cig_len;break;case"X":seq_offset+=cig_len;break}}ctx.fillStyle="yellow";var item,type,data;for(var i=0;i<draw_last.length;i++){item=draw_last[i];type=item.type;data=item.data;if(type==="text"){ctx.save();ctx.font="bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]);ctx.restore()}else{if(type==="triangle"){drawDownwardEquilateralTriangle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],feature_name=feature[3],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),y_center=(mode==="Dense"?0:(0+slot))*y_scale,label_color=this.prefs.label_color,gap=0;if((mode==="Pack"||this.mode==="Auto")&&w_scale>ctx.canvas.manager.char_width_px){var gap=Math.round(w_scale/2)}if(feature[5] instanceof Array){var b1_start=Math.floor(Math.max(0,(feature[4][0]-tile_low)*w_scale)),b1_end=Math.ceil(Math.min(width,Math.max(0,(feature[4][1]-tile_low)*w_scale))),b2_start=Math.floor(Math.max(0,(feature[5][0]-tile_low)*w_scale)),b2_end=Math.ceil(Math.min(width,Math.max(0,(feature[5][1]-tile_low)*w_scale))),connector=true;if(feature[4][1]>=tile_low&&feature[4][0]<=tile_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=false}if(feature[5][1]>=tile_low&&feature[5][0]<=tile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5][4])}else{connector=false}if(connector&&b2_start>b1_end){ctx.fillStyle=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,feature_start,feature[4],feature[5],feature[6])}if(mode==="Pack"&&feature_start>tile_low&&feature_name!=="."){ctx.fillStyle=this.prefs.label_color;var tile_index=1;if(tile_index===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING-gap,y_center+8)}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.longest_feature_length=this.calculate_longest_feature_length();this.draw_background_connector=false;this.draw_individual_connectors=true};extend(ArcLinkedFeaturePainter.prototype,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest_feature_length:function(){var longest_feature_length=0;for(var i=0,len=this.data.length;i<len;i++){var feature=this.data[i],feature_start=feature[1],feature_end=feature[2];longest_feature_length=Math.max(longest_feature_length,feature_end-feature_start)}return longest_feature_length},get_top_padding:function(width){var view_range=this.view_end-this.view_start,w_scale=width/view_range;return Math.min(128,Math.ceil((this.longest_feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block1_end,block2_start,block2_end,y_center){var x_center=(block1_end+block2_start)/2,radius=block2_start-x_center;var angle1=Math.PI,angle2=0;if(radius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Math.PI,0);ctx.stroke()}}});var Color=function(rgb,a){if(Array.isArray(rgb)){this.rgb=rgb}else{if(rgb.length==6){this.rgb=rgb.match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{this.rgb=rgb.split("").map(function(c){return parseInt(c+c,16)})}}this.alpha=typeof(a)==="number"?a:1};Color.prototype={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=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")}},toHSL:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2,d=max-min;if(max===min){h=s=0}else{s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,l:l,a:a}},toARGB:function(){var argb=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")},mix:function(color2,weight){color1=this;var p=weight;var w=p*2-1;var a=color1.toHSL().a-color2.toHSL().a;var w1=(((w*a==-1)?w:(w+a)/(1+w*a))+1)/2;var w2=1-w1;var rgb=[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=color1.alpha*p+color2.alpha*(1-p);return new Color(rgb,alpha)}};var LinearRamp=function(start_color,end_color,start_value,end_value){this.start_color=new Color(start_color);this.end_color=new Color(end_color);this.start_value=start_value;this.end_value=end_value;this.value_range=end_value-start_value};LinearRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);value=(value-this.start_value)/this.value_range;return this.start_color.mix(this.end_color,1-value).toCSS()};var SplitRamp=function(start_color,middle_color,end_color,start_value,end_value){this.positive_ramp=new LinearRamp(middle_color,end_color,0,end_value);this.negative_ramp=new LinearRamp(middle_color,start_color,0,-start_value);this.start_value=start_value;this.end_value=end_value};SplitRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);if(value>=0){return this.positive_ramp.map_value(value)}else{return this.negative_ramp.map_value(-value)}};var DiagonalHeatmapPainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][5])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][5])}this.prefs.max_value=max_value}};DiagonalHeatmapPainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Heatmap",pos_color:"4169E1",neg_color:"FF8C00"};DiagonalHeatmapPainter.prototype.draw=function(ctx,width,height,w_scale){var min_value=this.prefs.min_value,max_value=this.prefs.max_value,value_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data,invsqrt2=1/Math.sqrt(2);var ramp=(new SplitRamp(this.prefs.neg_color,"FFFFFF",this.prefs.pos_color,min_value,max_value));var d,s1,e1,s2,e2,value;var scale=function(p){return(p-view_start)*w_scale};ctx.save();ctx.rotate(-45*Math.PI/180);ctx.scale(invsqrt2,invsqrt2);for(var i=0,len=data.length;i<len;i++){d=data[i];s1=scale(d[1]);e1=scale(d[2]);s2=scale(d[4]);e2=scale(d[5]);value=d[6];ctx.fillStyle=(ramp.map_value(value));ctx.fillRect(s1,s2,(e1-s1),(e2-s2))}ctx.restore()};exports.Scaler=Scaler;exports.SummaryTreePainter=SummaryTreePainter;exports.LinePainter=LinePainter;exports.LinkedFeaturePainter=LinkedFeaturePainter;exports.ReadPainter=ReadPainter;exports.ArcLinkedFeaturePainter=ArcLinkedFeaturePainter;exports.DiagonalHeatmapPainter=DiagonalHeatmapPainter};(function(d){var c={};var b=function(e){return c[e]};var a=function(f,g){var e={};g(b,e);c[f]=e};a("class",class_module);a("slotting",slotting_module);a("painters",painters_module);a("trackster",trackster_module);for(key in c.trackster){d[key]=c.trackster[key]}})(window); \ No newline at end of file +var class_module=function(b,a){var c=function(){var g=arguments[0];for(var f=1;f<arguments.length;f++){var d=arguments[f];for(var e in d){g[e]=d[e]}}return g};a.extend=c};var requestAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b,a){window.setTimeout(b,1000/60)}})();var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(e,b){var g=e[0],f=e[1],d=b[0],c=b[1],a;if(g<d){if(f<d){a=BEFORE}else{if(f<=c){a=OVERLAP_START}else{a=CONTAINS}}}else{if(g>c){a=AFTER}else{if(f<=c){a=CONTAINED_BY}else{a=OVERLAP_END}}}return a};var is_overlap=function(c,b){var a=compute_overlap(c,b);return(a!==BEFORE&&a!==AFTER)};var is_deferred=function(a){return("isResolved" in a)};var get_random_color=function(a){if(!a){a="#ffffff"}if(typeof(a)==="string"){a=[a]}for(var j=0;j<a.length;j++){a[j]=parseInt(a[j].slice(1),16)}var n=function(t,s,i){return((t*299)+(s*587)+(i*114))/1000};var e=function(v,u,w,s,i,t){return(Math.max(v,s)-Math.min(v,s))+(Math.max(u,i)-Math.min(u,i))+(Math.max(w,t)-Math.min(w,t))};var g,o,f,k,q,h,r,c,d,b,p,m=false,l=0;do{g=Math.round(Math.random()*16777215);o=(g&16711680)>>16;f=(g&65280)>>8;k=g&255;d=n(o,f,k);m=true;for(j=0;j<a.length;j++){q=a[j];h=(q&16711680)>>16;r=(q&65280)>>8;c=q&255;b=n(h,r,c);p=e(o,f,k,h,r,c);if((Math.abs(d-b)<40)||(p<200)){m=false;break}}l++}while(!m&&l<=10);return"#"+(16777216+g).toString(16).substr(1,6)};var create_action_icon=function(c,b,a){return $("<a/>").attr("href","javascript:void(0);").attr("title",c).addClass("icon-button").addClass(b).tooltip().click(a)};var trackster_module=function(d,S){var o=d("class").extend,s=d("slotting"),I=d("painters");var m={};var k=function(Z,aa){m[Z.attr("id")]=aa};var l=function(Z,ab,ad,ac){ad=".group";var aa={};m[Z.attr("id")]=ac;Z.bind("drag",{handle:"."+ab,relative:true},function(al,am){var ak=$(this),ap=$(this).parent(),ah=ap.children(),aj=m[$(this).attr("id")],ag,af,an,ae,ai;af=$(this).parents(ad);if(af.length!==0){an=af.position().top;ae=an+af.outerHeight();if(am.offsetY<an){$(this).insertBefore(af);var ao=m[af.attr("id")];ao.remove_drawable(aj);ao.container.add_drawable_before(aj,ao);return}else{if(am.offsetY>ae){$(this).insertAfter(af);var ao=m[af.attr("id")];ao.remove_drawable(aj);ao.container.add_drawable(aj);return}}}af=null;for(ai=0;ai<ah.length;ai++){ag=$(ah.get(ai));an=ag.position().top;ae=an+ag.outerHeight();if(ag.is(ad)&&this!==ag.get(0)&&am.offsetY>=an&&am.offsetY<=ae){if(am.offsetY-an<ae-am.offsetY){ag.find(".content-div").prepend(this)}else{ag.find(".content-div").append(this)}if(aj.container){aj.container.remove_drawable(aj)}m[ag.attr("id")].add_drawable(aj);return}}for(ai=0;ai<ah.length;ai++){ag=$(ah.get(ai));if(am.offsetY<ag.position().top&&!(ag.hasClass("reference-track")||ag.hasClass("intro"))){break}}if(ai===ah.length){if(this!==ah.get(ai-1)){ap.append(this);m[ap.attr("id")].move_drawable(aj,ai)}}else{if(this!==ah.get(ai)){$(this).insertBefore(ah.get(ai));m[ap.attr("id")].move_drawable(aj,(am.deltaY>0?ai-1:ai))}}}).bind("dragstart",function(){aa["border-top"]=Z.css("border-top");aa["border-bottom"]=Z.css("border-bottom");$(this).css({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind("dragend",function(){$(this).css(aa)})};S.moveable=l;var Y=16,D=9,A=20,x=100,F=12000,P=400,H=5000,u=100,n="There was an error in indexing this dataset. ",G="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",B="No data for this chrom/contig.",t="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",v="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",N=10,E=20;function U(aa,Z){if(!Z){Z=0}var ab=Math.pow(10,Z);return Math.round(aa*ab)/ab}var p=function(aa,Z,ac){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.name=ac.name;this.view=aa;this.container=Z;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name}],saved_values:ac.prefs,onchange:function(){this.track.set_name(this.track.config.values.name)}});this.prefs=this.config.values;this.drag_handle_class=ac.drag_handle_class;this.is_overview=false;this.action_icons={};this.content_visible=true;this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").css("float","left").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(ad){ad.stopPropagation()});var ab=this;this.container_div.hover(function(){ab.icons_div.show()},function(){ab.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(Z){if(Z.content_visible){Z.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");Z.hide_contents();Z.content_visible=false}else{Z.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");Z.content_visible=true;Z.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"settings-icon",on_click_fn:function(aa){var ac=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},Z=function(){aa.config.update_from_form($(".dialog-box"));hide_modal();$(window).unbind("keypress.check_enter_esc")},ab=function(ad){if((ad.keyCode||ad.which)===27){ac()}else{if((ad.keyCode||ad.which)===13){Z()}}};$(window).bind("keypress.check_enter_esc",ab);show_modal("Configure",aa.config.build_form(),{Cancel:ac,OK:Z})}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.remove()}}];o(p.prototype,{init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.content_visible){return true}return false},request_draw:function(){},_draw:function(){},to_dict:function(){},set_name:function(Z){this.old_name=this.name;this.name=Z;this.name_div.text(this.name)},revert_name:function(){if(this.old_name){this.name=this.old_name;this.name_div.text(this.name)}},remove:function(){this.changed();this.container.remove_drawable(this);var Z=this.view;this.container_div.hide(0,function(){$(this).remove();Z.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(aa,af,ae,ad,Z,ac){var ab=this;this.action_icons[aa]=$("<a/>").attr("href","javascript:void(0);").attr("title",af).addClass("icon-button").addClass(ae).tooltip().click(function(){ad(ab)}).appendTo(this.icons_div);if(ac){this.action_icons[aa].hide()}},build_action_icons:function(Z){var ab;for(var aa=0;aa<Z.length;aa++){ab=Z[aa];this.add_action_icon(ab.name,ab.title,ab.css_class,ab.on_click_fn,ab.prepend,ab.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){}});var w=function(aa,Z,ab){p.call(this,aa,Z,ab);this.obj_type=ab.obj_type;this.drawables=[]};o(w.prototype,p.prototype,{unpack_drawables:function(ab){this.drawables=[];var aa;for(var Z=0;Z<ab.length;Z++){aa=object_from_template(ab[Z],this.view,this);this.add_drawable(aa)}},init:function(){for(var Z=0;Z<this.drawables.length;Z++){this.drawables[Z].init()}},_draw:function(){for(var Z=0;Z<this.drawables.length;Z++){this.drawables[Z]._draw()}},to_dict:function(){var aa=[];for(var Z=0;Z<this.drawables.length;Z++){aa.push(this.drawables[Z].to_dict())}return{name:this.name,prefs:this.prefs,obj_type:this.obj_type,drawables:aa}},add_drawable:function(Z){this.drawables.push(Z);Z.container=this;this.changed()},add_drawable_before:function(ab,Z){this.changed();var aa=this.drawables.indexOf(Z);if(aa!==-1){this.drawables.splice(aa,0,ab);return true}return false},replace_drawable:function(ab,Z,aa){var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables[ac]=Z;if(aa){ab.container_div.replaceWith(Z.container_div)}this.changed()}return ac},remove_drawable:function(aa){var Z=this.drawables.indexOf(aa);if(Z!==-1){this.drawables.splice(Z,1);aa.container=null;this.changed();return true}return false},move_drawable:function(aa,ab){var Z=this.drawables.indexOf(aa);if(Z!==-1){this.drawables.splice(Z,1);this.drawables.splice(ab,0,aa);this.changed();return true}return false}});var M=function(aa,Z,ac){o(ac,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});w.call(this,aa,Z,ac);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);k(this.container_div,this);k(this.content_div,this);l(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new V(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ac){this.unpack_drawables(ac.drawables)}if("filters" in ac){var ab=this.filters_manager;this.filters_manager=new V(this,ac.filters);ab.parent_div.replaceWith(this.filters_manager.parent_div);if(ac.filters.visible){this.setup_multitrack_filtering()}}};o(M.prototype,p.prototype,w.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(Z){if(Z.filters_manager.visible()){Z.filters_manager.clear_filters();Z._restore_filter_managers()}else{Z.setup_multitrack_filtering();Z.request_draw(true)}Z.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var Z=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(Z)}return Z},build_header_div:function(){var Z=$("<div/>").addClass("track-header");Z.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.name).appendTo(Z);return Z},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ab=this.drawables.length;if(ab===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ab===1){if(this.drawables[0] instanceof g){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ai,ah,af,al=true,ad=this.drawables[0].get_type(),Z=0;for(ai=0;ai<ab;ai++){af=this.drawables[ai];if(af.get_type()!==ad){can_composite=false;break}if(af instanceof c){Z++}}if(al||Z===1){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".bs-tooltip").remove()}if(Z>1&&Z===this.drawables.length){var am={},aa;af=this.drawables[0];for(ah=0;ah<af.filters_manager.filters.length;ah++){aa=af.filters_manager.filters[ah];am[aa.name]=[aa]}for(ai=1;ai<this.drawables.length;ai++){af=this.drawables[ai];for(ah=0;ah<af.filters_manager.filters.length;ah++){aa=af.filters_manager.filters[ah];if(aa.name in am){am[aa.name].push(aa)}}}this.filters_manager.remove_all();var ac,ae,ag,aj;for(var ak in am){ac=am[ak];if(ac.length===Z){ae=new Q({name:ac[0].name,index:ac[0].index});this.filters_manager.add_filter(ae)}}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 Z=0;Z<this.drawables.length;Z++){this.drawables[Z].filters_manager=this.saved_filters_managers[Z]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var Z=0;Z<this.drawables.length;Z++){drawable=this.drawables[Z];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ad=[];for(var aa=0;aa<this.drawables.length;aa++){ad.push(this.drawables[aa].name)}var ab="Composite Track of "+this.drawables.length+" tracks ("+ad.join(", ")+")";var ac=new g(this.view,this.view,{name:ab,drawables:this.drawables});var Z=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(Z){w.prototype.add_drawable.call(this,Z);this.update_icons()},remove_drawable:function(Z){w.prototype.remove_drawable.call(this,Z);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var Z=o(w.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return Z},request_draw:function(Z,ab){for(var aa=0;aa<this.drawables.length;aa++){this.drawables[aa].request_draw(Z,ab)}}});var X=function(Z){o(Z,{obj_type:"View"});w.call(this,"View",Z.container,Z);this.chrom=null;this.vis_id=Z.vis_id;this.dbkey=Z.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.init();this.canvas_manager=new CanvasManager(this.container.get(0).ownerDocument);this.reset()};_.extend(X.prototype,Backbone.Events);o(X.prototype,w.prototype,{init:function(){this.requested_redraw=false;var ab=this.container,Z=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ab);this.browser_content_div=$("<div/>").addClass("content").css("position","relative").appendTo(ab);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ab);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;k(this.viewport_container,Z);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ac=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){add_datasets(add_datasets_url,add_track_async_url,function(ad){_.each(ad,function(ae){Z.add_drawable(object_from_template(ae,Z,Z))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("href","javascript:void(0);").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var aa=function(ad){if(ad.type==="focusout"||(ad.keyCode||ad.which)===13||(ad.keyCode||ad.which)===27){if((ad.keyCode||ad.which)!==27){Z.go_to($(this).val())}$(this).hide();$(this).val("");Z.location_span.show();Z.chrom_select.show()}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",aa).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("original-title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){Z.location_span.hide();Z.chrom_select.hide();Z.nav_input.val(Z.chrom+":"+Z.low+"-"+Z.high);Z.nav_input.css("display","inline-block");Z.nav_input.select();Z.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){Z.zoom_out();Z.request_redraw()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){Z.zoom_in();Z.request_redraw()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){Z.change_chrom(Z.chrom_select.val())});this.browser_content_div.click(function(ad){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(ad){Z.zoom_in(ad.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(ad,ae){this.current_x=ae.offsetX}).bind("drag",function(ad,af){var ag=af.offsetX-this.current_x;this.current_x=af.offsetX;var ae=Math.round(ag/Z.viewport_container.width()*(Z.max_high-Z.max_low));Z.move_delta(-ae)});this.overview_close.click(function(){Z.reset_overview()});this.viewport_container.bind("draginit",function(ad,ae){if(ad.clientX>Z.viewport_container.width()-16){return false}}).bind("dragstart",function(ad,ae){ae.original_low=Z.low;ae.current_height=ad.clientY;ae.current_x=ae.offsetX}).bind("drag",function(af,ah){var ad=$(this);var ai=ah.offsetX-ah.current_x;var ae=ad.scrollTop()-(af.clientY-ah.current_height);ad.scrollTop(ae);ah.current_height=af.clientY;ah.current_x=ah.offsetX;var ag=Math.round(ai/Z.viewport_container.width()*(Z.high-Z.low));Z.move_delta(ag)}).bind("mousewheel",function(af,ah,ae,ad){if(ae){ae*=50;var ag=Math.round(-ae/Z.viewport_container.width()*(Z.high-Z.low));Z.move_delta(ag)}});this.top_labeltrack.bind("dragstart",function(ad,ae){return $("<div />").css({height:Z.browser_content_div.height()+Z.top_labeltrack.height()+Z.nav_labeltrack.height()+1,top:"0px",position:"absolute","background-color":"#ccf",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(ah,ai){$(ai.proxy).css({left:Math.min(ah.pageX,ai.startX)-Z.container.offset().left,width:Math.abs(ah.pageX-ai.startX)});var ae=Math.min(ah.pageX,ai.startX)-Z.container.offset().left,ad=Math.max(ah.pageX,ai.startX)-Z.container.offset().left,ag=(Z.high-Z.low),af=Z.viewport_container.width();Z.update_location(Math.round(ae/af*ag)+Z.low,Math.round(ad/af*ag)+Z.low)}).bind("dragend",function(ai,aj){var ae=Math.min(ai.pageX,aj.startX),ad=Math.max(ai.pageX,aj.startX),ag=(Z.high-Z.low),af=Z.viewport_container.width(),ah=Z.low;Z.low=Math.round(ae/af*ag)+ah;Z.high=Math.round(ad/af*ag)+ah;$(aj.proxy).remove();Z.request_redraw()});this.add_label_track(new W(this,{content_div:this.top_labeltrack}));this.add_label_track(new W(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){Z.resize_window()},500)});$(document).bind("redraw",function(){Z.redraw()});this.reset();$(window).trigger("resize")},changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(aa,ac,Z,ad){if(this.timer){clearTimeout(this.timer)}if(ad){var ab=this;this.timer=setTimeout(function(){ab.trigger("navigate",aa+":"+ac+"-"+Z)},500)}else{view.trigger("navigate",aa+":"+ac+"-"+Z)}},update_location:function(Z,ab){this.location_span.text(commatize(Z)+" - "+commatize(ab));this.nav_input.val(this.chrom+":"+commatize(Z)+"-"+commatize(ab));var aa=view.chrom_select.val();if(aa!==""){this.trigger_navigate(aa,view.low,view.high,true)}},load_chroms:function(ab){ab.num=u;ab.dbkey=this.dbkey;var Z=this,aa=$.Deferred();$.ajax({url:chrom_url,data:ab,dataType:"json",success:function(ad){if(ad.chrom_info.length===0){alert("Invalid chromosome: "+ab.chrom);return}if(ad.reference){Z.add_label_track(new y(Z))}Z.chrom_data=ad.chrom_info;var ag='<option value="">Select Chrom/Contig</option>';for(var af=0,ac=Z.chrom_data.length;af<ac;af++){var ae=Z.chrom_data[af].chrom;ag+='<option value="'+ae+'">'+ae+"</option>"}if(ad.prev_chroms){ag+='<option value="previous">Previous '+u+"</option>"}if(ad.next_chroms){ag+='<option value="next">Next '+u+"</option>"}Z.chrom_select.html(ag);Z.chrom_start_index=ad.start_index;aa.resolve(ad)},error:function(){alert("Could not load chroms for this dbkey:",Z.dbkey)}});return aa},change_chrom:function(ae,aa,ag){var ab=this;if(!ab.chrom_data){ab.load_chroms_deferred.then(function(){ab.change_chrom(ae,aa,ag)});return}if(!ae||ae==="None"){return}if(ae==="previous"){ab.load_chroms({low:this.chrom_start_index-u});return}if(ae==="next"){ab.load_chroms({low:this.chrom_start_index+u});return}var af=$.grep(ab.chrom_data,function(ah,ai){return ah.chrom===ae})[0];if(af===undefined){ab.load_chroms({chrom:ae},function(){ab.change_chrom(ae,aa,ag)});return}else{if(ae!==ab.chrom){ab.chrom=ae;ab.chrom_select.val(ab.chrom);ab.max_high=af.len-1;ab.reset();ab.request_redraw(true);for(var ad=0,Z=ab.drawables.length;ad<Z;ad++){var ac=ab.drawables[ad];if(ac.init){ac.init()}}if(ab.reference_track){ab.reference_track.init()}}if(aa!==undefined&&ag!==undefined){ab.low=Math.max(aa,0);ab.high=Math.min(ag,ab.max_high)}else{ab.low=0;ab.high=ab.max_high}ab.reset_overview();ab.request_redraw()}},go_to:function(ad){ad=ad.replace(/ |,/g,"");var ah=this,Z,ac,aa=ad.split(":"),af=aa[0],ag=aa[1];if(ag!==undefined){try{var ae=ag.split("-");Z=parseInt(ae[0],10);ac=parseInt(ae[1],10)}catch(ab){return false}}ah.change_chrom(af,Z,ac)},move_fraction:function(ab){var Z=this;var aa=Z.high-Z.low;this.move_delta(ab*aa)},move_delta:function(ac){var Z=this;var ab=Z.high-Z.low;if(Z.low-ac<Z.max_low){Z.low=Z.max_low;Z.high=Z.max_low+ab}else{if(Z.high-ac>Z.max_high){Z.high=Z.max_high;Z.low=Z.max_high-ab}else{Z.high-=ac;Z.low-=ac}}Z.request_redraw();var aa=Z.chrom_select.val();this.trigger_navigate(aa,Z.low,Z.high,true)},add_drawable:function(Z){w.prototype.add_drawable.call(this,Z);Z.init();this.changed();this.update_intro_div()},add_label_track:function(Z){Z.view=this;Z.init();this.label_tracks.push(Z)},remove_drawable:function(ab,aa){w.prototype.remove_drawable.call(this,ab);if(aa){var Z=this;ab.container_div.hide(0,function(){$(this).remove();Z.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ah,Z,ag,ai){var af=this,ae=(ai?[ai]:af.drawables),ab;var aa;for(var ad=0;ad<ae.length;ad++){aa=ae[ad];ab=-1;for(var ac=0;ac<af.tracks_to_be_redrawn.length;ac++){if(af.tracks_to_be_redrawn[ac][0]===aa){ab=ac;break}}if(ab<0){af.tracks_to_be_redrawn.push([aa,Z,ag])}else{af.tracks_to_be_redrawn[ad][1]=Z;af.tracks_to_be_redrawn[ad][2]=ag}}if(!this.requested_redraw){requestAnimationFrame(function(){af._redraw(ah)});this.requested_redraw=true}},_redraw:function(aj){this.requested_redraw=false;var ag=this.low,ac=this.high;if(ag<this.max_low){ag=this.max_low}if(ac>this.max_high){ac=this.max_high}var ai=this.high-this.low;if(this.high!==0&&ai<this.min_separation){ac=ag+this.min_separation}this.low=Math.floor(ag);this.high=Math.ceil(ac);this.update_location(this.low,this.high);this.resolution_b_px=(this.high-this.low)/this.viewport_container.width();this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var Z=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var af=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ak=13;this.overview_box.css({left:Z,width:Math.max(ak,af)}).show();if(af<ak){this.overview_box.css("left",Z-(ak-af)/2)}if(this.overview_highlight){this.overview_highlight.css({left:Z,width:af})}if(!aj){var ab,aa,ah;for(var ad=0,ae=this.tracks_to_be_redrawn.length;ad<ae;ad++){ab=this.tracks_to_be_redrawn[ad][0];aa=this.tracks_to_be_redrawn[ad][1];ah=this.tracks_to_be_redrawn[ad][2];if(ab){ab._draw(aa,ah)}}this.tracks_to_be_redrawn=[];for(ad=0,ae=this.label_tracks.length;ad<ae;ad++){this.label_tracks[ad]._draw()}}},zoom_in:function(aa,ab){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ac=this.high-this.low,ad=ac/2+this.low,Z=(ac/this.zoom_factor)/2;if(aa){ad=aa/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(ad-Z);this.high=Math.round(ad+Z);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var aa=this.high-this.low,ab=aa/2+this.low,Z=(aa*this.zoom_factor)/2;this.low=Math.round(ab-Z);this.high=Math.round(ab+Z);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ab){if(this.overview_drawable){if(this.overview_drawable.dataset_id===ab.dataset_id){return}this.overview_viewport.find(".track").remove()}var aa=ab.copy({content_div:this.overview_viewport}),Z=this;aa.header_div.hide();aa.is_overview=true;Z.overview_drawable=aa;this.overview_drawable.postdraw_actions=function(){Z.overview_highlight.show().height(Z.overview_drawable.content_div.height());Z.overview_viewport.height(Z.overview_drawable.content_div.height()+Z.overview_box.outerHeight());Z.overview_close.show();Z.resize_window()};Z.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=null}});var q=function(ab,ag,ac){this.track=ab;this.name=ag.name;this.params=[];var an=ag.params;for(var ad=0;ad<an.length;ad++){var ai=an[ad],aa=ai.name,am=ai.label,ae=unescape(ai.html),ao=ai.value,ak=ai.type;if(ak==="number"){this.params.push(new e(aa,am,ae,(aa in ac?ac[aa]:ao),ai.min,ai.max))}else{if(ak==="select"){this.params.push(new K(aa,am,ae,(aa in ac?ac[aa]:ao)))}else{console.log("WARNING: unrecognized tool parameter type:",aa,ak)}}}this.parent_div=$("<div/>").addClass("dynamic-tool").hide();this.parent_div.bind("drag",function(aq){aq.stopPropagation()}).click(function(aq){aq.stopPropagation()}).bind("dblclick",function(aq){aq.stopPropagation()});var al=$("<div class='tool-name'>").appendTo(this.parent_div).text(this.name);var aj=this.params;var ah=this;$.each(this.params,function(ar,av){var au=$("<div>").addClass("param-row").appendTo(ah.parent_div);var aq=$("<div>").addClass("param-label").text(av.label).appendTo(au);var at=$("<div/>").addClass("param-input").html(av.html).appendTo(au);at.find(":input").val(av.value);$("<div style='clear: both;'/>").appendTo(au)});this.parent_div.find("input").click(function(){$(this).select()});var ap=$("<div>").addClass("param-row").appendTo(this.parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ap);var Z=$("<input type='submit'>").attr("value","Run on visible region").css("margin-left","3em").appendTo(ap);Z.click(function(){ah.run_on_region()});af.click(function(){ah.run_on_dataset()});if("visible" in ac&&ac.visible){this.parent_div.show()}};o(q.prototype,{update_params:function(){for(var Z=0;Z<this.params.length;Z++){this.params[Z].update_value()}},state_dict:function(){var aa={};for(var Z=0;Z<this.params.length;Z++){aa[this.params[Z].name]=this.params[Z].value}aa.visible=this.parent_div.is(":visible");return aa},get_param_values_dict:function(){var Z={};this.parent_div.find(":input").each(function(){var aa=$(this).attr("name"),ab=$(this).val();Z[aa]=ab});return Z},get_param_values:function(){var Z=[];this.parent_div.find(":input").each(function(){var aa=$(this).attr("name"),ab=$(this).val();if(aa){Z[Z.length]=ab}});return Z},run_on_dataset:function(){var Z=this;Z.run({target_dataset_id:this.track.original_dataset_id,tool_id:Z.name},null,function(aa){show_modal(Z.name+" is Running",Z.name+" is running on the complete dataset. Tool outputs are in dataset's history.",{Close:hide_modal})})},run_on_region:function(){var aa={target_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:this.track.view.high}]},ae=this.track,ab=aa.tool_id+ae.tool_region_and_parameters_str(aa.chrom,aa.low,aa.high),Z;if(ae.container===view){var ad=new M(view,view,{name:this.name});var ac=ae.container.replace_drawable(ae,ad,false);ad.container_div.insertBefore(ae.view.content_div.children()[ac]);ad.add_drawable(ae);ae.container_div.appendTo(ad.content_div);Z=ad}else{Z=ae.container}var af=new ae.constructor(view,Z,{name:ab,hda_ldda:"hda"});af.init_for_tool_data();af.change_mode(ae.mode);af.set_filters_manager(ae.filters_manager.copy(af));af.update_icons();Z.add_drawable(af);af.tiles_div.text("Starting job.");this.update_params();this.run(aa,af,function(ag){af.set_dataset(new Dataset(ag));af.tiles_div.text("Running job.");af.init()})},run:function(Z,ab,ac){Z.inputs=this.get_param_values_dict();var aa=new ServerStateDeferred({ajax_settings:{url:galaxy_paths.get("tool_url"),data:JSON.stringify(Z),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(ad){return ad!=="pending"}});$.when(aa.go()).then(function(ad){if(ad==="no converter"){ab.container_div.addClass("error");ab.content_div.text(G)}else{if(ad.error){ab.container_div.addClass("error");ab.content_div.text(v+ad.message)}else{ac(ad)}}})}});var K=function(aa,Z,ab,ac){this.name=aa;this.label=Z;this.html=$(ab);this.value=ac};o(K.prototype,{update_value:function(){this.value=$(this.html).val()}});var e=function(ab,aa,ad,ae,ac,Z){K.call(this,ab,aa,ad,ae);this.min=ac;this.max=Z};o(e.prototype,K.prototype,{update_value:function(){K.prototype.update_value.call(this);this.value=parseFloat(this.value)}});var f=function(Z){this.manager=null;this.name=Z.name;this.index=Z.index;this.tool_id=Z.tool_id;this.tool_exp_name=Z.tool_exp_name};o(f.prototype,{to_dict:function(){return{name:this.name,index:this.index,tool_id:this.tool_id,tool_exp_name:this.tool_exp_name}}});var Q=function(ah){f.call(this,ah);this.low=("low" in ah?ah.low:-Number.MAX_VALUE);this.high=("high" in ah?ah.high:Number.MAX_VALUE);this.min=("min" in ah?ah.min:Number.MAX_VALUE);this.max=("max" in ah?ah.max:-Number.MAX_VALUE);this.container=null;this.slider=null;this.slider_label=null;var ad=function(ai,aj,ak){ai.click(function(){var ap=aj.text(),an=parseFloat(ak.slider("option","max")),am=(an<=1?4:an<=1000000?an.toString().length:6),ao=false,al=$(this).parents(".slider-row");al.addClass("input");if(ak.slider("option","values")){am=2*am+1;ao=true}aj.text("");$("<input type='text'/>").attr("size",am).attr("maxlength",am).attr("value",ap).appendTo(aj).focus().select().click(function(aq){aq.stopPropagation()}).blur(function(){$(this).remove();aj.text(ap);al.removeClass("input")}).keyup(function(av){if(av.keyCode===27){$(this).trigger("blur")}else{if(av.keyCode===13){var at=ak.slider("option","min"),aq=ak.slider("option","max"),au=function(aw){return(isNaN(aw)||aw>aq||aw<at)},ar=$(this).val();if(!ao){ar=parseFloat(ar);if(au(ar)){alert("Parameter value must be in the range ["+at+"-"+aq+"]");return $(this)}}else{ar=ar.split("-");ar=[parseFloat(ar[0]),parseFloat(ar[1])];if(au(ar[0])||au(ar[1])){alert("Parameter value must be in the range ["+at+"-"+aq+"]");return $(this)}}ak.slider((ao?"values":"value"),ar);al.removeClass("input")}}})})};var aa=this;aa.parent_div=$("<div/>").addClass("filter-row slider-row");var Z=$("<div/>").addClass("elt-label").appendTo(aa.parent_div),af=$("<span/>").addClass("slider-name").text(aa.name+" ").appendTo(Z),ab=$("<span/>").text(this.low+"-"+this.high),ac=$("<span/>").addClass("slider-value").appendTo(Z).append("[").append(ab).append("]");aa.values_span=ab;var ae=$("<div/>").addClass("slider").appendTo(aa.parent_div);aa.control_element=$("<div/>").attr("id",aa.name+"-filter-control").appendTo(ae);aa.control_element.slider({range:true,min:this.min,max:this.max,step:this.get_slider_step(this.min,this.max),values:[this.low,this.high],slide:function(ai,aj){aa.slide(ai,aj)},change:function(ai,aj){aa.control_element.slider("option","slide").call(aa.control_element,ai,aj)}});aa.slider=aa.control_element;aa.slider_label=ab;ad(ac,ab,aa.control_element);var ag=$("<div/>").addClass("display-controls").appendTo(aa.parent_div);this.transparency_icon=create_action_icon("Use filter for data transparency","layer-transparent",function(){if(aa.manager.alpha_filter!==aa){aa.manager.alpha_filter=aa;aa.manager.parent_div.find(".layer-transparent").removeClass("active").hide();aa.transparency_icon.addClass("active").show()}else{aa.manager.alpha_filter=null;aa.transparency_icon.removeClass("active")}aa.manager.track.request_draw(true,true)}).appendTo(ag).hide();this.height_icon=create_action_icon("Use filter for data height","arrow-resize-090",function(){if(aa.manager.height_filter!==aa){aa.manager.height_filter=aa;aa.manager.parent_div.find(".arrow-resize-090").removeClass("active").hide();aa.height_icon.addClass("active").show()}else{aa.manager.height_filter=null;aa.height_icon.removeClass("active")}aa.manager.track.request_draw(true,true)}).appendTo(ag).hide();aa.parent_div.hover(function(){aa.transparency_icon.show();aa.height_icon.show()},function(){if(aa.manager.alpha_filter!==aa){aa.transparency_icon.hide()}if(aa.manager.height_filter!==aa){aa.height_icon.hide()}});$("<div style='clear: both;'/>").appendTo(aa.parent_div)};o(Q.prototype,{to_dict:function(){var Z=f.prototype.to_dict.call(this);return o(Z,{type:"number",min:this.min,max:this.max,low:this.low,high:this.high})},copy:function(){return new Q({name:this.name,index:this.index,tool_id:this.tool_id,tool_exp_name:this.tool_exp_name})},get_slider_step:function(ab,Z){var aa=Z-ab;return(aa<=2?0.01:1)},slide:function(ab,ac){var aa=ac.values;this.values_span.text(aa[0]+"-"+aa[1]);this.low=aa[0];this.high=aa[1];var Z=this;setTimeout(function(){if(aa[0]===Z.low&&aa[1]===Z.high){Z.manager.track.request_draw(true,true)}},25)},applies_to:function(Z){if(Z.length>this.index){return true}return false},_keep_val:function(Z){return(isNaN(Z)||(Z>=this.low&&Z<=this.high))},keep:function(aa){if(!this.applies_to(aa)){return true}var ac=this;var ad=aa[this.index];if(ad instanceof Array){var ab=true;for(var Z=0;Z<ad.length;Z++){if(!this._keep_val(ad[Z])){ab=false;break}}return ab}else{return this._keep_val(aa[this.index])}},update_attrs:function(ac){var Z=false;if(!this.applies_to(ac)){return Z}var aa=ac[this.index];if(!(aa instanceof Array)){aa=[aa]}for(var ab=0;ab<aa.length;ab++){var ad=aa[ab];if(ad<this.min){this.min=Math.floor(ad);Z=true}if(ad>this.max){this.max=Math.ceil(ad);Z=true}}return Z},update_ui_elt:function(){if(this.min<this.max){this.parent_div.show()}else{this.parent_div.hide()}var aa=this.slider.slider("option","min"),Z=this.slider.slider("option","max");if(this.min<aa||this.max>Z){this.slider.slider("option","min",this.min);this.slider.slider("option","max",this.max);this.slider.slider("option","step",this.get_slider_step(this.min,this.max));this.slider.slider("option","values",[this.min,this.max])}}});var V=function(ab,ah){this.track=ab;this.alpha_filter=null;this.height_filter=null;this.filters=[];this.parent_div=$("<div/>").addClass("filters").hide();this.parent_div.bind("drag",function(aj){aj.stopPropagation()}).click(function(aj){aj.stopPropagation()}).bind("dblclick",function(aj){aj.stopPropagation()}).bind("keydown",function(aj){aj.stopPropagation()});if(ah&&"filters" in ah){var Z=("alpha_filter" in ah?ah.alpha_filter:null),ac=("height_filter" in ah?ah.height_filter:null),ae=ah.filters,aa;for(var af=0;af<ae.length;af++){if(ae[af].type==="number"){aa=new Q(ae[af]);this.add_filter(aa);if(aa.name===Z){this.alpha_filter=aa;aa.transparency_icon.addClass("active").show()}if(aa.name===ac){this.height_filter=aa;aa.height_icon.addClass("active").show()}}else{console.log("ERROR: unsupported filter: ",name,type)}}if("visible" in ah&&ah.visible){this.parent_div.show()}}if(this.filters.length!==0){var ai=$("<div/>").addClass("param-row").appendTo(this.parent_div);var ag=$("<input type='submit'/>").attr("value","Run on complete dataset").appendTo(ai);var ad=this;ag.click(function(){ad.run_on_dataset()})}};o(V.prototype,{show:function(){this.parent_div.show()},hide:function(){this.parent_div.hide()},toggle:function(){this.parent_div.toggle()},visible:function(){return this.parent_div.is(":visible")},to_dict:function(){var ac={},ab=[],aa;for(var Z=0;Z<this.filters.length;Z++){aa=this.filters[Z];ab.push(aa.to_dict())}ac.filters=ab;ac.alpha_filter=(this.alpha_filter?this.alpha_filter.name:null);ac.height_filter=(this.height_filter?this.height_filter.name:null);ac.visible=this.parent_div.is(":visible");return ac},copy:function(aa){var ab=new V(aa);for(var Z=0;Z<this.filters.length;Z++){ab.add_filter(this.filters[Z].copy())}return ab},add_filter:function(Z){Z.manager=this;this.parent_div.append(Z.parent_div);this.filters.push(Z)},remove_all:function(){this.filters=[];this.parent_div.children().remove()},init_filters:function(){for(var Z=0;Z<this.filters.length;Z++){var aa=this.filters[Z];aa.update_ui_elt()}},clear_filters:function(){for(var Z=0;Z<this.filters.length;Z++){var aa=this.filters[Z];aa.slider.slider("option","values",[aa.min,aa.max])}this.alpha_filter=null;this.height_filter=null;this.parent_div.find(".icon-button").hide()},run_on_dataset:function(){var af=function(aj,ah,ai){if(!(ah in aj)){aj[ah]=ai}return aj[ah]};var ae={},ag,Z;for(var ad=0;ad<this.filters.length;ad++){ag=this.filters[ad];if(ag.tool_id){if(ag.min!==ag.low){Z=af(ae,ag.tool_id,[]);Z[Z.length]=ag.tool_exp_name+" >= "+ag.low}if(ag.max!==ag.high){Z=af(ae,ag.tool_id,[]);Z[Z.length]=ag.tool_exp_name+" <= "+ag.high}}}var aa=[];for(var ac in ae){aa[aa.length]=[ac,ae[ac]]}(function ab(an,ak){var ai=ak[0],aj=ai[0],am=ai[1],al="("+am.join(") and (")+")",ah={cond:al,input:an,target_dataset_id:an,tool_id:aj},ak=ak.slice(1);$.getJSON(run_tool_url,ah,function(ao){if(ao.error){show_modal("Filter Dataset","Error running tool "+aj,{Close:hide_modal})}else{if(ak.length===0){show_modal("Filtering Dataset","Filter(s) are running on the complete dataset. Outputs are in dataset's history.",{Close:hide_modal})}else{ab(ao.dataset_id,ak)}}})})(this.track.dataset_id,aa)}});var z=function(Z,aa){I.Scaler.call(this,aa);this.filter=Z};z.prototype.gen_val=function(Z){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(Z[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var C=function(Z){this.track=Z.track;this.params=Z.params;this.values={};this.restore_values((Z.saved_values?Z.saved_values:{}));this.onchange=Z.onchange};o(C.prototype,{restore_values:function(Z){var aa=this;$.each(this.params,function(ab,ac){if(Z[ac.key]!==undefined){aa.values[ac.key]=Z[ac.key]}else{aa.values[ac.key]=ac.default_value}})},build_form:function(){var ac=this;var Z=$("<div />");var ab;function aa(ah,ad){for(var al=0;al<ah.length;al++){ab=ah[al];if(ab.hidden){continue}var af="param_"+al;var ap=ac.values[ab.key];var ar=$("<div class='form-row' />").appendTo(ad);ar.append($("<label />").attr("for",af).text(ab.label+":"));if(ab.type==="bool"){ar.append($('<input type="checkbox" />').attr("id",af).attr("name",af).attr("checked",ap))}else{if(ab.type==="text"){ar.append($('<input type="text"/>').attr("id",af).val(ap).click(function(){$(this).select()}))}else{if(ab.type==="select"){var an=$("<select />").attr("id",af);for(var aj=0;aj<ab.options.length;aj++){$("<option/>").text(ab.options[aj].label).attr("value",ab.options[aj].value).appendTo(an)}an.val(ap);ar.append(an)}else{if(ab.type==="color"){var aq=$("<div/>").appendTo(ar),am=$("<input />").attr("id",af).attr("name",af).val(ap).css("float","left").appendTo(aq).click(function(au){$(".bs-tooltip").removeClass("in");var at=$(this).siblings(".bs-tooltip").addClass("in");at.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-($(at).height()/2)+($(this).height()/2)}).show();at.click(function(av){av.stopPropagation()});$(document).bind("click.color-picker",function(){at.hide();$(document).unbind("click.color-picker")});au.stopPropagation()}),ak=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(aq).attr("title","Set new random color").tooltip(),ao=$("<div class='bs-tooltip right' style='position: absolute;' />").appendTo(aq).hide(),ag=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(ao),ae=$("<div class='tooltip-arrow'></div>").appendTo(ao),ai=$.farbtastic(ag,{width:100,height:100,callback:am,color:ap});aq.append($("<div/>").css("clear","both"));(function(at){ak.click(function(){at.setColor(get_random_color())})})(ai)}else{ar.append($("<input />").attr("id",af).attr("name",af).val(ap))}}}}if(ab.help){ar.append($("<div class='help'/>").text(ab.help))}}}aa(this.params,Z);return Z},update_from_form:function(Z){var ab=this;var aa=false;$.each(this.params,function(ac,ae){if(!ae.hidden){var af="param_"+ac;var ad=Z.find("#"+af).val();if(ae.type==="float"){ad=parseFloat(ad)}else{if(ae.type==="int"){ad=parseInt(ad)}else{if(ae.type==="bool"){ad=Z.find("#"+af).is(":checked")}}}if(ad!==ab.values[ae.key]){ab.values[ae.key]=ad;aa=true}}});if(aa){this.onchange();this.track.changed()}}});var b=function(Z,ad,ab,aa,ac){this.track=Z;this.region=ad;this.low=ad.get("start");this.high=ad.get("end");this.resolution=ab;this.html_elt=$("<div class='track-tile'/>").append(aa).height($(aa).attr("height"));this.data=ac;this.stale=false};b.prototype.predisplay_actions=function(){};var j=function(Z,ae,ab,aa,ac,ad){b.call(this,Z,ae,ab,aa,ac);this.max_val=ad};o(j.prototype,b.prototype);var L=function(ac,ak,ad,ab,af,am,ag,an,aa,aj){b.call(this,ac,ak,ad,ab,af);this.mode=ag;this.all_slotted=aa;this.feature_mapper=aj;this.has_icons=false;if(an){this.has_icons=true;var ah=this;ab=this.html_elt.children()[0],message_div=$("<div/>").addClass("tile-message").css({height:A-1,width:ab.width}).prependTo(this.html_elt);var ai=new GenomeRegion({chrom:ac.view.chrom,start:this.low,end:this.high}),al=af.length,ae=$("<a href='javascript:void(0);'/>").addClass("icon more-down").attr("title","For speed, only the first "+al+" features in this region were obtained from server. Click to get more data including depth").tooltip().appendTo(message_div),Z=$("<a href='javascript:void(0);'/>").addClass("icon more-across").attr("title","For speed, only the first "+al+" features in this region were obtained from server. Click to get more data excluding depth").tooltip().appendTo(message_div);ae.click(function(){ah.stale=true;ac.data_manager.get_more_data(ai,ac.mode,ah.resolution,{},ac.data_manager.DEEP_DATA_REQ);$(".bs-tooltip").hide();ac.request_draw(true)}).dblclick(function(ao){ao.stopPropagation()});Z.click(function(){ah.stale=true;ac.data_manager.get_more_data(ai,ac.mode,ah.resolution,{},ac.data_manager.BROAD_DATA_REQ);$(".bs-tooltip").hide();ac.request_draw(true)}).dblclick(function(ao){ao.stopPropagation()})}};o(L.prototype,b.prototype);L.prototype.predisplay_actions=function(){var aa=this,Z={};if(aa.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(al){if(!this.hovered){return}var ag=$(this).offset(),ak=al.pageX-ag.left,aj=al.pageY-ag.top,ap=aa.feature_mapper.get_feature_data(ak,aj),ah=(ap?ap[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!ah||$(this).attr("id")!==ah.toString()){$(this).remove()}});if(ap){var ac=Z[ah];if(!ac){var ah=ap[0],am={name:ap[3],start:ap[1],end:ap[2],strand:ap[4]},af=aa.track.filters_manager.filters,ae;for(var ai=0;ai<af.length;ai++){ae=af[ai];am[ae.name]=ap[ae.index]}var ac=$("<div/>").attr("id",ah).addClass("feature-popup"),aq=$("<table/>"),ao,an,ar;for(ao in am){an=am[ao];ar=$("<tr/>").appendTo(aq);$("<th/>").appendTo(ar).text(ao);$("<td/>").attr("align","left").appendTo(ar).text(typeof(an)==="number"?U(an,2):an)}ac.append($("<div class='feature-popup-inner'>").append(aq));Z[ah]=ac}ac.appendTo($(this).parents(".track-content").children(".overlay"));var ad=ak+parseInt(aa.html_elt.css("left"))-ac.width()/2,ab=aj+parseInt(aa.html_elt.css("top"))+7;ac.css("left",ad+"px").css("top",ab+"px")}else{if(!al.isPropagationStopped()){al.stopPropagation();$(this).siblings().each(function(){$(this).trigger(al)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var h=function(ab,aa,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ab,aa,ad);this.data_url=("data_url" in ad?ad.data_url:default_data_url);this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:H);this.dataset_check_url=("converted_datasets_state_url" in ad?ad.converted_datasets_state_url:converted_datasets_state_url);var Z=this,ac=new Dataset({id:ad.dataset_id,hda_ldda:ad.hda_ldda});this.data_manager=("data_manager" in ad?ad.data_manager:new GenomeDataManager({dataset:ac,data_url:Z.data_url,dataset_state_url:Z.dataset_check_url,data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=0;this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(h.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"overview-icon",on_click_fn:function(Z){Z.view.set_overview(Z)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(Z){if(Z.filters_manager.visible()){Z.filters_manager.clear_filters()}else{Z.filters_manager.init_filters()}Z.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(Z){Z.dynamic_tool_div.toggle();if(Z.dynamic_tool_div.is(":visible")){Z.set_name(Z.name+Z.tool_region_and_parameters_str())}else{Z.revert_name()}$(".bs-tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(Z){var ac='<strong>Tool</strong>: <%= track.tool.name %><br/><strong>Dataset</strong>: <%= track.name %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ab=_.template(ac,{track:Z});var ae=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},aa=function(){var ag=$('select[name="regions"] option:selected').val(),ai,af=new GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),ah=_.map($(".bookmark"),function(aj){return new GenomeRegion({from_str:$(aj).children(".position").text()})});if(ag==="cur"){ai=[af]}else{if(ag==="bookmarks"){ai=ah}else{ai=[af].concat(ah)}}hide_modal();window.location.href=galaxy_paths.get("sweepster_url")+"?"+$.param({dataset_id:Z.dataset_id,hda_ldda:Z.hda_ldda,regions:JSON.stringify(new Backbone.Collection(ai).toJSON())})},ad=function(af){if((af.keyCode||af.which)===27){ae()}else{if((af.keyCode||af.which)===13){aa()}}};show_modal("Visualize tool parameter space and output from different parameter settings?",ab,{No:ae,Yes:aa})}},p.prototype.action_icons_def[2]],can_draw:function(){if(this.dataset_id&&p.prototype.can_draw.call(this)){return true}return false},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id).css("position","relative")},build_header_div:function(){var Z=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(Z)}this.name_div=$("<div/>").addClass("track-name").appendTo(Z).text(this.name).attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return Z},on_resize:function(){},add_resize_handle:function(){var Z=this;var ac=false;var ab=false;var aa=$("<div class='track-resize'>");$(Z.container_div).hover(function(){if(Z.content_visible){ac=true;aa.show()}},function(){ac=false;if(!ab){aa.hide()}});aa.hide().bind("dragstart",function(ad,ae){ab=true;ae.original_height=$(Z.content_div).height()}).bind("drag",function(ae,af){var ad=Math.min(Math.max(af.original_height+af.deltaY,Z.min_height_px),Z.max_height_px);$(Z.tiles_div).css("height",ad);Z.visible_height_px=(Z.max_height_px===ad?0:ad);Z.on_resize()}).bind("dragend",function(ad,ae){Z.tile_cache.clear();ab=false;if(!ac){aa.hide()}Z.config.values.height=Z.visible_height_px;Z.changed()}).appendTo(Z.container_div)},set_display_modes:function(ac,af){this.display_modes=ac;this.mode=(af?af:(this.config&&this.config.values.mode?this.config.values.mode:this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var aa=this,ad={};for(var ab=0,Z=aa.display_modes.length;ab<Z;ab++){var ae=aa.display_modes[ab];ad[ae]=function(ag){return function(){aa.change_mode(ag);aa.icons_div.show();aa.container_div.mouseleave(function(){aa.icons_div.hide()})}}(ae)}make_popupmenu(this.action_icons.mode_icon,ad)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof W){return"LabelTrack"}else{if(this instanceof y){return"ReferenceTrack"}else{if(this instanceof i){return"LineTrack"}else{if(this instanceof R){return"ReadTrack"}else{if(this instanceof O){return"VcfTrack"}else{if(this instanceof g){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},init:function(){var aa=this;aa.enabled=false;aa.tile_cache.clear();aa.data_manager.clear();aa.content_div.css("height","auto");aa.tiles_div.children().remove();aa.container_div.removeClass("nodata error pending");if(!aa.dataset_id){return}var Z=$.Deferred();$.getJSON(this.dataset_check_url,{hda_ldda:aa.hda_ldda,dataset_id:aa.dataset_id,chrom:aa.view.chrom},function(ab){if(!ab||ab==="error"||ab.kind==="error"){aa.container_div.addClass("error");aa.tiles_div.text(n);if(ab.message){var ac=$(" <a href='javascript:void(0);'></a>").text("View error").click(function(){show_modal("Trackster Error","<pre>"+ab.message+"</pre>",{Close:hide_modal})});aa.tiles_div.append(ac)}}else{if(ab==="no converter"){aa.container_div.addClass("error");aa.tiles_div.text(G)}else{if(ab==="no data"||(ab.data!==undefined&&(ab.data===null||ab.data.length===0))){aa.container_div.addClass("nodata");aa.tiles_div.text(B)}else{if(ab==="pending"){aa.container_div.addClass("pending");aa.tiles_div.html(t);setTimeout(function(){aa.init()},aa.data_query_wait)}else{if(ab==="data"||ab.status==="data"){if(ab.valid_chroms){aa.valid_chroms=ab.valid_chroms;aa.update_icons()}aa.tiles_div.text(T);if(aa.view.chrom){aa.tiles_div.text("");aa.tiles_div.css("height",aa.visible_height_px+"px");aa.enabled=true;$.when(aa.predraw_init()).done(function(){Z.resolve();aa.container_div.removeClass("nodata error pending");aa.request_draw()})}else{Z.resolve()}}}}}}});this.update_icons();return Z},predraw_init:function(){}});var J=function(ab,aa,ac){h.call(this,ab,aa,ac);var Z=this;l(Z.container_div,Z.drag_handle_class,".group",Z);this.filters_manager=new V(this,("filters" in ac?ac.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=("tool" in ac&&ac.tool?new q(this,ac.tool,ac.tool_state):null);this.tile_cache=new Cache(N);if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){this.dynamic_tool_div=this.tool.parent_div;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(ac.mode){this.change_mode(ac.mode)}};o(J.prototype,p.prototype,h.prototype,{action_icons_def:h.prototype.action_icons_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(Z){$(".bs-tooltip").remove();Z.slotters[Z.view.resolution_px_b].max_rows*=2;Z.request_draw(true)},hide:true}]),copy:function(Z){var aa=this.to_dict();o(aa,{data_manager:this.data_manager});var ab=new this.constructor(this.view,Z,aa);ab.change_mode(this.mode);ab.enabled=this.enabled;return ab},set_filters_manager:function(Z){this.filters_manager=Z;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),name:this.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(aa){var Z=this;Z.mode=aa;Z.config.values.mode=aa;Z.tile_cache.clear();Z.request_draw();this.action_icons.mode_icon.attr("title","Set display mode (now: "+Z.mode+")");return Z},update_icons:function(){var Z=this;if(Z.filters_available){Z.action_icons.filters_icon.show()}else{Z.action_icons.filters_icon.hide()}if(Z.tool){Z.action_icons.tools_icon.show();Z.action_icons.param_space_viz_icon.show()}else{Z.action_icons.tools_icon.hide();Z.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(aa,ab,Z){return aa+"_"+ab+"_"+Z},request_draw:function(aa,Z){this.view.request_redraw(false,aa,Z,this)},before_draw:function(){},_draw:function(aa,ak){if(!this.can_draw()){return}var ai=this.view.low,ae=this.view.high,ag=ae-ai,ab=this.view.container.width(),am=this.view.resolution_px_b,ad=this.view.resolution_b_px;if(this.is_overview){ai=this.view.max_low;ae=this.view.max_high;ad=(view.max_high-view.max_low)/ab;am=1/ad}this.before_draw();this.tiles_div.children().addClass("remove");var Z=Math.floor(ai/(ad*P)),ah=true,al=[],af=function(an){return(an&&"track" in an)};while((Z*P*ad)<ae){var aj=this.draw_helper(aa,ab,Z,ad,this.tiles_div,am);if(af(aj)){al.push(aj)}else{ah=false}Z+=1}if(!ak){this.tiles_div.children(".remove").removeClass("remove").remove()}var ac=this;if(ah){this.tiles_div.children(".remove").remove();ac.postdraw_actions(al,ab,am,ak)}},postdraw_actions:function(ab,ac,ae,Z){var ad=false;for(var aa=0;aa<ab.length;aa++){if(ab[aa].has_icons){ad=true;break}}if(ad){for(var aa=0;aa<ab.length;aa++){tile=ab[aa];if(!tile.has_icons){tile.html_elt.css("padding-top",A)}}}},draw_helper:function(Z,al,aq,ao,ae,af,am){var ak=this,au=this._gen_tile_cache_key(al,af,aq),ac=this._get_tile_bounds(aq,ao);if(!am){am={}}var at=(Z?undefined:ak.tile_cache.get_elt(au));if(at){ak.show_tile(at,ae,af);return at}var ai=true;var ap=ak.data_manager.get_data(ac,ak.mode,ao,ak.data_url_extra_params);if(is_deferred(ap)){ai=false}var ag;if(view.reference_track&&af>view.canvas_manager.char_width_px){ag=view.reference_track.data_manager.get_data(ac,ak.mode,ao,view.reference_track.data_url_extra_params);if(is_deferred(ag)){ai=false}}if(ai){o(ap,am.more_tile_data);var ah=ak.mode;if(ah==="Auto"){ah=ak.get_mode(ap);ak.update_auto_mode(ah)}var ab=ak.view.canvas_manager.new_canvas(),ar=ac.get("start"),aa=ac.get("end"),al=Math.ceil((aa-ar)*af)+ak.left_offset,aj=ak.get_canvas_height(ap,ah,af,al);ab.width=al;ab.height=aj;var an=ab.getContext("2d");an.translate(this.left_offset,0);var at=ak.draw_tile(ap,an,ah,ao,ac,af,ag);if(at!==undefined){ak.tile_cache.set_elt(au,at);ak.show_tile(at,ae,af)}return at}var ad=$.Deferred();$.when(ap,ag).then(function(){view.request_redraw(false,false,false,ak);ad.resolve()});return ad},get_canvas_height:function(Z,ab,ac,aa){return this.visible_height_px},draw_tile:function(Z,aa,ae,ac,ad,af,ab){console.log("Warning: TiledTrack.draw_tile() not implemented.")},show_tile:function(ab,ad,ae){var aa=this,Z=ab.html_elt;ab.predisplay_actions();var ac=(ab.low-(this.is_overview?this.view.max_low:this.view.low))*ae;if(this.left_offset){ac-=this.left_offset}Z.css({position:"absolute",top:0,left:ac});if(Z.hasClass("remove")){Z.removeClass("remove")}else{ad.append(Z)}aa.after_show_tile(ab)},after_show_tile:function(Z){this.max_height_px=Math.max(this.max_height_px,Z.html_elt.height());Z.html_elt.parent().children().css("height",this.max_height_px+"px");var aa=this.max_height_px;if(this.visible_height_px!==0){aa=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",aa+"px")},_get_tile_bounds:function(Z,aa){var ac=Math.floor(Z*P*aa),ad=Math.ceil(P*aa),ab=(ac+ad<=this.view.max_high?ac+ad:this.view.max_high);return new GenomeRegion({chrom:this.view.chrom,start:ac,end:ab})},tool_region_and_parameters_str:function(ab,Z,ac){var aa=this,ad=(ab!==undefined&&Z!==undefined&&ac!==undefined?ab+":"+Z+"-"+ac:"all");return" - region=["+ad+"], parameters=["+aa.tool.get_param_values().join(", ")+"]"},data_and_mode_compatible:function(Z,aa){return true},can_subset:function(Z){return false},init_for_tool_data:function(){this.data_manager.set("data_url",raw_data_url);this.data_query_wait=1000;this.dataset_check_url=dataset_state_url;this.normal_postdraw_actions=this.postdraw_actions;this.postdraw_actions=function(ab,ac,ae,Z){var aa=this;aa.normal_postdraw_actions(ab,ac,ae,Z);aa.dataset_state_url=converted_datasets_state_url;aa.data_query_wait=H;var ad=new ServerStateDeferred({url:aa.dataset_state_url,url_params:{dataset_id:aa.dataset_id,hda_ldda:aa.hda_ldda},interval:aa.data_query_wait,success_fn:function(af){return af!=="pending"}});$.when(ad.go()).then(function(){aa.data_manager.set("data_url",default_data_url)});aa.postdraw_actions=aa.normal_postdraw_actions}}});var W=function(aa,Z){var ab={resize:false};h.call(this,aa,Z,ab);this.container_div.addClass("label-track")};o(W.prototype,h.prototype,{build_header_div:function(){},init:function(){this.enabled=true},_draw:function(){var ab=this.view,ac=ab.high-ab.low,af=Math.floor(Math.pow(10,Math.floor(Math.log(ac)/Math.log(10)))),Z=Math.floor(ab.low/af)*af,ad=this.view.container.width(),aa=$("<div style='position: relative; height: 1.3em;'></div>");while(Z<ab.high){var ae=(Z-ab.low)/ac*ad;aa.append($("<div class='label'>"+commatize(Z)+"</div>").css({position:"absolute",left:ae-1}));Z+=af}this.content_div.children(":first").remove();this.content_div.append(aa)}});var g=function(aa,Z,ad){J.call(this,aa,Z,ad);this.drawables=[];this.left_offset=0;if("drawables" in ad){var ac;for(var ab=0;ab<ad.drawables.length;ab++){ac=ad.drawables[ab];this.drawables[ab]=object_from_template(ac,aa,null);if(ac.left_offset>this.left_offset){this.left_offset=ac.left_offset}}this.enabled=true}if(this.drawables.length!==0){this.set_display_modes(this.drawables[0].display_modes,this.drawables[0].mode)}this.update_icons();this.obj_type="CompositeTrack"};o(g.prototype,J.prototype,{action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(Z){$(".bs-tooltip").remove();Z.show_group()}}].concat(J.prototype.action_icons_def),to_dict:w.prototype.to_dict,add_drawable:w.prototype.add_drawable,unpack_drawables:w.prototype.unpack_drawables,change_mode:function(Z){J.prototype.change_mode.call(this,Z);for(var aa=0;aa<this.drawables.length;aa++){this.drawables[aa].change_mode(Z)}},init:function(){var ab=[];for(var aa=0;aa<this.drawables.length;aa++){ab.push(this.drawables[aa].init())}var Z=this;$.when.apply($,ab).then(function(){Z.enabled=true;Z.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,draw_helper:function(aa,ap,aw,at,ah,aj,aq){var ao=this,aA=this._gen_tile_cache_key(ap,aj,aw),ae=this._get_tile_bounds(aw,at);if(!aq){aq={}}var az=(aa?undefined:ao.tile_cache.get_elt(aA));if(az){ao.show_tile(az,ah,aj);return az}var ai=[],ao,am=true,au,ak;for(var av=0;av<this.drawables.length;av++){ao=this.drawables[av];au=ao.data_manager.get_data(ae,ao.mode,at,ao.data_url_extra_params);if(is_deferred(au)){am=false}ai.push(au);ak=null;if(view.reference_track&&aj>view.canvas_manager.char_width_px){ak=view.reference_track.data_manager.get_data(ae,ao.mode,at,view.reference_track.data_url_extra_params);if(is_deferred(ak)){am=false}}ai.push(ak)}if(am){o(au,aq.more_tile_data);this.tile_predraw_init();var ad=ao.view.canvas_manager.new_canvas(),af=ao._get_tile_bounds(aw,at),ax=ae.get("start"),ab=ae.get("end"),ay=0,ap=Math.ceil((ab-ax)*aj)+this.left_offset,an=0,ac=[],av;var Z=0;for(av=0;av<this.drawables.length;av++,ay+=2){ao=this.drawables[av];au=ai[ay];var al=ao.mode;if(al==="Auto"){al=ao.get_mode(au);ao.update_auto_mode(al)}ac.push(al);Z=ao.get_canvas_height(au,al,aj,ap);if(Z>an){an=Z}}ad.width=ap;ad.height=(aq.height?aq.height:an);ay=0;var ar=ad.getContext("2d");ar.translate(this.left_offset,0);ar.globalAlpha=0.5;ar.globalCompositeOperation="source-over";for(av=0;av<this.drawables.length;av++,ay+=2){ao=this.drawables[av];au=ai[ay];ak=ai[ay+1];az=ao.draw_tile(au,ar,ac[av],at,ae,aj,ak)}this.tile_cache.set_elt(aA,az);this.show_tile(az,ah,aj);return az}var ag=$.Deferred(),ao=this;$.when.apply($,ai).then(function(){view.request_redraw(false,false,false,ao);ag.resolve()});return ag},show_group:function(){var ac=new M(this.view,this.container,{name:this.name}),Z;for(var ab=0;ab<this.drawables.length;ab++){Z=this.drawables[ab];Z.update_icons();ac.add_drawable(Z);Z.container=ac;ac.content_div.append(Z.container_div)}var aa=this.container.replace_drawable(this,ac,true);ac.request_draw()},tile_predraw_init:function(){var ac=Number.MAX_VALUE,Z=-ac,aa;for(var ab=0;ab<this.drawables.length;ab++){aa=this.drawables[ab];if(aa instanceof i){if(aa.prefs.min_value<ac){ac=aa.prefs.min_value}if(aa.prefs.max_value>Z){Z=aa.prefs.max_value}}}for(var ab=0;ab<this.drawables.length;ab++){aa=this.drawables[ab];aa.prefs.min_value=ac;aa.prefs.max_value=Z}},postdraw_actions:function(ab,ae,ag,aa){J.prototype.postdraw_actions.call(this,ab,ae,ag,aa);var ad=-1;for(var ac=0;ac<ab.length;ac++){var Z=ab[ac].html_elt.find("canvas").height();if(Z>ad){ad=Z}}for(var ac=0;ac<ab.length;ac++){var af=ab[ac];if(af.html_elt.find("canvas").height()!==ad){this.draw_helper(true,ae,af.index,af.resolution,af.html_elt.parent(),ag,{height:ad});af.html_elt.remove()}}}});var y=function(Z){J.call(this,Z,{content_div:Z.top_labeltrack},{resize:false});Z.reference_track=this;this.left_offset=200;this.visible_height_px=12;this.container_div.addClass("reference-track");this.content_div.css("background","none");this.content_div.css("min-height","0px");this.content_div.css("border","none");this.data_url=reference_url;this.data_url_extra_params={dbkey:Z.dbkey};this.data_manager=new ReferenceTrackDataManager({data_url:reference_url});this.hide_contents()};o(y.prototype,p.prototype,J.prototype,{build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},can_draw:p.prototype.can_draw,draw_helper:function(ad,ab,Z,aa,ae,af,ac){if(af>this.view.canvas_manager.char_width_px){return J.prototype.draw_helper.call(this,ad,ab,Z,aa,ae,af,ac)}else{this.hide_contents();return null}},draw_tile:function(ah,ai,ad,ac,af,aj){var ab=this;if(aj>this.view.canvas_manager.char_width_px){if(ah.data===null){this.hide_contents();return}var aa=ai.canvas;ai.font=ai.canvas.manager.default_font;ai.textAlign="center";ah=ah.data;for(var ae=0,ag=ah.length;ae<ag;ae++){var Z=Math.floor(ae*aj);ai.fillText(ah[ae],Z,10)}this.show_contents();return new b(ab,af,ac,aa,ah)}this.hide_contents()}});var i=function(ab,aa,ac){var Z=this;this.display_modes=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";J.call(this,ab,aa,ac);this.hda_ldda=ac.hda_ldda;this.dataset_id=ac.dataset_id;this.original_dataset_id=this.dataset_id;this.left_offset=0;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"color",label:"Color",type:"color",default_value:get_random_color()},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:32,hidden:true}],saved_values:ac.prefs,onchange:function(){Z.set_name(Z.prefs.name);Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.set_min_value(Z.prefs.min_value);Z.set_max_value(Z.prefs.max_value)}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.vertical_range=this.config.values.max_value-this.config.values.min_value};o(i.prototype,p.prototype,J.prototype,{on_resize:function(){this.request_draw(true)},set_min_value:function(Z){this.prefs.min_value=Z;$("#linetrack_"+this.dataset_id+"_minval").text(this.prefs.min_value);this.tile_cache.clear();this.request_draw()},set_max_value:function(Z){this.prefs.max_value=Z;$("#linetrack_"+this.dataset_id+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.request_draw()},predraw_init:function(){var Z=this;Z.vertical_range=undefined;return $.getJSON(Z.data_url,{stats:true,chrom:Z.view.chrom,low:0,high:Z.view.max_high,hda_ldda:Z.hda_ldda,dataset_id:Z.dataset_id},function(aa){Z.container_div.addClass("line-track");var ad=aa.data;if(isNaN(parseFloat(Z.prefs.min_value))||isNaN(parseFloat(Z.prefs.max_value))){var ab=ad.min,af=ad.max;ab=Math.floor(Math.min(0,Math.max(ab,ad.mean-2*ad.sd)));af=Math.ceil(Math.max(0,Math.min(af,ad.mean+2*ad.sd)));Z.prefs.min_value=ab;Z.prefs.max_value=af;$("#track_"+Z.dataset_id+"_minval").val(Z.prefs.min_value);$("#track_"+Z.dataset_id+"_maxval").val(Z.prefs.max_value)}Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.total_frequency=ad.total_frequency;Z.container_div.find(".yaxislabel").remove();var ae=$("<div/>").text(U(Z.prefs.min_value,3)).make_text_editable({num_cols:6,on_finish:function(ag){$(".bs-tooltip").remove();var ag=parseFloat(ag);if(!isNaN(ag)){Z.set_min_value(ag)}},help_text:"Set min value"}).addClass("yaxislabel bottom").attr("id","linetrack_"+Z.dataset_id+"_minval").prependTo(Z.container_div),ac=$("<div/>").text(U(Z.prefs.max_value,3)).make_text_editable({num_cols:6,on_finish:function(ag){$(".bs-tooltip").remove();var ag=parseFloat(ag);if(!isNaN(ag)){Z.set_max_value(ag)}},help_text:"Set max value"}).addClass("yaxislabel top").attr("id","linetrack_"+Z.dataset_id+"_maxval").prependTo(Z.container_div)})},draw_tile:function(ai,ag,ab,aa,ad,ah){var Z=ag.canvas,ac=ad.get("start"),af=ad.get("end"),ae=new I.LinePainter(ai.data,ac,af,this.prefs,ab);ae.draw(ag,Z.width,Z.height,ah);return new b(this,ad,aa,Z,ai.data)},can_subset:function(Z){return false}});var r=function(ab,aa,ac){var Z=this;this.display_modes=["Heatmap"];this.mode="Heatmap";J.call(this,ab,aa,ac);this.hda_ldda=ac.hda_ldda;this.dataset_id=ac.dataset_id;this.original_dataset_id=this.dataset_id;this.left_offset=0;this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"pos_color",label:"Positive Color",type:"color",default_value:"4169E1"},{key:"negative_color",label:"Negative Color",type:"color",default_value:"FF8C00"},{key:"min_value",label:"Min Value",type:"float",default_value:0},{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:ac.prefs,onchange:function(){Z.set_name(Z.prefs.name);Z.vertical_range=Z.prefs.max_value-Z.prefs.min_value;Z.set_min_value(Z.prefs.min_value);Z.set_max_value(Z.prefs.max_value)}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.vertical_range=this.config.values.max_value-this.config.values.min_value};o(r.prototype,p.prototype,J.prototype,{on_resize:function(){this.request_draw(true)},set_min_value:function(Z){this.prefs.min_value=Z;this.tile_cache.clear();this.request_draw()},set_max_value:function(Z){this.prefs.max_value=Z;this.tile_cache.clear();this.request_draw()},draw_tile:function(aj,ah,ae,ac,aa,ai){var ab=ah.canvas,Z=this._get_tile_bounds(aa,ac),ad=Z[0],ag=Z[1],af=new I.DiagonalHeatmapPainter(aj.data,ad,ag,this.prefs,ae);af.draw(ah,ab.width,ab.height,ai);return new b(this,aa,ac,ab,aj.data)}});var c=function(ac,ab,ae){var aa=this;this.display_modes=["Auto","Coverage","Dense","Squish","Pack"];J.call(this,ac,ab,ae);var ad=get_random_color(),Z=get_random_color([ad,"#ffffff"]);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block color",type:"color",default_value:ad},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:Z},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"histogram_max",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:this.visible_height_px,hidden:true}],saved_values:ae.prefs,onchange:function(){aa.set_name(aa.prefs.name);aa.tile_cache.clear();aa.set_painter_from_config();aa.request_draw()}});this.prefs=this.config.values;this.visible_height_px=this.config.values.height;this.container_div.addClass("feature-track");this.hda_ldda=ae.hda_ldda;this.dataset_id=ae.dataset_id;this.original_dataset_id=ae.dataset_id;this.show_labels_scale=0.001;this.showing_details=false;this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,J.prototype,{set_dataset:function(Z){this.dataset_id=Z.get("id");this.hda_ldda=Z.get("hda_ldda");this.data_manager.set("dataset",Z)},set_painter_from_config:function(){if(this.config.values.connector_style==="arcs"){this.painter=I.ArcLinkedFeaturePainter}else{this.painter=I.LinkedFeaturePainter}},before_draw:function(){this.max_height_px=0},postdraw_actions:function(ao,aj,ae,ad){J.prototype.postdraw_actions.call(this,ao,ad);var ai=this,al;if(ai.mode==="Coverage"){var aa=-1;for(al=0;al<ao.length;al++){var ak=ao[al].max_val;if(ak>aa){aa=ak}}for(al=0;al<ao.length;al++){var aq=ao[al];if(aq.max_val!==aa){aq.html_elt.remove();ai.draw_helper(true,aj,aq.index,aq.resolution,aq.html_elt.parent(),ae,{more_tile_data:{max:aa}})}}}if(ai.filters_manager){var af=ai.filters_manager.filters;for(var an=0;an<af.length;an++){af[an].update_ui_elt()}var ap=false,Z,ag;for(al=0;al<ao.length;al++){if(ao[al].data.length){Z=ao[al].data[0];for(var an=0;an<af.length;an++){ag=af[an];if(ag.applies_to(Z)&&ag.min!==ag.max){ap=true;break}}}}if(ai.filters_available!==ap){ai.filters_available=ap;if(!ai.filters_available){ai.filters_manager.hide()}ai.update_icons()}}this.container_div.find(".yaxislabel").remove();var ac=ao[0];if(ac instanceof j){var ah=(this.prefs.histogram_max?this.prefs.histogram_max:ac.max_val),ab=$("<div/>").text(ah).make_text_editable({num_cols:12,on_finish:function(ar){$(".bs-tooltip").remove();var ar=parseFloat(ar);ai.prefs.histogram_max=(!isNaN(ar)?ar:null);ai.tile_cache.clear();ai.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(ab)}if(ac instanceof L){var am=true;for(al=0;al<ao.length;al++){if(!ao[al].all_slotted){am=false;break}}if(!am){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(Z){var Z;if(this.mode==="Auto"){if(Z==="no_detail"){Z="feature spans"}else{if(Z==="summary_tree"){Z="coverage histogram"}}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+Z+")")}},incremental_slots:function(ad,Z,ac){var aa=this.view.canvas_manager.dummy_context,ab=this.slotters[ad];if(!ab||(ab.mode!==ac)){ab=new (s.FeatureSlotter)(ad,ac,x,function(ae){return aa.measureText(ae)});this.slotters[ad]=ab}return ab.slot_features(Z)},get_mode:function(Z){if(Z.dataset_type==="summary_tree"){mode="summary_tree"}else{if(Z.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>F){mode="Squish"}else{mode="Pack"}}}return mode},get_canvas_height:function(Z,ad,ae,aa){if(ad==="summary_tree"||ad==="Coverage"){return this.summary_draw_height}else{var ac=this.incremental_slots(ae,Z.data,ad);var ab=new (this.painter)(null,null,null,this.prefs,ad);return Math.max(Y,ab.get_required_height(ac,aa))}},draw_tile:function(aj,an,al,ao,ac,ag,ab){var am=this,aa=an.canvas,av=ac.get("start"),Z=ac.get("end"),ad=this.left_offset;if(al==="summary_tree"||al==="Coverage"){var ax=new I.SummaryTreePainter(aj,av,Z,this.prefs);ax.draw(an,aa.width,aa.height,ag);return new j(am,ac,ao,aa,aj.data,aj.max)}var af=[],ak=this.slotters[ag].slots;all_slotted=true;if(aj.data){var ah=this.filters_manager.filters;for(var ap=0,ar=aj.data.length;ap<ar;ap++){var ae=aj.data[ap];var aq=false;var ai;for(var au=0,az=ah.length;au<az;au++){ai=ah[au];ai.update_attrs(ae);if(!ai.keep(ae)){aq=true;break}}if(!aq){af.push(ae);if(!(ae[0] in ak)){all_slotted=false}}}}var ay=(this.filters_manager.alpha_filter?new z(this.filters_manager.alpha_filter):null);var aw=(this.filters_manager.height_filter?new z(this.filters_manager.height_filter):null);var ax=new (this.painter)(af,av,Z,this.prefs,al,ay,aw,ab);var at=null;an.fillStyle=this.prefs.block_color;an.font=an.canvas.manager.default_font;an.textAlign="right";if(aj.data){at=ax.draw(an,aa.width,aa.height,ag,ak);at.translation=-ad}return new L(am,ac,ao,aa,aj.data,ag,al,aj.message,all_slotted,at)},data_and_mode_compatible:function(Z,aa){if(aa==="Auto"){return true}else{if(aa==="Coverage"){return Z.dataset_type==="summary_tree"}else{if(Z.extra_info==="no_detail"||Z.dataset_type==="summary_tree"){return false}else{return true}}}},can_subset:function(Z){if(Z.dataset_type==="summary_tree"||Z.message||Z.extra_info==="no_detail"){return false}return true}});var O=function(aa,Z,ab){c.call(this,aa,Z,ab);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block color",type:"color",default_value:get_random_color()},{key:"label_color",label:"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",type:"string",default_value:this.mode,hidden:true}],saved_values:ab.prefs,onchange:function(){this.track.set_name(this.track.prefs.name);this.track.tile_cache.clear();this.track.request_draw()}});this.prefs=this.config.values;this.painter=I.ReadPainter};o(O.prototype,p.prototype,J.prototype,c.prototype);var R=function(ab,aa,ad){c.call(this,ab,aa,ad);var ac=get_random_color(),Z=get_random_color([ac,"#ffffff"]);this.config=new C({track:this,params:[{key:"name",label:"Name",type:"text",default_value:this.name},{key:"block_color",label:"Block and sense strand color",type:"color",default_value:ac},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:Z},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",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:true},{key:"histogram_max",label:"Histogram maximum",type:"float",default_value:null,help:"Clear value to set automatically"},{key:"mode",type:"string",default_value:this.mode,hidden:true}],saved_values:ad.prefs,onchange:function(){this.track.set_name(this.track.prefs.name);this.track.tile_cache.clear();this.track.request_draw()}});this.prefs=this.config.values;this.painter=I.ReadPainter;this.update_icons()};o(R.prototype,p.prototype,J.prototype,c.prototype);S.View=X;S.DrawableGroup=M;S.LineTrack=i;S.FeatureTrack=c;S.DiagonalHeatmapTrack=r;S.ReadTrack=R;S.VcfTrack=O;S.CompositeTrack=g};var slotting_module=function(c,b){var e=c("class").extend;var d=2,a=5;b.FeatureSlotter=function(i,h,f,g){this.slots={};this.start_end_dct={};this.w_scale=i;this.mode=h;this.include_label=(h==="Pack");this.max_rows=f;this.measureText=g};e(b.FeatureSlotter.prototype,{slot_features:function(m){var p=this.w_scale,h=this.start_end_dct,x=[],z=[],n=0,y=this.max_rows;for(var v=0,w=m.length;v<w;v++){var k=m[v],o=k[0];if(this.slots[o]!==undefined){n=Math.max(n,this.slots[o]);z.push(this.slots[o])}else{x.push(v)}}var q=function(E,F){for(var D=0;D<=y;D++){var B=false,G=h[D];if(G!==undefined){for(var A=0,C=G.length;A<C;A++){var i=G[A];if(F>i[0]&&E<i[1]){B=true;break}}}if(!B){return D}}return -1};for(var v=0,w=x.length;v<w;v++){var k=m[x[v]],o=k[0],t=k[1],f=k[2],r=k[3],g=Math.floor(t*p),l=Math.ceil(f*p),u=this.measureText(r).width,j;if(r!==undefined&&this.include_label){u+=(d+a);if(g-u>=0){g-=u;j="left"}else{l+=u;j="right"}}var s=q(g,l);if(s>=0){if(h[s]===undefined){h[s]=[]}h[s].push([g,l]);this.slots[o]=s;n=Math.max(n,s)}}return n+1}})};var painters_module=function(require,exports){var extend=require("class").extend;var dashedLine=function(ctx,x1,y1,x2,y2,dashLen){if(dashLen===undefined){dashLen=4}var dX=x2-x1;var dY=y2-y1;var dashes=Math.floor(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=dX/dashes;var dashY=dY/dashes;var q;for(q=0;q<dashes;q++,x1+=dashX,y1+=dashY){if(q%2!==0){continue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle=function(ctx,down_vertex_x,down_vertex_y,side_len){var x1=down_vertex_x-side_len/2,x2=down_vertex_x+side_len/2,y=down_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=this.fillStyle;ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=function(default_val){this.default_val=(default_val?default_val:1)};Scaler.prototype.gen_val=function(input){return this.default_val};var Painter=function(data,view_start,view_end,prefs,mode){this.data=data;this.view_start=view_start;this.view_end=view_end;this.prefs=extend({},this.default_prefs,prefs);this.mode=mode};Painter.prototype.default_prefs={};Painter.prototype.draw=function(ctx,width,height,w_scale){};var SummaryTreePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode)};SummaryTreePainter.prototype.default_prefs={show_counts:false};SummaryTreePainter.prototype.draw=function(ctx,width,height,w_scale){var view_start=this.view_start,points=this.data.data,max=(this.prefs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=height;delta_x_px=Math.ceil(this.data.delta*w_scale);ctx.save();for(var i=0,len=points.length;i<len;i++){var x=Math.floor((points[i][0]-view_start)*w_scale);var y=points[i][1];if(!y){continue}var y_px=y/max*height;if(y!==0&&y_px<1){y_px=1}ctx.fillStyle=this.prefs.block_color;ctx.fillRect(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=4;if(this.prefs.show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.fillStyle=this.prefs.label_color;ctx.textAlign="center";ctx.fillText(y,x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][1])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][1])}this.prefs.max_value=max_value}};LinePainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};LinePainter.prototype.draw=function(ctx,width,height,w_scale){var in_path=false,min_value=this.prefs.min_value,max_value=this.prefs.max_value,vertical_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data;ctx.save();var y_zero=Math.round(height+min_value/vertical_range*height);if(mode!=="Intensity"){ctx.fillStyle="#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=Math.ceil((data[1][0]-data[0][0])*w_scale)}else{delta_x_px=10}var pref_color=parseInt(this.prefs.color.slice(1),16),pref_r=(pref_color&16711680)>>16,pref_g=(pref_color&65280)>>8,pref_b=pref_color&255;for(var i=0,len=data.length;i<len;i++){ctx.fillStyle=ctx.strokeStyle=this.prefs.color;x_scaled=Math.round((data[i][0]-view_start-1)*w_scale);y=data[i][1];var top_overflow=false,bot_overflow=false;if(y===null){if(in_path&&mode==="Filled"){ctx.lineTo(x_scaled,height_px)}in_path=false;continue}if(y<min_value){bot_overflow=true;y=min_value}else{if(y>max_value){top_overflow=true;y=max_value}}if(mode==="Histogram"){y=Math.round(y/vertical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(mode==="Intensity"){var saturation=(y-min_value)/vertical_range,new_r=Math.round(pref_r+(255-pref_r)*(1-saturation)),new_g=Math.round(pref_g+(255-pref_g)*(1-saturation)),new_b=Math.round(pref_b+(255-pref_b)*(1-saturation));ctx.fillStyle="rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRect(x_scaled,0,delta_x_px,height_px)}else{y=Math.round(height_px-(y-min_value)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_path=true;if(mode==="Filled"){ctx.moveTo(x_scaled,height_px);ctx.lineTo(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=this.prefs.overflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode==="Histogram"||mode==="Intensity"){overflow_x=delta_x_px}else{x_scaled-=2;overflow_x=4}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.fillStyle=this.prefs.color}if(mode==="Filled"){if(in_path){ctx.lineTo(x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.restore()};var FeaturePositionMapper=function(slot_height){this.feature_positions={};this.slot_height=slot_height;this.translation=0;this.y_translation=0};FeaturePositionMapper.prototype.map_feature_data=function(feature_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature_positions[slot]=[]}this.feature_positions[slot].push({data:feature_data,x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_data=function(x,y){var slot=Math.floor((y-this.y_translation)/this.slot_height),feature_dict;if(!this.feature_positions[slot]){return null}x+=this.translation;for(var i=0;i<this.feature_positions[slot].length;i++){feature_dict=this.feature_positions[slot][i];if(x>=feature_dict.x_start&&x<=feature_dict.x_end){return feature_dict.data}}};var FeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Painter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=(alpha_scaler?alpha_scaler:new Scaler());this.height_scaler=(height_scaler?height_scaler:new Scaler())};FeaturePainter.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_required_height:function(rows_required,width){var required_height=this.get_row_height(),y_scale=required_height,mode=this.mode;if(mode==="no_detail"||mode==="Squish"||mode==="Pack"){required_height=rows_required*y_scale}return required_height+this.get_top_padding(width)+this.get_bottom_padding(width)},get_top_padding:function(width){return 0},get_bottom_padding:function(width){return Math.max(Math.round(this.get_row_height()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=this.data,view_start=this.view_start,view_end=this.view_end;ctx.save();ctx.fillStyle=this.prefs.block_color;ctx.textAlign="right";var y_scale=this.get_row_height(),feature_mapper=new FeaturePositionMapper(y_scale),x_draw_coords;for(var i=0,len=data.length;i<len;i++){var feature=data[i],feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],slot=(slots&&slots[feature_uid]!==undefined?slots[feature_uid]:null);if((feature_start<view_end&&feature_end>view_start)&&(this.mode==="Dense"||slot!==null)){x_draw_coords=this.draw_element(ctx,this.mode,feature,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_feature_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();feature_mapper.y_translation=this.get_top_padding(width);return feature_mapper},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=10,NO_DETAIL_TRACK_HEIGHT=3,SQUISH_TRACK_HEIGHT=5,PACK_TRACK_HEIGHT=10,NO_DETAIL_FEATURE_HEIGHT=1,DENSE_FEATURE_HEIGHT=9,SQUISH_FEATURE_HEIGHT=3,PACK_FEATURE_HEIGHT=9,LABEL_SPACING=2,CONNECTOR_COLOR="#ccc";var LinkedFeaturePainter=function(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.draw_background_connector=true;this.draw_individual_connectors=false};extend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var mode=this.mode,height;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="no_detail"){height=NO_DETAIL_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2]-1,feature_name=feature[3],feature_strand=feature[4],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),draw_start=f_start,draw_end=f_end,y_center=(mode==="Dense"?0:(0+slot))*y_scale+this.get_top_padding(width),thickness,y_start,thick_start=null,thick_end=null,block_color=(!feature_strand||feature_strand==="+"||feature_strand==="."?this.prefs.block_color:this.prefs.reverse_strand_color);label_color=this.prefs.label_color;ctx.globalAlpha=this.alpha_scaler.gen_val(feature);if(mode==="Dense"){slot=1}if(mode==="no_detail"){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HEIGHT)}else{var feature_ts=feature[5],feature_te=feature[6],feature_blocks=feature[7],full_height=true;if(feature_ts&&feature_te){thick_start=Math.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=Math.ceil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_height,thick_height;if(mode==="Squish"){thin_height=1;thick_height=SQUISH_FEATURE_HEIGHT;full_height=false}else{if(mode==="Dense"){thin_height=5;thick_height=DENSE_FEATURE_HEIGHT}else{thin_height=5;thick_height=PACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_strand&&full_height){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_center,cur_height;if(mode==="Squish"||mode==="Dense"){cur_y_center=y_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}else{if(feature_strand){cur_y_center=y_center;cur_height=thick_height}else{cur_y_center+=(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}}if(this.draw_background_connector){if(mode==="Squish"||mode==="Dense"){ctx.fillStyle=CONNECTOR_COLOR}else{if(feature_strand){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand")}}}else{ctx.fillStyle=CONNECTOR_COLOR}}ctx.fillRect(f_start,cur_y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=0,k_len=feature_blocks.length;k<k_len;k++){var block=feature_blocks[k],block_start=Math.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=Math.ceil(Math.min(width,Math.max((block[1]-1-tile_low)*w_scale))),last_block_start,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=block_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,block_end-block_start,thin_height);if(thick_start!==undefined&&feature_te>feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thick_start=Math.max(block_start,thick_start),block_thick_end=Math.min(block_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height);if(feature_blocks.length===1&&mode==="Pack"){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}if(block_thick_start+14<block_thick_end){block_thick_start+=2;block_thick_end-=2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_end,y_center)}last_block_start=block_start;last_block_end=block_end}if(mode==="Pack"){ctx.globalAlpha=1;ctx.fillStyle="white";var hscale_factor=this.height_scaler.gen_val(feature),new_height=Math.ceil(thick_height*hscale_factor),ws_height=Math.round((thick_height-new_height)/2);if(hscale_factor!==1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,ws_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-f_start,ws_height)}}}ctx.globalAlpha=1;if(feature_name&&mode==="Pack"&&feature_start>tile_low){ctx.fillStyle=label_color;if(tile_low===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=ctx.measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=ctx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=1;return[draw_start,draw_end]}});var ReadPainter=function(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_seq=(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var height,mode=this.mode;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT;if(this.prefs.show_insertions){height*=2}}}return height},draw_read:function(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,orig_seq){ctx.textAlign="center";var tile_region=[tile_low,tile_high],base_offset=0,seq_offset=0,gap=0,char_width_px=ctx.canvas.manager.char_width_px,block_color=(strand==="+"?this.prefs.block_color:this.prefs.reverse_strand_color);var draw_last=[];if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){gap=Math.round(w_scale/2)}if(!cigar){cigar=[[0,orig_seq.length]]}for(var cig_id=0,len=cigar.length;cig_id<len;cig_id++){var cig=cigar[cig_id],cig_op="MIDNSHP=X"[cig[0]],cig_len=cig[1];if(cig_op==="H"||cig_op==="S"){base_offset-=cig_len}var seq_start=(feature_start-1)+base_offset,s_start=Math.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=Math.floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start===s_end){s_end+=1}switch(cig_op){case"H":break;case"S":case"M":case"=":if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=orig_seq.slice(seq_offset,seq_offset+cig_len);if(gap>0){ctx.fillStyle=block_color;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=CONNECTOR_COLOR;for(var c=0,str_len=seq.length;c<str_len;c++){if(this.prefs.show_differences){if(this.ref_seq){var ref_char=this.ref_seq[seq_start-tile_low+c];if(!ref_char||ref_char.toLowerCase()===seq[c].toLowerCase()){continue}}else{continue}}if(seq_start+c>=tile_low&&seq_start+c<=tile_high){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=block_color;ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_offset+=cig_len;base_offset+=cig_len;break;case"N":ctx.fillStyle=CONNECTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset+=cig_len;break;case"D":ctx.fillStyle="red";ctx.fillRect(s_start-gap,y_center+4,s_end-s_start,3);base_offset+=cig_len;break;case"P":break;case"I":var insert_x_coord=s_start-gap;if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=orig_seq.slice(seq_offset,seq_offset+cig_len);if(this.prefs.show_insertions){var x_center=s_start-(s_end-s_start)/2;if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){ctx.fillStyle="yellow";ctx.fillRect(x_center-gap,y_center-9,s_end-s_start,9);draw_last[draw_last.length]={type:"triangle",data:[insert_x_coord,y_center+4,5]};ctx.fillStyle=CONNECTOR_COLOR;switch(compute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_START):seq=seq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=seq.slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS):seq=seq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c=0,str_len=seq.length;c<str_len;c++){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_start)/2,y_center)}}else{ctx.fillStyle="yellow";ctx.fillRect(x_center,y_center+(this.mode!=="Dense"?2:5),s_end-s_start,(mode!=="Dense"?SQUISH_FEATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode==="Pack"||this.mode==="Auto")&&orig_seq!==undefined&&w_scale>char_width_px){draw_last.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}seq_offset+=cig_len;break;case"X":seq_offset+=cig_len;break}}ctx.fillStyle="yellow";var item,type,data;for(var i=0;i<draw_last.length;i++){item=draw_last[i];type=item.type;data=item.data;if(type==="text"){ctx.save();ctx.font="bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]);ctx.restore()}else{if(type==="triangle"){drawDownwardEquilateralTriangle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],feature_name=feature[3],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),y_center=(mode==="Dense"?0:(0+slot))*y_scale,label_color=this.prefs.label_color,gap=0;if((mode==="Pack"||this.mode==="Auto")&&w_scale>ctx.canvas.manager.char_width_px){var gap=Math.round(w_scale/2)}if(feature[5] instanceof Array){var b1_start=Math.floor(Math.max(0,(feature[4][0]-tile_low)*w_scale)),b1_end=Math.ceil(Math.min(width,Math.max(0,(feature[4][1]-tile_low)*w_scale))),b2_start=Math.floor(Math.max(0,(feature[5][0]-tile_low)*w_scale)),b2_end=Math.ceil(Math.min(width,Math.max(0,(feature[5][1]-tile_low)*w_scale))),connector=true;if(feature[4][1]>=tile_low&&feature[4][0]<=tile_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=false}if(feature[5][1]>=tile_low&&feature[5][0]<=tile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5][4])}else{connector=false}if(connector&&b2_start>b1_end){ctx.fillStyle=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,feature_start,feature[4],feature[5],feature[6])}if(mode==="Pack"&&feature_start>tile_low&&feature_name!=="."){ctx.fillStyle=this.prefs.label_color;var tile_index=1;if(tile_index===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING-gap,y_center+8)}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.longest_feature_length=this.calculate_longest_feature_length();this.draw_background_connector=false;this.draw_individual_connectors=true};extend(ArcLinkedFeaturePainter.prototype,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest_feature_length:function(){var longest_feature_length=0;for(var i=0,len=this.data.length;i<len;i++){var feature=this.data[i],feature_start=feature[1],feature_end=feature[2];longest_feature_length=Math.max(longest_feature_length,feature_end-feature_start)}return longest_feature_length},get_top_padding:function(width){var view_range=this.view_end-this.view_start,w_scale=width/view_range;return Math.min(128,Math.ceil((this.longest_feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block1_end,block2_start,block2_end,y_center){var x_center=(block1_end+block2_start)/2,radius=block2_start-x_center;var angle1=Math.PI,angle2=0;if(radius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Math.PI,0);ctx.stroke()}}});var Color=function(rgb,a){if(Array.isArray(rgb)){this.rgb=rgb}else{if(rgb.length==6){this.rgb=rgb.match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{this.rgb=rgb.split("").map(function(c){return parseInt(c+c,16)})}}this.alpha=typeof(a)==="number"?a:1};Color.prototype={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=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")}},toHSL:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2,d=max-min;if(max===min){h=s=0}else{s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,l:l,a:a}},toARGB:function(){var argb=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")},mix:function(color2,weight){color1=this;var p=weight;var w=p*2-1;var a=color1.toHSL().a-color2.toHSL().a;var w1=(((w*a==-1)?w:(w+a)/(1+w*a))+1)/2;var w2=1-w1;var rgb=[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=color1.alpha*p+color2.alpha*(1-p);return new Color(rgb,alpha)}};var LinearRamp=function(start_color,end_color,start_value,end_value){this.start_color=new Color(start_color);this.end_color=new Color(end_color);this.start_value=start_value;this.end_value=end_value;this.value_range=end_value-start_value};LinearRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);value=(value-this.start_value)/this.value_range;return this.start_color.mix(this.end_color,1-value).toCSS()};var SplitRamp=function(start_color,middle_color,end_color,start_value,end_value){this.positive_ramp=new LinearRamp(middle_color,end_color,0,end_value);this.negative_ramp=new LinearRamp(middle_color,start_color,0,-start_value);this.start_value=start_value;this.end_value=end_value};SplitRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);if(value>=0){return this.positive_ramp.map_value(value)}else{return this.negative_ramp.map_value(-value)}};var DiagonalHeatmapPainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][5])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][5])}this.prefs.max_value=max_value}};DiagonalHeatmapPainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Heatmap",pos_color:"4169E1",neg_color:"FF8C00"};DiagonalHeatmapPainter.prototype.draw=function(ctx,width,height,w_scale){var min_value=this.prefs.min_value,max_value=this.prefs.max_value,value_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data,invsqrt2=1/Math.sqrt(2);var ramp=(new SplitRamp(this.prefs.neg_color,"FFFFFF",this.prefs.pos_color,min_value,max_value));var d,s1,e1,s2,e2,value;var scale=function(p){return(p-view_start)*w_scale};ctx.save();ctx.rotate(-45*Math.PI/180);ctx.scale(invsqrt2,invsqrt2);for(var i=0,len=data.length;i<len;i++){d=data[i];s1=scale(d[1]);e1=scale(d[2]);s2=scale(d[4]);e2=scale(d[5]);value=d[6];ctx.fillStyle=(ramp.map_value(value));ctx.fillRect(s1,s2,(e1-s1),(e2-s2))}ctx.restore()};exports.Scaler=Scaler;exports.SummaryTreePainter=SummaryTreePainter;exports.LinePainter=LinePainter;exports.LinkedFeaturePainter=LinkedFeaturePainter;exports.ReadPainter=ReadPainter;exports.ArcLinkedFeaturePainter=ArcLinkedFeaturePainter;exports.DiagonalHeatmapPainter=DiagonalHeatmapPainter};(function(d){var c={};var b=function(e){return c[e]};var a=function(f,g){var e={};g(b,e);c[f]=e};a("class",class_module);a("slotting",slotting_module);a("painters",painters_module);a("trackster",trackster_module);for(key in c.trackster){d[key]=c.trackster[key]}})(window); \ No newline at end of file diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da 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> -${h.js( "libs/jquery/jquery.ui.core", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} +${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} ${h.css( "dynatree_skin/ui.dynatree" )} <script type="text/javascript"> diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da templates/admin/tool_shed_repository/browse_repository.mako --- a/templates/admin/tool_shed_repository/browse_repository.mako +++ b/templates/admin/tool_shed_repository/browse_repository.mako @@ -9,7 +9,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.ui.core", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.dynatree" )} ${browse_files(repository.name, repository.repo_files_directory(trans.app))} </%def> diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da templates/admin/tool_shed_repository/browse_tool_dependency.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 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.ui.core", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.dynatree" )} ${browse_files(tool_dependency.name, tool_dependency.installation_directory( trans.app ))} </%def> diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -11,7 +11,7 @@ <%def name="stylesheets()"> ${parent.stylesheets()} - ${h.css( "history", "autocomplete_tagging", "trackster", "overcast/jquery-ui-1.8.5.custom", "library" )} + ${h.css( "history", "autocomplete_tagging", "trackster", "library", "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )} </%def><%def name="javascripts()"> @@ -21,7 +21,7 @@ <script type='text/javascript' src="${h.url_for('/static/scripts/libs/IE/excanvas.js')}"></script><![endif]--> -${h.js( "galaxy.base", "galaxy.panels", "libs/json2", "libs/jquery/jquery", "libs/bootstrap", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery.autocomplete", "mvc/data", "viz/visualization", "viz/trackster", "viz/trackster_ui", "libs/jquery/jquery.ui.sortable.slider", "libs/farbtastic" )} +${h.js( "galaxy.base", "galaxy.panels", "libs/json2", "libs/jquery/jquery", "libs/bootstrap", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui-1.8.23.custom.min", "mvc/data", "viz/visualization", "viz/trackster", "viz/trackster_ui", "libs/jquery/jquery.ui.sortable.slider", "libs/farbtastic" )} <script type="text/javascript"> // diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da templates/webapps/community/repository/browse_repository.mako --- a/templates/webapps/community/repository/browse_repository.mako +++ b/templates/webapps/community/repository/browse_repository.mako @@ -57,7 +57,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.rating", "libs/jquery/jquery.ui.core", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery.rating", "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} ${common_javascripts(repository)} </%def> diff -r 631c9dbca9bc83223b886e01c8ae7f676ae8c599 -r 9287f22c692087319003516fe1a5da0eb07c63da templates/webapps/community/repository/upload.mako --- a/templates/webapps/community/repository/upload.mako +++ b/templates/webapps/community/repository/upload.mako @@ -28,7 +28,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.ui.core", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} + ${h.js( "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )} ${common_javascripts(repository)} <script type="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