commit e4e5174269315f4a26c5d17583a8b31b0023453f parent 626e295ad32005ffbf51672a20860885ee5131ab Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 2 Aug 2016 19:27:24 +0200 fix(pluginManager) Getting Versions loop fixed Diffstat:
| M | web/theme/js/pluginManagerConnect.js | | | 15 | ++++++++------- |
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/web/theme/js/pluginManagerConnect.js b/web/theme/js/pluginManagerConnect.js @@ -16,17 +16,18 @@ socket.on('status_alert', function (message) { }); socket.on('SourcemodList', function (message) { + console.log(message.response); drawTable(message.response); }); function drawTable(data) { for (var key in data) { if (data.hasOwnProperty(key)) { - for (var i = 0; i < data.length; i++) { - var name = data[key].name; - var check = name.indexOf("sourcemod") > -1; - if (check) { - drawRow(data[key]); - } + var name = data[key].name; + var check = name.indexOf("sourcemod") > -1; + if (check) { + drawRow(data[key]); + }else{ + console.error(JSON.stringify(data[key]) + " <-- is not sourceMod"); } } } @@ -36,6 +37,6 @@ function drawRow(rowData) { var row = $("<tr />") $("#SourcemodVersions_body").append(row); //this will append tr element to table... keep its reference for a while since we will add cels into it row.append($("<td>" + rowData.name + "</td>")); - row.append($("<td>" + rowData.zipball_url + "</td>")); + row.append($("<td><a href=\"" + rowData.zipball_url + "\" title=\"" + rowData.name + "\">" + rowData.zipball_url + "</td>")); row.append($("<td>" + rowData.commit.sha + "</td>")); }