// Generated by CoffeeScript 1.7.1 (function() { var arrKV, arrParams, fFailedRequest, fOnLoad, fPlaceAndPaintInterval, oParams, param, strPublicKey, _i, _len, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; 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); } strPublicKey = ''; fPlaceAndPaintInterval = function() { return $('#input_interval').html('Interval: "days hours:minutes", default = 10 minutes'); }; fFailedRequest = function(msg) { return function(err) { if (err.status === 401) { return window.location.href = 'forge?page=forge_rule'; } else { $('#info').text(msg); return $('#info').attr('class', 'error'); } }; }; $.post('/usercommand', { command: 'get_public_key' }).done(function(data) { return strPublicKey = data.message; }).fail(function(err) { if (err.status === 401) { return window.location.href = 'forge?page=forge_rule'; } else { $('#info').text('Error fetching public key, unable to send user specific parameters securely'); return $('#info').attr('class', 'error'); } }); fOnLoad = function() { var editor, fAddActionUserArgs, fAddActionUserParams, fAddEventParams, fAddEventUserArgs, fAddSelectedAction, fFetchActionFunctionArgs, fFetchActionParams, fFetchEventFunctionArgs, fFetchEventParams, fFillActionFunction, fFillEventParams, obj; document.title = 'Rule Forge!'; $('#pagetitle').text('{{{user.username}}}, forge your ECA Rule!'); editor = ace.edit("editor_conditions"); editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/json"); editor.setShowPrintMargin(false); $.post('/usercommand', { command: 'get_event_pollers' }).done(function(data) { var err, events, fAppendEvents, id, oEps; try { oEps = JSON.parse(data.message); } catch (_error) { err = _error; console.error('ERROR: non-object received from server: ' + data.message); return; } fAppendEvents = function(id, events) { var evt, fAppendEvent, _j, _len1, _results; fAppendEvent = function(evt) { return $('#select_event').append($('