// Generated by CoffeeScript 1.7.1 (function() { var arrKV, arrParams, fDisplayError, fFailedRequest, fIssueRequest, fOnLoad, fProcessWebhookList, fUpdateWebhookList, hostUrl, oParams, param, _i, _len; arrParams = window.location.search.substring(1).split('&'); oParams = {}; for (_i = 0, _len = arrParams.length; _i < _len; _i++) { param = arrParams[_i]; arrKV = param.split('='); oParams[arrKV[0]] = arrKV[1]; } if (oParams.id) { oParams.id = decodeURIComponent(oParams.id); } hostUrl = [location.protocol, '//', location.host].join(''); fDisplayError = function(msg) { window.scrollTo(0, 0); $('#info').text("Error: " + msg); return $('#info').attr('class', 'error'); }; fIssueRequest = function(args) { $('#info').text(''); return $.post('/usercommand', args.body).done(args.done).fail(args.fail); }; fFailedRequest = function(msg) { return function(err) { if (err.status === 401) { return window.location.href = 'forge?page=forge_rule'; } else { return fDisplayError(msg); } }; }; fUpdateWebhookList = function() { return fIssueRequest({ body: { command: 'get_all_webhooks' }, done: fProcessWebhookList, fail: fFailedRequest('Unable to get Webhook list') }); }; fProcessWebhookList = function(data) { var hookid, hookname, img, oHooks, tdName, tdUrl, tr, _results; $('#table_webhooks *').remove(); if (data.message) { oHooks = JSON.parse(data.message); $('#table_webhooks').append($('