|
305 | 305 | <script src="https://d3js.org/d3.v4.min.js"></script>
|
306 | 306 | <script type="text/javascript">
|
307 | 307 | var func = function(window, d3, $) {
|
308 |
| - d3.json("./data.json?q=2016", function(data) { |
309 |
| - d3.select("#projects-container").selectAll(".project-content-container") |
310 |
| - .data(data) |
311 |
| - .enter() |
312 |
| - .append("div") |
313 |
| - .attr("class", "project-content-container col-lg-4 col-sm-6") |
314 |
| - .html(function(d) { |
315 |
| -
|
316 |
| - var owner = d.owner_url != "" ? "<a target=\"_blank\" href='" + d.owner_url + "'>" + d.owner + "</a>" : d.owner; |
317 |
| - var channel_button = d.channel && d.channel != "" ? "<a target=\"_blank\" href='//progco.de/join'\n data-toggle=\"tooltip\"\n title=\"" + d.channel + "\"\n data-placement=\"top\"\n class='proj-links'><img src='./img/slack.png' height='20' width='20'></a>" : ""; |
318 |
| -
|
319 |
| - var project_button = d.project_url && d.project_url != "" ? "\n <a target=\"_blank\" href='" + d.project_url + "'\n data-toggle=\"tooltip\"\n title=\"Contribute\"\n data-placement=\"top\"\n class='proj-links'><i class='fa fa-github fa-fw' aria-hidden='true'></i></a>\n " : ""; |
320 |
| - var ret = "\n <div class='project-item'>\n <div class='project-image' style='background-image: url(" + d.site_image + ")'>\n <div class=''>\n \n <div class='clearfix'></div>\n </div>\n </div>\n <div class='project-details'>\n <div>\n <span class='owner-image' style='background-image: url(" + d.owner_image + ")'></span>\n <h4><a target=\"_blank\" href='" + d.site_url + "'>" + d.name + "</a></h4>\n <h5>" + d.description + "</h5>\n </div>\n <div class='clearfix'></div>\n <div class='links-area'>\n " + channel_button + " " + project_button + "\n </div>\n </div>\n </div>\n " |
321 |
| - ; |
322 |
| -
|
323 |
| - return ret; |
324 |
| - }); |
325 |
| -
|
326 |
| - $(function () { |
327 |
| - $('[data-toggle="tooltip"]').tooltip() |
328 |
| - }) |
329 |
| - }); |
330 |
| -
|
331 |
| - }(window, d3, jQuery); |
332 |
| -
|
333 |
| -
|
| 308 | + d3.json("./data.json?q=2016", function(data) { |
| 309 | + d3.select("#projects-container").selectAll(".project-content-container").data(data).enter().append("div").attr("class", "project-content-container col-lg-4 col-sm-6").html(function(d) { |
| 310 | + var ret = ""; |
| 311 | + ret += "<div class='project-item'>"; |
| 312 | + //ret += "<a target=\"_blank\" href=\"" + d.site_url + "\">"; |
| 313 | + ret += "<div class='project-image' style='background-image: url("; |
| 314 | + ret += d.site_image; |
| 315 | + ret += ")'>"; |
| 316 | + //ret += "</a>"; |
| 317 | + ret += "<div class='clearfix'></div></div><div class='project-details'>"; |
| 318 | + ret += "<div>"; |
| 319 | + if (notEmpty(d.owner_image)) { |
| 320 | + ret += "<span class='owner-image' style='background-image: url(" + d.owner_image + ")'></span>"; |
| 321 | + } |
| 322 | + ret += "<h4><a target=\"_blank\" href='" + d.site_url + "'>" + d.name + "</a></h4>"; |
| 323 | + ret += "<h5>" + d.description + "</h5>"; |
| 324 | + ret += "</div>"; |
| 325 | + ret += "<div class='clearfix'></div>"; |
| 326 | + var owner = d.owner_url != "" ? "<a target=\"_blank\" href='" + d.owner_url + "'>" + d.owner + "</a>" : d.owner; |
| 327 | + var channel_button = ""; |
| 328 | + if (notEmpty(d.channel)) { |
| 329 | + channel_button = "<a target=\"_blank\" href='//progco.de/join' data-toggle=\"tooltip\" title=\"" + d.channel + "\" data-placement=\"top\" class='proj-links'>" + "<img src='./img/slack.png' height='20' width='20'></a>"; |
| 330 | + } |
| 331 | + var project_button = ""; |
| 332 | + if (notEmpty(d.project_url)) { |
| 333 | + project_button = "<a target=\"_blank\" href='" + d.project_url + "' data-toggle=\"tooltip\" title=\"Contribute\" data-placement=\"top\" class='proj-links'>" + "<i class='fa fa-github fa-fw' aria-hidden='true'></i></a>"; |
| 334 | + } |
| 335 | + ret += "<div class='links-area'>" + channel_button + " " + project_button + "</div></div></div>"; |
| 336 | + console.log(ret); |
| 337 | + return ret; |
| 338 | + }); |
| 339 | + $(function() { |
| 340 | + $('[data-toggle="tooltip"]').tooltip() |
| 341 | + }) |
| 342 | + }); |
| 343 | +}(window, d3, jQuery); |
334 | 344 | </script>
|
335 | 345 | <script>
|
336 | 346 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
0 commit comments