From: <zn...@us...> - 2009-05-26 09:39:07
|
Revision: 890 http://crackerjack.svn.sourceforge.net/crackerjack/?rev=890&view=rev Author: znz Date: 2009-05-26 09:38:58 +0000 (Tue, 26 May 2009) Log Message: ----------- add permalink after changed Modified Paths: -------------- trunk/viewsite/app/views/compare_results/index.html.erb trunk/viewsite/public/javascripts/application.js Modified: trunk/viewsite/app/views/compare_results/index.html.erb =================================================================== --- trunk/viewsite/app/views/compare_results/index.html.erb 2009-05-26 09:38:28 UTC (rev 889) +++ trunk/viewsite/app/views/compare_results/index.html.erb 2009-05-26 09:38:58 UTC (rev 890) @@ -4,8 +4,10 @@ <li><%= link_to 'Distribution Kernels', cjk_path %></li> <li><%= link_to 'Vanilla Kernels', :row => '!d', :col => '!d' %></li> <li><%= link_to 'All Kernels', :row => 'all', :col => 'all' %></li> + <li id="permalink_container" style="display:none"><%= link_to 'Permalink', { :row => nil, :col => nil }, { :id => "permalink" } %></li> </ul> + <%- all = ExecuteResult.all -%> <table style="margin: 1em"> <tr> Modified: trunk/viewsite/public/javascripts/application.js =================================================================== --- trunk/viewsite/public/javascripts/application.js 2009-05-26 09:38:28 UTC (rev 889) +++ trunk/viewsite/public/javascripts/application.js 2009-05-26 09:38:58 UTC (rev 890) @@ -2,15 +2,25 @@ // This file is automatically included by javascript_include_tag :defaults App = {}; +App.updatePermalink = function() { + if (!App.permalink_base) { + App.permalink_base = jQuery("#permalink").attr("href"); + } + var href = App.permalink_base + '?col=' + App.getIds(".col_name") + '&row=' + App.getIds(".row_name"); + jQuery("#permalink").attr("href", href); + jQuery("#permalink_container").show(); +}; App.removeRow = function(row_id) { var row_name = jQuery.trim(jQuery('#row_name_' + row_id).html()); jQuery("#row_add").append("<option value='" + row_id+">" + row_name + "</option>"); jQuery('#row_' + row_id).remove(); + App.updatePermalink(); }; App.removeCol = function(col_id) { var col_name = jQuery.trim(jQuery('#col_name_' + col_id).html()); jQuery("#col_add").append("<option value='" + col_id+">" + col_name + "</option>"); jQuery('.col_' + col_id).remove(); + App.updatePermalink(); }; App.getIds = function(css){ var ids = []; @@ -34,6 +44,7 @@ var delete_col_buttons = jQuery("#deleteColButtons"); jQuery(matched[0]).insertBefore(delete_col_buttons); jQuery(option).remove(); + App.updatePermalink(); } catch(e) { alert(e); } @@ -53,6 +64,7 @@ jQuery(e).before(matched[i]); }); jQuery(option).remove(); + App.updatePermalink(); } catch(e) { alert(e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |