Permalink
Browse files

Updated the api and setup modals.

  • Loading branch information...
1 parent b387516 commit 373d393e8e6903117af685420f5331dfe3b68649 @christophercliff committed Nov 15, 2011
Showing with 52 additions and 17 deletions.
  1. +8 −6 _attachments/index.html
  2. +15 −5 _attachments/javascripts/app.js
  3. +29 −6 _attachments/stylesheets/app.css
View
@@ -63,9 +63,9 @@
<div class="Database-hider">
<div class="Database-control-collection">
<div class="Database-control add-feature">Add Feature</div>
- <div class="Database-control edit-database" onclick="alert('Not Implemented');">Edit</div>
+ <!--<div class="Database-control edit-database" onclick="alert('Not Implemented');">Edit</div>-->
<div class="Database-control delete-database">Delete</div>
- <div class="Database-control export-database">JSON</div>
+ <div class="Database-control export-database">API</div>
</div>
<ol class="Document-collection"></ol>
</div>
@@ -95,14 +95,14 @@
<div class="Databaser-name">Setup</div>
- <form class="Databaser-form" action="#" style="display: none;">
+ <form class="Databaser-form" action="#">
<input name="name" value="" autocomplete="off" placeholder="Name" />
<input name="slug" value="" autocomplete="off" placeholder="Slug" />
<input type="hidden" value="database" />
<input type="submit" value="Create Database" />
- <a class="Databaser-cancel" href="#">Cancel</a>
+ <!--<a class="Databaser-cancel" href="#">Cancel</a>-->
</form>
@@ -112,7 +112,7 @@
<ul class="">
<li class="">
- <div class="Databaser-refresh Dialog-close">Close</div>
+ <div class="Databaser-refresh Databaser-cancel">Close</div>
</li>
<!--<li class="">
<div class="Databaser-reset">Reset</div>
@@ -187,7 +187,9 @@
<script id="Api" type="text/template">
- <div class="Api-url">GET: http://<%= window.location.host %>/<%= slug %>/_design/geo/_spatiallist/geojson/full?bbox=-180%2C-90%2C180%2C90</div>
+ <div class="Api-description"><code>GET</code> <a href="http://geojson.org/" target="_blank">GeoJSON</a> features in a <a href="http://www.opensearch.org/Specifications/OpenSearch/Extensions/Geo/1.0/Draft_1#The_.22box.22_parameter" target="_blank">bounding box</a>:</div>
+
+ <pre class="Api-url">http://<%= window.location.host %>/<%= slug %>/_design/geo/_spatiallist/geojson/full?bbox=-180,-90,180,90</pre>
</script>
@@ -1034,14 +1034,14 @@
className: 'Dialog',
events: {
- 'click .Dialog-close': 'close'
+ 'click': 'close'
},
initialize: function () {
var self = this;
- _.bindAll(self, 'close');
+ _.bindAll(self, 'close', 'layout');
self.template = _.template($('#' + self.className).html());
@@ -1065,6 +1065,11 @@
var self = this;
+ if (e.target !== self.el)
+ {
+ return;
+ }
+
self.remove();
return;
@@ -1142,7 +1147,6 @@
;
});
- // Inherit the dialog view (sort of...)
return self.dialogView;
},
@@ -1164,8 +1168,14 @@
return;
}
- self.remove();
- self.databases.add(obj);
+ self.existings
+ .add(obj)
+ ;
+
+ self.databases
+ .add(obj)
+ .trigger('reset')
+ ;
$.couch.db(slug).create({
success: function () {
@@ -75,6 +75,11 @@ body:after {
font-size: 11px; line-height: 11px; font-weight: bold;
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}
+ .Databaser-form {
+ padding: 10px 30px;
+ color: #fff;
+ font-size: 14px; line-height: 14px;
+ }
.Existing-collection {
@@ -197,6 +202,10 @@ body:after {
.Database canvas {
position: absolute; right: 62px; top: 16px;
}
+ .Database-empty {
+ padding: 16px 30px;
+ color: #ccc;
+ }
.Document-collection {
padding: 16px 0;
@@ -234,9 +243,9 @@ body:after {
background-color: rgba(0, 0, 0, 0.75);
}
.Dialog-content {
- position: fixed; left: 50%; top: 50%;
- width: 600px; height: 400px; overflow-y: scroll;
- margin: -200px 0 0 -300px;
+ position: fixed; left: 50%; top: 100px;
+ width: 600px; max-height: 400px; overflow-y: scroll;
+ margin-left: -300px;
background-image: -moz-linear-gradient(top, rgba(20, 20, 20, 0.75), rgba(0, 0, 0, 0.75));
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(50, 50, 50, 0.75)), to(rgba(0, 0, 0, 0.75)));
/*border: solid 1px #000;*/
@@ -245,11 +254,25 @@ body:after {
}
.Api {
-
+ padding: 30px 0;
+ font-size: 14px; line-height: 18px;
}
+ .Api-description {
+ padding: 0 30px; margin-bottom: 18px;
+ color: #fff;
+ }
+ .Api-description code {
+ font-family: Monaco;
+ }
+ .Api-description a {
+ color: #fff;
+ text-decoration: underline;
+ }
.Api-url {
+ display: block;
+ padding: 18px 30px;
color: #999;
- padding: 5px 30px;
+ background-color: #000;
+ border-top: solid 1px rgba(255, 255, 255, 0.15);
font-family: Monaco;
- font-size: 12px; line-height: 12px;
}

0 comments on commit 373d393

Please sign in to comment.