1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/9b13c3554a09/ changeset: 9b13c3554a09 user: jgoecks date: 2012-09-13 21:51:50 summary: Add mako template for rendering common trackster dependencies. This fixes shared/embedded visualizations, which were broken in recent commits. affected #: 5 files diff -r cc064ff4249b2701198a4121154f62182cd048ce -r 9b13c3554a09eefd75387f1740ed9e4b0c32c50f templates/base_panels.mako --- a/templates/base_panels.mako +++ b/templates/base_panels.mako @@ -48,7 +48,7 @@ <!--[if lt IE 7]> ${h.js( 'libs/IE/IE7', 'libs/IE/ie7-recalc' )} <![endif]--> - ${h.js( 'libs/jquery/jquery', 'libs/json2', 'libs/bootstrap', 'libs/underscore', 'libs/backbone/backbone', 'libs/backbone/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui' )} + ${h.js( 'libs/jquery/jquery', 'libs/json2', 'libs/bootstrap', 'libs/underscore', 'libs/backbone/backbone', 'libs/backbone/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui', 'galaxy.base' )} <script type="text/javascript"> // Set up needed paths. var galaxy_paths = new GalaxyPaths({ @@ -73,7 +73,7 @@ <%def name="late_javascripts()"> ## Scripts can be loaded later since they progressively add features to ## the panels, but do not change layout - ${h.js( 'libs/jquery/jquery.event.drag', 'libs/jquery/jquery.event.hover', 'libs/jquery/jquery.form', 'libs/jquery/jquery.rating', 'galaxy.base', 'galaxy.panels' )} + ${h.js( 'libs/jquery/jquery.event.drag', 'libs/jquery/jquery.event.hover', 'libs/jquery/jquery.form', 'libs/jquery/jquery.rating', 'galaxy.panels' )} <script type="text/javascript"> ensure_dd_helper(); diff -r cc064ff4249b2701198a4121154f62182cd048ce -r 9b13c3554a09eefd75387f1740ed9e4b0c32c50f templates/display_base.mako --- a/templates/display_base.mako +++ b/templates/display_base.mako @@ -11,6 +11,7 @@ <%inherit file="${inherit( context )}"/><%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" /><%namespace file="/display_common.mako" import="*" /> +<%namespace file="/visualization/trackster_common.mako" import="*" /> ## ## Functions used by base.mako and base_panels.mako to display content. @@ -33,8 +34,8 @@ <%def name="javascripts()"> ${parent.javascripts()} ${h.js( "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating", - "galaxy.autocom_tagging", "viz/trackster", "viz/trackster_ui", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.mousewheel", - "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.ui.sortable.slider", "libs/farbtastic", "mvc/data", "viz/visualization" )} + "galaxy.autocom_tagging" )} + ${render_trackster_js_files()} <script type="text/javascript"> @@ -113,7 +114,8 @@ <%def name="stylesheets()"> ${parent.stylesheets()} - ${h.css( "autocomplete_tagging", "embed_item", "trackster", "jquery.rating", "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )} + ${h.css( "autocomplete_tagging", "embed_item", "jquery.rating" )} + ${render_trackster_css_files()} <style type="text/css"> .page-body { diff -r cc064ff4249b2701198a4121154f62182cd048ce -r 9b13c3554a09eefd75387f1740ed9e4b0c32c50f templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -1,4 +1,5 @@ <%inherit file="/webapps/galaxy/base_panels.mako"/> +<%namespace file="/visualization/trackster_common.mako" import="*" /><%def name="init()"><% @@ -11,7 +12,7 @@ <%def name="stylesheets()"> ${parent.stylesheets()} - ${h.css( "history", "autocomplete_tagging", "trackster", "library", "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )} + ${render_trackster_css_files()} </%def><%def name="javascripts()"> @@ -21,7 +22,7 @@ <script type='text/javascript' src="${h.url_for('/static/scripts/libs/IE/excanvas.js')}"></script><![endif]--> -${h.js( "galaxy.panels", "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/farbtastic" )} +${render_trackster_js_files()} <script type="text/javascript"> // @@ -30,17 +31,10 @@ galaxy_paths.set({ visualization_url: "${h.url_for( action='save' )}" }); - var - add_track_async_url = "${h.url_for( action='add_track_async' )}", - add_datasets_url = "${h.url_for( action='list_current_history_datasets' )}", - default_data_url = "${h.url_for( action='data' )}", - raw_data_url = "${h.url_for( action='raw_data' )}", - reference_url = "${h.url_for( action='reference' )}", - chrom_url = "${h.url_for( action='chroms' )}", - dataset_state_url = "${h.url_for( action='dataset_state' )}", - converted_datasets_state_url = "${h.url_for( action='converted_datasets_state' )}", - feature_search_url = "${h.url_for( action='search_features' )}", - view, + + ${render_trackster_js_vars()} + + var view, browser_router; /** diff -r cc064ff4249b2701198a4121154f62182cd048ce -r 9b13c3554a09eefd75387f1740ed9e4b0c32c50f templates/visualization/display.mako --- a/templates/visualization/display.mako +++ b/templates/visualization/display.mako @@ -1,4 +1,5 @@ <%inherit file="/display_base.mako"/> +<%namespace file="/visualization/trackster_common.mako" import="*" /><%def name="javascripts()"><% config = item_data %> @@ -54,20 +55,9 @@ <script type="text/javascript"> // TODO: much of this code is copied from browser.mako -- create shared base and use in both places. - - // - // Place URLs here so that url_for can be used to generate them. - // - var default_data_url = "${h.url_for( controller='/tracks', action='data' )}", - raw_data_url = "${h.url_for( controller='/tracks', action='raw_data' )}", - run_tool_url = "${h.url_for( controller='/tracks', action='run_tool' )}", - rerun_tool_url = "${h.url_for( controller='/tracks', action='rerun_tool' )}", - reference_url = "${h.url_for( controller='/tracks', action='reference' )}", - chrom_url = "${h.url_for( controller='/tracks', action='chroms' )}", - dataset_state_url = "${h.url_for( controller='/tracks', action='dataset_state' )}", - converted_datasets_state_url = "${h.url_for( controller='/tracks', action='converted_datasets_state' )}", - addable_track_types = { "LineTrack": LineTrack, "FeatureTrack": FeatureTrack, "ReadTrack": ReadTrack }, - view, + ${render_trackster_js_vars()} + + var view, container_element = $("#${trans.security.encode_id( visualization.id )}"); $(function() { diff -r cc064ff4249b2701198a4121154f62182cd048ce -r 9b13c3554a09eefd75387f1740ed9e4b0c32c50f templates/visualization/trackster_common.mako --- /dev/null +++ b/templates/visualization/trackster_common.mako @@ -0,0 +1,28 @@ +## +## Utilities for creating Trackster visualizations. +## + +## Render needed CSS files. +<%def name="render_trackster_css_files()"> + ${h.css( "history", "autocomplete_tagging", "trackster", "library", + "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )} +</%def> + + +## Render needed JavaScript files. +<%def name="render_trackster_js_files()"> + ${h.js( "galaxy.panels", "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/farbtastic" )} +</%def> + +## Render a block of JavaScript that contains all necessary variables for Trackster. +<%def name="render_trackster_js_vars()"> + var add_track_async_url = "${h.url_for( controller='/tracks', action='add_track_async' )}", + add_datasets_url = "${h.url_for( controller='/tracks', action='list_current_history_datasets' )}", + default_data_url = "${h.url_for( controller='/tracks', action='data' )}", + raw_data_url = "${h.url_for( controller='/tracks', action='raw_data' )}", + reference_url = "${h.url_for( controller='/tracks', action='reference' )}", + chrom_url = "${h.url_for( controller='/tracks', action='chroms' )}", + dataset_state_url = "${h.url_for( controller='/tracks', action='dataset_state' )}", + converted_datasets_state_url = "${h.url_for( controller='/tracks', action='converted_datasets_state' )}", + feature_search_url = "${h.url_for( controller='/tracks', action='search_features' )}"; +</%def> \ No newline at end of file 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.