2 var JS = Elm.JavaScript;
3 var toElmString = Elm.JavaScript.castJSStringToString;
4 function request(verb) { return function(url) { return function(data) {
5 return function(headers) {
8 verb : JS.castStringToJSString(verb),
9 url : JS.castStringToJSString(url),
10 data : data === null ? null : JS.castStringToJSString(data),
11 headers : headers }; }; }; };
13 function get(url) { return request("GET")(url)(null)(["Nil"]); }
14 function post(url) { return function(data) {
15 return request("POST")(url)(data)(["Nil"]); }; }
17 function sendReq(responses) { return function(req) {
18 Dispatcher.notify(responses.id,["Waiting"]);
20 if (window.XMLHttpRequest) {
21 request = new XMLHttpRequest();
22 } else if (window.ActiveXObject) {
23 request = new ActiveXObject("Microsoft.XMLHTTP");
25 request.onreadystatechange = function(e) {
26 if (request.readyState === 4) {
29 request.status === 200
30 ? ["Success", toElmString(request.responseText)]
31 : ["Failure", request.status, toElmString(request.statusText)]);
34 request.open(req.verb, req.url, true);
35 Elm.List.map(function(pair) {
36 request.setRequestHeader(
37 JS.castStringToJSString(pair[1]),
38 JS.castStringToJSString(pair[2]));
40 request.send(req.data);
45 function send(requests) {
46 var responses = Elm.Signal.constant(["Waiting"]);
47 var sender = Elm.Signal.lift(sendReq(responses))(requests);
48 function f(x) { return function(y) { return x; } }
49 var combine = Elm.Signal.lift2(f)(responses)(sender);
57 sendGet : function(urls){return send(Elm.Signal.lift(get)(urls));}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list