[#314,couchdb][s]: remove couchdb backend as now in its own repo at https://github.com/Recline/backend.couchdb.
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
jQuery(function($) {
|
||||
window.dataExplorer = null;
|
||||
window.explorerDiv = $('.data-explorer-here');
|
||||
|
||||
var queryParameters = recline.View.parseQueryString(decodeURIComponent(window.location.search));
|
||||
|
||||
var dataset = new recline.Model.Dataset({
|
||||
db_url: queryParameters['url'] || '/couchdb/yourcouchdb',
|
||||
view_url: queryParameters['view_url'] || '/couchdb/yourcouchdb/_design/yourdesigndoc/_view/yourview',
|
||||
backend: 'couchdb',
|
||||
query_options: {
|
||||
'key': '_id'
|
||||
}
|
||||
});
|
||||
|
||||
dataset.fetch().done(function(dataset) {
|
||||
console.log('records: ' + dataset.records);
|
||||
});
|
||||
|
||||
createExplorer(dataset);
|
||||
});
|
||||
|
||||
// make Explorer creation / initialization in a function so we can call it
|
||||
// again and again
|
||||
var createExplorer = function(dataset, state) {
|
||||
// remove existing data explorer view
|
||||
var reload = false;
|
||||
if (window.dataExplorer) {
|
||||
window.dataExplorer.remove();
|
||||
reload = true;
|
||||
}
|
||||
window.dataExplorer = null;
|
||||
var $el = $('<div />');
|
||||
$el.appendTo(window.explorerDiv);
|
||||
|
||||
var views = [
|
||||
{
|
||||
id: 'grid',
|
||||
label: 'Grid',
|
||||
view: new recline.View.SlickGrid({
|
||||
model: dataset
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: 'graph',
|
||||
label: 'Graph',
|
||||
view: new recline.View.Graph({
|
||||
model: dataset
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: 'map',
|
||||
label: 'Map',
|
||||
view: new recline.View.Map({
|
||||
model: dataset
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: 'transform',
|
||||
label: 'Transform',
|
||||
view: new recline.View.Transform({
|
||||
model: dataset
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
window.dataExplorer = new recline.View.MultiView({
|
||||
model: dataset,
|
||||
el: $el,
|
||||
state: state,
|
||||
views: views
|
||||
});
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
layout: container
|
||||
title: CouchDB Multiview - Demos
|
||||
recline-deps: true
|
||||
root: ../../
|
||||
---
|
||||
|
||||
<style type="text/css">
|
||||
.recline-slickgrid {
|
||||
height: 550px;
|
||||
}
|
||||
|
||||
.recline-timeline .vmm-timeline {
|
||||
height: 550px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="instructions">
|
||||
<h2>Instructions</h2>
|
||||
<p>To use this demo you will need a CouchDB instance running and accessible over HTTP. You should then pass the following 2 query parameters to this page:</p>
|
||||
|
||||
<pre>url: url-to-your-couchdb-instance
|
||||
view_url: url-to-your-couchdb-view
|
||||
|
||||
Example:
|
||||
http://path-to-this-page/?url=/mycouchdb/&view_url=/mycouchdb/_design/yourdesigndoc/_view/yourview
|
||||
</pre>
|
||||
|
||||
<p>Note that if the CouchDB database is <em>not</em> running on the same domain as this page then the host it is on <em>must</em> support CORS – the simplest approach here is probably to set up a reverse proxy or proxy so your CouchDB database appears on the local domain at e.g. /mycouchdb/.</p>
|
||||
</div>
|
||||
|
||||
<h2>Demo</h2>
|
||||
|
||||
<div class="data-explorer-here"></div>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
<script type="text/javascript" src="../../src/backend.couchdb.js"></script>
|
||||
<script type="text/javascript" src="app.js"></script>
|
||||
|
||||
@@ -95,13 +95,13 @@ root: ../
|
||||
<div class="row" id="couchdb">
|
||||
<div class="span4">
|
||||
<div class="well">
|
||||
<h3><a href="couchdb/">CouchDB Demo</a></h3>
|
||||
<h3><a href="https://github.com/Recline/backend.couchdb">CouchDB Demo</a></h3>
|
||||
<p>Using CouchDB with Recline Multiview to provide an elegant powerful
|
||||
browser for a CouchDB database and view.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span8">
|
||||
<a href="multiview/"><img src="http://farm8.staticflickr.com/7251/7508402742_03c74a9763_c.jpg" style="width: 100%" /></a>
|
||||
<a href="https://github.com/Recline/backend.couchdb"><img src="http://farm8.staticflickr.com/7251/7508402742_03c74a9763_c.jpg" style="width: 100%" /></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user