[hg] galaxy 3332: Make slugging editing possible on IE.
details: http://www.bx.psu.edu/hg/galaxy/rev/ef0622415211 changeset: 3332:ef0622415211 user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Feb 04 16:23:32 2010 -0500 description: Make slugging editing possible on IE. diffstat: static/scripts/galaxy.base.js | 2 ++ templates/sharing_base.mako | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diffs (59 lines): diff -r 212ee5294e56 -r ef0622415211 static/scripts/galaxy.base.js --- a/static/scripts/galaxy.base.js Thu Feb 04 11:56:58 2010 -0500 +++ b/static/scripts/galaxy.base.js Thu Feb 04 16:23:32 2010 -0500 @@ -222,6 +222,8 @@ t.blur( function() { $(this).remove(); $("#" + text_elt_id).show(); + if (on_finish != null) + on_finish(t); }); t.keyup( function( e ) { if ( e.keyCode == 27 ) { diff -r 212ee5294e56 -r ef0622415211 templates/sharing_base.mako --- a/templates/sharing_base.mako Thu Feb 04 11:56:58 2010 -0500 +++ b/templates/sharing_base.mako Thu Feb 04 16:23:32 2010 -0500 @@ -25,10 +25,9 @@ // var on_start = function( text_elt ) { - // Because text element is inside a URL, need to disable click so that clicking on element does not trigger URL. - $( text_elt ).click( function() { - return false; - }); + // Replace URL with URL text. + $('#item-url').hide(); + $('#item-url-text').show(); // Allow only lowercase alphanumeric and '-' characters in slug. text_elt.keyup(function(){ @@ -38,9 +37,15 @@ var on_finish = function( text_elt ) { + // Replace URL text with URL. + $('#item-url-text').hide(); + $('#item-url').show(); + // Set URL to new value. + var new_url = $('#item-url-text').text(); var item_url_obj = $('#item-url'); - item_url_obj.attr( "href", item_url_obj.text() ); + item_url_obj.attr( "href", new_url ); + item_url_obj.text( new_url ); }; <% controller_name = get_controller_name( item ) %> @@ -117,7 +122,11 @@ url = h.url_for( action='display_by_username_and_slug', username=trans.get_user().username, slug=item.slug, qualified=True ) url_parts = url.split("/") %> - <a id="item-url" href="${url}" target="_top">${"/".join( url_parts[:-1] )}/<span id='item-identifier'>${url_parts[-1]}</span></a> + <a id="item-url" href="${url}" target="_top">${url}</a> + <span id="item-url-text" style="display: none"> + ${"/".join( url_parts[:-1] )}/<span id='item-identifier'>${url_parts[-1]}</span> + </span> + <a href="#" id="edit-identifier"><img src="${h.url_for('/static/images/pencil.png')}"/></a> </blockquote>
participants (1)
-
Greg Von Kuster