blob: 6fafb764d92a47104b062b9c4da527a09b662c62 [file]
<!DOCTYPE html>
<html>
<!-- Copyright 2014 Google Inc. All rights reserved. -->
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />
<title>Native Client libgit2 demo</title>
<script type="text/javascript" src="libgit2.js"></script>
</head>
<body>
<h1>Native Client libgit2 demo</h1>
<embed name="nacl_module"
width=0,
height=0,
PWD="/tmp",
id="nacl_module"
src="libgit2-demo.nmf"
type="application/x-nacl">
<p>
This demo embeds an invisible NaCl element in the page which can recieve
requests vis postMessage to perform various git operation using the libgit2
library.
</p>
<p>
Clone and push normally will use the Pepper socket interface. These APIs
are only available when running as a Chrome App.
</p>
<p>
You can also use Pepper URL Loader as a transport for the
<code>http://</code> and <code>https://</code> schemes, by using
<code>pepper_http://</code> and <code>pepper_https://</code> instead. These
will always work, but they require coordination with the server; if the git
server is on a different origin, they must respond with the correct CORS
headers. See httpd.py in this directory for an example.
</p>
<p>
Working directory: <input type="text" id="directory" value="/tmp/test"></br>
Clone URL: <input size="50" type="text" id="clone_url"
value="https://github.com/google/adb-sync.git"></br>
Commit filename: <input size="50" type="text" id="commit_filename"
value="foobar"></br>
Push Refspec: <input size="50" type="text" id="push_refspec"
value="refs/heads/master:refs/heads/master"></br>
</p>
<p>
<button id="clone">clone</button>
<button id="init">init</button>
<button id="status">status</button>
<button id="mount">mount filesystem</button>
<button id="commit">commit file</button>
<button id="push">push</button>
</p>
<p>
Output:
</p>
<textarea cols="80" rows="20" id="output" readonly></textarea>
</body>
</html>