]> nos-oignons.net Git - website.git/commitdiff
Retrait du JS inline de la page Services
authorNicolas Braud-Santoni <nicolas+oignons@braud-santoni.eu>
Tue, 30 Aug 2016 09:52:38 +0000 (11:52 +0200)
committerNicolas Braud-Santoni <nicolas+oignons@braud-santoni.eu>
Tue, 30 Aug 2016 09:52:38 +0000 (11:52 +0200)
Services.mdwn
assets/services-pie.js [new file with mode: 0644]
assets/services-plot.js [new file with mode: 0644]

index 08fe2b253381c2b88542f55b1b280fbb5eef866a..a0d36a635dc2debfbee16fda74d0f059f32f5178 100644 (file)
@@ -8,29 +8,7 @@
 [[!meta script="assets/pie_graphs"]]
 [[!meta title="Services"]]
 
-<script>
-
-var content = d3.select("#content");
-var consensus_figure = content.append("figure")
-  .attr('class', 'graph graph-consensus')
-consensus_figure.append("span")
-  .attr("id", "consensus-pie");
-consensus_figure.append("figcaption")
-  .text(L10n.consensus_weight);
-
-var exit_figure = content.append("figure")
-  .attr('class', 'graph graph-exit')
-exit_figure.append("span")
-  .attr("id", "exit-pie");
-exit_figure.append("figcaption")
-  .text(L10n.exit_probability);
-
-content.append("div")
-  .style("clear", "left");
-
-new ConsensusPieDrawer("#consensus-pie").draw();
-new ExitPieDrawer("#exit-pie").draw();
-</script>
+<script type="text/javascript" src="../assets/services-pie.js"></script>
 
 Relais
 ======
@@ -111,20 +89,4 @@ Nos oignons fait actuellement fonctionner les relais Tor suivantsĀ :
   </tfoot>
 </table>
 
-<script>
-d3.select("#content").append("h1")
-  .text(L10n.bandwidth);
-d3.select("#content").append("div")
-  .attr("id", "bandwidth")
-  .text(L10n.loading);
-
-new BwDrawer("#bandwidth").draw();
-
-d3.select("#content").append("h1")
-  .text(L10n.weights);
-d3.select("#content").append("div")
-  .attr("id", "weights")
-  .text(L10n.loading);
-
-new WeightsDrawer("#weights").draw();
-</script>
+<script type="text/javascript" src="../assets/services-plot.js"></script>
diff --git a/assets/services-pie.js b/assets/services-pie.js
new file mode 100644 (file)
index 0000000..8cf5b84
--- /dev/null
@@ -0,0 +1,20 @@
+var content = d3.select("#content");
+var consensus_figure = content.append("figure")
+  .attr('class', 'graph graph-consensus')
+consensus_figure.append("span")
+  .attr("id", "consensus-pie");
+consensus_figure.append("figcaption")
+  .text(L10n.consensus_weight);
+
+var exit_figure = content.append("figure")
+  .attr('class', 'graph graph-exit')
+exit_figure.append("span")
+  .attr("id", "exit-pie");
+exit_figure.append("figcaption")
+  .text(L10n.exit_probability);
+
+content.append("div")
+  .style("clear", "left");
+
+new ConsensusPieDrawer("#consensus-pie").draw();
+new ExitPieDrawer("#exit-pie").draw();
diff --git a/assets/services-plot.js b/assets/services-plot.js
new file mode 100644 (file)
index 0000000..7c76c2d
--- /dev/null
@@ -0,0 +1,15 @@
+d3.select("#content").append("h1")
+  .text(L10n.bandwidth);
+d3.select("#content").append("div")
+  .attr("id", "bandwidth")
+  .text(L10n.loading);
+
+new BwDrawer("#bandwidth").draw();
+
+d3.select("#content").append("h1")
+  .text(L10n.weights);
+d3.select("#content").append("div")
+  .attr("id", "weights")
+  .text(L10n.loading);
+
+new WeightsDrawer("#weights").draw();