webapi-eca/webpages/handlers/templates/forge_event_poller.html
2014-04-09 16:07:31 +02:00

57 lines
No EOL
1.6 KiB
HTML

Event Poller Name: <input id="input_id" type="text" />
<select id="editor_mode">
<option>CoffeeScript</option>
<option>JavaScript</option>
</select> is public: <input type="checkbox" id="is_public" />
<table id="editor_table">
<tr>
<td id="editor_col" valign="top">
<div id="editor">
#
# EmailYak EVENT POLLER
# ---------------------
#
# Requires user params:
# - apikey: The user's EmailYak API key
#
url = 'https://api.emailyak.com/v1/' + params.apikey + '/json/get/new/email/'
exports.newMail = ( pushEvent ) ->
# needlereq allows the user to make calls to API's
# Refer to https://github.com/tomas/needle for more information
#
# Syntax: needle.request method, url, data, [options], callback
#
needlereq 'get', url, null, null, ( err, resp, body ) ->
if err
log 'Error in EmailYak EM newMail: ' + err.message
else
if resp.statusCode is 200
for mail in body.Emails
pushEvent
subject: mail.Subject
content: mail.TextBody
</div>
<button id="but_submit">save</button>
</td>
<td id="params_col" valign="top">
This event poller requires user-specific properties:
<table id="tableParams">
<tr>
<td><img src="red_cross_small.png" title="Remove?"></td>
<td><input type="checkbox" title="Password shielded input?" checked="true" /></td>
<td><input type="text" class="textinput" value="apikey" /></td>
</tr>
<tr>
<td><img src="red_cross_small.png" title="Remove?"></td>
<td><input type="checkbox" title="Password shielded input?" /></td>
<td><input type="text" class="textinput" /></td>
</tr>
</table><!--
<td><input type="checkbox" title="Password shielded input?" /></td>
<td></td> -->
</td>
</tr>
</table>