2 var toElmString = Elm.JavaScript.castJSStringToString;
3 function request(verb) { return function(url) { return function(data) {
4 return function(headers) {
7 verb : JS.castStringToJSString(verb),
8 url : JS.castStringToJSString(url),
9 data : data === null ? null : JS.castStringToJSString(data),
10 headers : headers }; }; }; };
12 function get(url) { return request("GET")(url)(null)(["Nil"]); }
13 function post(url) { return function(data) {
14 return request("POST")(url)(data)(["Nil"]); }; }
16 function sendReq(responses) { return function(req) {
17 Dispatcher.notify(responses.id,["Waiting"]);
19 if (window.XMLHttpRequest) {
20 request = new XMLHttpRequest();
21 } else if (window.ActiveXObject) {
22 request = new ActiveXObject("Microsoft.XMLHTTP");
24 request.onreadystatechange = function(e) {
25 if (request.readyState === 4) {
28 request.status === 200
29 ? ["Success", toElmString(request.responseText)]
30 : ["Failure", request.status, toElmString(request.statusText)]);
33 request.open(req.verb, req.url, true);
34 List.map(function(pair) {
35 request.setRequestHeader(
36 JS.castStringToJSString(pair[1]),
37 JS.castStringToJSString(pair[2]));
39 request.send(req.data);
44 function send(requests) {
45 var responses = Elm.Signal.constant(["Waiting"]);
46 var sender = Elm.Signal.lift(sendReq(responses))(requests);
47 function f(x) { return function(y) { return x; } }
48 var combine = Elm.Signal.lift2(f)(responses)(sender);
56 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