Line 93: |
Line 93: |
| $(".graphviz").each(function(index) { | | $(".graphviz").each(function(index) { |
| var innerHtml = $(this).text(); | | var innerHtml = $(this).text(); |
| + | $(this).text(""); |
| if (innerHtml.match(/digraph./)) { | | if (innerHtml.match(/digraph./)) { |
| d3.select(this).graphviz().width('100%').fit(true).zoom(false) | | d3.select(this).graphviz().width('100%').fit(true).zoom(false) |
Line 108: |
Line 109: |
| $(".graphviz-print").each(function(index) { | | $(".graphviz-print").each(function(index) { |
| var innerHtml = $(this).text(); | | var innerHtml = $(this).text(); |
| + | $(this).text(""); |
| if (innerHtml.match(/digraph./)) { | | if (innerHtml.match(/digraph./)) { |
| d3.select(this).graphviz().width('100%').fit(true).zoom(false) | | d3.select(this).graphviz().width('100%').fit(true).zoom(false) |
Line 157: |
Line 159: |
| }); | | }); |
| });}); | | });}); |
− | /*Changes the wiki links from relative to absolute.*/
| |
− | $('.graphviz a[href]').each(function(i) {
| |
− | var originalText = $(this).text();
| |
− | if (originalText.match(/http./)) {
| |
− | var newText = $(this).text(originalText);
| |
− | } else {
| |
− | var repText = originalText.replaceAll(' ', '_');
| |
− | var newText = $(this).text('/wiki/' + repText);
| |
− | }
| |
− |
| |
− | });
| |
− | $('.graphviz-print a[href]').each(function(i) {
| |
− | var originalText = $(this).text();
| |
− | if (originalText.match(/http./)) {
| |
− | var newText = $(this).text(originalText);
| |
− | } else {
| |
− | var repText = originalText.replaceAll(' ', '_');
| |
− | var newText = $(this).text('/wiki/' + repText);
| |
− | }
| |
− | });
| |
| }); | | }); |