Skip to content

Commit

Permalink
Initial code.
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-de-vries committed Oct 20, 2014
0 parents commit b8b8a9f
Show file tree
Hide file tree
Showing 46 changed files with 19,390 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pouchdb-fauxton-logic
=====================

This repository contains the JavaScript that's added to
[pouchdb-fauxton-base](https://github.com/marten-de-vries/pouchdb-fauxton-base)
to make a working version of Fauxton running on top of PouchDB.

It does that by injecting a mock XHR object in the Fauxton page, which
converts all requests made by Fauxton into
[CouchDB request objects](https://docs.couchdb.org/en/latest/json-structure.html#request-object).
These are then converted to PouchDB method calls by
[pouchdb-route](https://www.npmjs.org/package/pouchdb-route). The result
is a [CouchDB response object](https://docs.couchdb.org/en/latest/json-structure.html#response-object),
which is returned by the mock xhr object as the response to the request.

Tests
-----

npm install #first time only
npm test

Building
--------

First, make sure the `/fauxton` directory contains the result of a build
of [pouchdb-fauxton-base](https://github.com/marten-de-vries/pouchdb-fauxton-base).

There are different ways to build PouchDB-Fauxton. The basic one is:

npm install #first time only
npm run build

Put the `/fauxton` directory somewhere on a web server, and that's it!

If you want to build a version of pouchdb-fauxton for use in a Firefox
add-on or Chrome extension, check out their
[respective](https://github.com/marten-de-vries/pouchdb-fauxton-firefox-addon)
[repositories](https://github.com/marten-de-vries/pouchdb-fauxton-chrome-extension)
for information on that.
37 changes: 37 additions & 0 deletions fauxton/css/index.css

Large diffs are not rendered by default.

Binary file added fauxton/fonts/fauxtonicon.eot
Binary file not shown.
644 changes: 644 additions & 0 deletions fauxton/fonts/fauxtonicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/fonts/fauxtonicon.ttf
Binary file not shown.
Binary file added fauxton/fonts/fauxtonicon.woff
Binary file not shown.
Binary file added fauxton/fonts/fontawesome-webfont.eot
Binary file not shown.
399 changes: 399 additions & 0 deletions fauxton/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added fauxton/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added fauxton/img/couchdb-site.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/couchdblogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/glyphicons-halflings-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/linen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/minilogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/pouchdb-minilogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fauxton/img/pouchdb-site.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions fauxton/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!doctype html>

<!--
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
-->

<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="Content-Language" content="en" />

<title>PouchDB Server</title>

<!-- Application styles. -->
<link rel="stylesheet" href="./css/index.css?v1.0">

</head>

<body id="home">
<!-- Main container. -->
<div role="main" id="main">
<div id="global-notifications" class="container errors-container"></div>
<div id="app-container"></div>
</div>

<!-- Application source. -->
<script src="./js/pouchdb-offline.js"></script>
<script data-main="/config" src="./js/require.js?v1.0"></script>
</body>
</html>
886 changes: 886 additions & 0 deletions fauxton/js/ace/mode-javascript.js

Large diffs are not rendered by default.

Loading

0 comments on commit b8b8a9f

Please sign in to comment.