Jason Guiditta
2008-Aug-14 17:00 UTC
[Ovirt-devel] [PATCH] Fix broken js cause by svg widget. (revised)
This just disables the calls to svg widget within any flexigrids, which is the cause of checkboxes not appearing, details not showing, and other such unpleasantness. Next step would be to replace these bits with css bar graphs, which will hopefully make it in shortly, but as this breakage is annoying, thought I would do a quick fix. Left it as commented out since the very next step is to replace with css and I want to easily see what I am replacing. --- wui/src/app/views/graph/_load_graph.rhtml | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wui/src/app/views/graph/_load_graph.rhtml b/wui/src/app/views/graph/_load_graph.rhtml index f6827b2..6678e90 100644 --- a/wui/src/app/views/graph/_load_graph.rhtml +++ b/wui/src/app/views/graph/_load_graph.rhtml @@ -5,10 +5,10 @@ function load_widget(div, target){ var id = $(div).html(); $(div).html(''); $(div).addClass("load_graph"); - $(div).svg(); - var svg = svgManager.getSVGFor(div); + //$(div).svg(); + //var svg = svgManager.getSVGFor(div); var params = { id:1, type:"json", timeframe:"7 days", isJSON:true}; - $.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params, + /*$.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params, function(response){ svg.graph.noDraw(); svg.graph.chartFormat('white', 'white'). @@ -25,10 +25,10 @@ function load_widget(div, target){ svg.graph.legend.show(false); svg.graph.redraw(); } - ); + );*/ // $(div).children().filter("svg").attr('height', 25).attr('width', 200); - $(div).children().filter("svg").attr("height").baseVal.value = 25; - $(div).children().filter("svg").attr("width").baseVal.value = 200; + //$(div).children().filter("svg").attr("height").baseVal.value = 25; + //$(div).children().filter("svg").attr("width").baseVal.value = 200; }; // invoked when a row containing a load widgit is selected @@ -38,11 +38,11 @@ function toggle_load_widget(div, state){ color = '#D5EFFC'; } - var graph = svgManager.getSVGFor(div).graph; + /*var graph = svgManager.getSVGFor(div).graph; graph.noDraw().chartFormat(color, color); graph.xAxis.line(color, 0); graph.yAxis.line(color, 0); - graph.redraw(); + graph.redraw();*/ }; function load_widget_select(selected_row) -- 1.5.5.1
David Lutterkort
2008-Aug-14 17:10 UTC
[Ovirt-devel] [PATCH] Fix broken js cause by svg widget. (revised)
On Thu, 2008-08-14 at 13:00 -0400, Jason Guiditta wrote:> This just disables the calls to svg widget within any flexigrids, > which is the cause of checkboxes not appearing, details not showing, > and other such unpleasantness. Next step would be to replace these > bits with css bar graphs, which will hopefully make it in shortly, but > as this breakage is annoying, thought I would do a quick fix. Left it > as commented out since the very next step is to replace with css and I > want to easily see what I am replacing.If the goal is to simply make these things work again, this patch works for me: it simply bypasses the check for SVG support. The way graphs are turned off is what ultimately leads to disappearing checkboxes etc. because of cascading JS errors. Running with this patch has worked fine for me with FF 3 and galeon. And you still get to look at the graphs :) commit a9054e690d18e915abbc30efb0d2e6902f0fe1ae Author: David Lutterkort <dlutter at redhat.com> Date: Wed Jul 30 17:56:58 2008 -0700 Make jquery/SVG slightly less busted (ugly hack) diff --git a/wui/src/app/views/layouts/redux.rhtml b/wui/src/app/views/layouts/redux.rhtml index 924f300..bcabe91 100644 --- a/wui/src/app/views/layouts/redux.rhtml +++ b/wui/src/app/views/layouts/redux.rhtml @@ -23,7 +23,7 @@ <%= javascript_include_tag "flexigrid.js" -%> <%= javascript_include_tag "facebox.js" -%> <%= javascript_include_tag "jquery.timers.js" -%> - <%= javascript_include_tag "jquery-svg/jquery.svg.pack.js" -%> + <%= javascript_include_tag "jquery-svg/jquery.svg.js" -%> <!--%= javascript_include_tag "jquery-svg/jquery.svgfilter.js" -%--> <%= javascript_include_tag "jquery-svg/jquery.svggraph.js" -%> <!--%= javascript_include_tag "jquery.ui-1.5b4/ui.core.js" -%> diff --git a/wui/src/public/javascripts/jquery-svg/jquery.svg.js b/wui/src/public/javascripts/jquery-svg/jquery.svg.js index dea8794..8dc7768 100644 --- a/wui/src/public/javascripts/jquery-svg/jquery.svg.js +++ b/wui/src/public/javascripts/jquery-svg/jquery.svg.js @@ -45,7 +45,7 @@ $.extend(SVGManager.prototype, { '" height="' + container.clientHeight + '" src="blank.svg"/>'; this._settings[id] = [container, loadURL, settings, onLoad]; } - else if (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG","1.1") || + else if (true || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG","1.1") || document.implementation.hasFeature("org.w3c.svg", "1.1")) { svg = document.createElementNS(this.svgNS, 'svg'); svg.setAttribute('version', '1.1');
Scott Seago
2008-Aug-14 17:35 UTC
[Ovirt-devel] [PATCH] Fix broken js cause by svg widget. (revised)
Jason Guiditta wrote:> This just disables the calls to svg widget within any flexigrids, which is the cause of checkboxes not appearing, details not showing, and other such unpleasantness. Next step would be to replace these bits with css bar graphs, which will hopefully make it in shortly, but as this breakage is annoying, thought I would do a quick fix. Left it as commented out since the very next step is to replace with css and I want to easily see what I am replacing. > --- > wui/src/app/views/graph/_load_graph.rhtml | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/wui/src/app/views/graph/_load_graph.rhtml b/wui/src/app/views/graph/_load_graph.rhtml > index f6827b2..6678e90 100644 > --- a/wui/src/app/views/graph/_load_graph.rhtml > +++ b/wui/src/app/views/graph/_load_graph.rhtml > @@ -5,10 +5,10 @@ function load_widget(div, target){ > var id = $(div).html(); > $(div).html(''); > $(div).addClass("load_graph"); > - $(div).svg(); > - var svg = svgManager.getSVGFor(div); > + //$(div).svg(); > + //var svg = svgManager.getSVGFor(div); > var params = { id:1, type:"json", timeframe:"7 days", isJSON:true}; > - $.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params, > + /*$.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params, > function(response){ > svg.graph.noDraw(); > svg.graph.chartFormat('white', 'white'). > @@ -25,10 +25,10 @@ function load_widget(div, target){ > svg.graph.legend.show(false); > svg.graph.redraw(); > } > - ); > + );*/ > // $(div).children().filter("svg").attr('height', 25).attr('width', 200); > - $(div).children().filter("svg").attr("height").baseVal.value = 25; > - $(div).children().filter("svg").attr("width").baseVal.value = 200; > + //$(div).children().filter("svg").attr("height").baseVal.value = 25; > + //$(div).children().filter("svg").attr("width").baseVal.value = 200; > }; > > // invoked when a row containing a load widgit is selected > @@ -38,11 +38,11 @@ function toggle_load_widget(div, state){ > color = '#D5EFFC'; > } > > - var graph = svgManager.getSVGFor(div).graph; > + /*var graph = svgManager.getSVGFor(div).graph; > graph.noDraw().chartFormat(color, color); > graph.xAxis.line(color, 0); > graph.yAxis.line(color, 0); > - graph.redraw(); > + graph.redraw();*/ > }; > > function load_widget_select(selected_row) >works for me ACK