[llvm-commits] [LNT] r162706 - in /lnt/trunk/lnt/server/ui: static/v4_global_status.js templates/v4_global_status.html
Michael Gottesman
mgottesman at apple.com
Mon Aug 27 15:59:28 PDT 2012
Author: mgottesman
Date: Mon Aug 27 17:59:28 2012
New Revision: 162706
URL: http://llvm.org/viewvc/llvm-project?rev=162706&view=rev
Log:
[LNT] Fixed a bug where after choosing a different field to view, using the right click show graph functionality failed to work.
The specific issue occured because in a previous commit I changed the url field encoding to the actual name of the field so that
the code was more general. I failed to change the code which generated the correct url for the graph for a specific test. Additionally,
even on the first load the index generated could be incorrect since I used field.id instead of field.index.
Modified:
lnt/trunk/lnt/server/ui/static/v4_global_status.js
lnt/trunk/lnt/server/ui/templates/v4_global_status.html
Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.js?rev=162706&r1=162705&r2=162706&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/v4_global_status.js (original)
+++ lnt/trunk/lnt/server/ui/static/v4_global_status.js Mon Aug 27 17:59:28 2012
@@ -14,7 +14,9 @@
var g = {};
/* Initialization */
- $(document).ready(function() {
+ m.init = function(field) {
+ g.field = field;
+
// Create a global variable for table.
g.table = $('#data-table')[0];
@@ -53,18 +55,13 @@
bindings: {
'contextMenu-runpage' : function(elt) {
var new_base = elt.getAttribute('run_id') + '/graph?test.';
-
- field = GetQueryParameterByName('field');
- if (field == "")
- field = 2; // compile time.
-
- new_base += elt.getAttribute('test_id') + '=' + field.toString();
+ new_base += elt.getAttribute('test_id') + '=' + g.field.toString();
window.location = UrlReplaceBasename(window.location.toString(),
new_base);
}
}
});
- });
+ };
/* Helper Functions */
@@ -81,17 +78,6 @@
return without_base + new_basename;
}
- function GetQueryParameterByName(name) {
- name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
- var regexS = "[\\?&]" + name + "=([^&#]*)";
- var regex = new RegExp(regexS);
- var results = regex.exec(window.location.search);
- if(results == null)
- return "";
- else
- return decodeURIComponent(results[1].replace(/\+/g, " "));
- }
-
function IsHidden(elem) {
return elem.offsetWidth === 0 && elem.offsetHeight === 0;
}
Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=162706&r1=162705&r2=162706&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 27 17:59:28 2012
@@ -39,6 +39,12 @@
}
{% endfor %}
</style>
+
+ <script language="javascript" type="text/javascript">
+ $(document).ready(function() {
+ v4_global_status.init("{{ selected_field.index }}");
+ });
+ </script>
{% endblock %}
{% block title %}Global Status - {{ selected_field.title }}{% endblock %}
More information about the llvm-commits
mailing list