pluginManagerConnect.js (1459B)
1 PNotify.prototype.options.styling = "bootstrap3"; 2 $("#menu-toggle").click(function(e) { 3 e.preventDefault(); 4 $("#wrapper").toggleClass("toggled"); 5 }); 6 var ws = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); 7 var socket = io(ws); 8 $(document).off('click', '#refreshSourcemodReleases').on('click', '#refreshSourcemodReleases', function (e) { 9 console.log('refresh fired'); 10 11 socket.emit('command', {command: 'refreshSourcemod'}); 12 e.preventDefault(); 13 }); 14 socket.on('status_alert', function (message) { 15 console.warn(message) 16 }); 17 18 socket.on('SourcemodList', function (message) { 19 console.log(message.response); 20 drawTable(message.response); 21 }); 22 function drawTable(data) { 23 for (var key in data) { 24 if (data.hasOwnProperty(key)) { 25 var name = data[key].name; 26 var check = name.indexOf("sourcemod") > -1; 27 if (check) { 28 drawRow(data[key]); 29 }else{ 30 console.error(JSON.stringify(data[key]) + " <-- is not sourceMod"); 31 } 32 } 33 } 34 } 35 36 function drawRow(rowData) { 37 var row = $("<tr />") 38 $("#SourcemodVersions_body").append(row); //this will append tr element to table... keep its reference for a while since we will add cels into it 39 row.append($("<td>" + rowData.name + "</td>")); 40 row.append($("<td><a href=\"" + rowData.zipball_url + "\" title=\"" + rowData.name + "\">" + rowData.zipball_url + "</td>")); 41 row.append($("<td>" + rowData.commit.sha + "</td>")); 42 }