humongous 0.1.3.pre → 0.1.4.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3.pre
1
+ 0.1.4.pre
@@ -79,6 +79,10 @@ module Humongous
79
79
  options
80
80
  end
81
81
 
82
+ def default_opts
83
+ { skip: 0, limit: 10 }
84
+ end
85
+
82
86
  end
83
87
 
84
88
  get '/' do
@@ -131,7 +135,34 @@ module Humongous
131
135
  content_type :json
132
136
  { status: "OK", saved: true }.to_json
133
137
  end
134
-
138
+
139
+ delete "/database/:db_name" do
140
+ content_type :json
141
+ @connection.drop_database(params[:db_name]).to_json
142
+ end
143
+
144
+ post "/database" do
145
+ p params
146
+ {}
147
+ end
148
+
149
+ end
150
+
151
+ #gem version
152
+ def self.version #:nodoc
153
+ "development"
154
+ end
155
+
156
+ def self.description
157
+ %Q{
158
+ Humongous: A Ruby way to browse and maintain mongo instance. Using HTML5.
159
+ This is beta version, So there is long way to go, but still you can enjoy its
160
+ simplistic design.
161
+ }
162
+ end
163
+
164
+ def self.summary
165
+ %Q{An standalone Mongo Browser for Ruby. Just run and forget.}
135
166
  end
136
167
 
137
168
  end
@@ -1,4 +1,13 @@
1
1
  $(document).ready(function(){
2
+ $('#loader').modal({
3
+ keyboard: true,
4
+ backdrop: "static"
5
+ });
6
+ $("#loader").bind("ajaxSend", function(){
7
+ $( this ).modal('show');
8
+ }).bind("ajaxComplete", function(){
9
+ $( this ).modal('hide');
10
+ });
2
11
  $('.database_list tr').click( function( e ){
3
12
  var data_source = $( e.target ).attr( "data-source" );
4
13
  $( this ).siblings().removeClass('active');
@@ -39,7 +48,53 @@ $(document).ready(function(){
39
48
  $( app.html.build_results.create( data ) ).appendTo( '.query_result' );
40
49
  }
41
50
  })
42
- } )
51
+ } );
52
+ $(".delete").bind( 'click', function(e){
53
+ var elem = $(".database_list").find(".active");
54
+ var data_source = elem.children().attr("data-source");
55
+ app.ax({
56
+ url: data_source,
57
+ type: "DELETE",
58
+ success: function(data){
59
+ console.log("DELETED: " + JSON.stringify(data));
60
+ $(elem).remove();
61
+ }
62
+ });
63
+ } );
64
+ $(".add").bind( 'click', function(e){
65
+ var modal_skeleton = app.html.modal_skeleton.create( "modal_skeleton" );
66
+ console.log(modal_skeleton)
67
+ modal_skeleton.children[0].children = [
68
+ { tag: "H3", text: "Add Database" }
69
+ ];
70
+ modal_skeleton.children[1].children = [
71
+ app.html.template.input_field.container({
72
+ id: "database_name",
73
+ name: "database_name",
74
+ text: "Name",
75
+ placeholder: "Database Name",
76
+ size: "30"
77
+ })
78
+ ];
79
+ modal_skeleton.children[2].children = [
80
+ { tag: "A", cls: "btn primary", text: "Add", onClick: function(e){
81
+ console.log(this)
82
+ app.ax({
83
+ url: "/database",
84
+ data: $("#database_name").val(),
85
+ success: function(data){
86
+ console.log(this);
87
+ }
88
+ })
89
+ } }
90
+ ]
91
+ $( modal_skeleton ).appendTo( ".content" );
92
+ $( modal_skeleton ).modal({
93
+ keyboard: true,
94
+ backdrop: "static",
95
+ show: true
96
+ });
97
+ } );
43
98
  });
44
99
  app.helpers.yielder = function( cb_function, arguments ){
45
100
  $( cb_function.create( arguments ) ).appendTo( '.yielder' );
@@ -132,4 +187,24 @@ app.html.stats = {
132
187
  return value.toString();
133
188
  }
134
189
  }
190
+ }
191
+ app.html.modal_skeleton = {
192
+ selector: "",
193
+ clear: function(){
194
+ $( this._el() ).remove();
195
+ },
196
+ create: function( anchor ){
197
+ this.selector = anchor;
198
+ this.clear();
199
+ return(
200
+ { tag: "DIV", id: anchor, style: "display:none", cls: "modal hide fade", children: [
201
+ { tag: "DIV", cls: "modal-header" },
202
+ { tag: "DIV", cls: "modal-body" },
203
+ { tag: "DIV", cls: "modal-footer" }
204
+ ] }
205
+ )
206
+ },
207
+ _el: function(){
208
+ return $(this.selector);
209
+ }
135
210
  }
@@ -155,7 +155,7 @@ app.html.template.abstract_field = {
155
155
  app.html.template.input_field = app.merge( app.html.template.abstract_field, {
156
156
  _el_container: function( options ){
157
157
  return([
158
- { tag: "INPUT", type: "text", name: options.id, id: options.id }
158
+ { tag: "INPUT", type: "text", name: options.id, id: options.id, "placeholder": options.placeholder, size: options.size }
159
159
  ])
160
160
  }
161
161
  });
@@ -86,4 +86,22 @@ tr.active{
86
86
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
87
87
  border-color: #0064cd #0064cd #003f81;
88
88
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
89
+ }
90
+ #loader{
91
+ top:70%;
92
+ left:60%;
93
+ width: 300px;
94
+ text-align: center;
95
+ }
96
+ #loader img{
97
+ height: 150px;
98
+ width: 150px;
99
+ }
100
+ .sidebar-header h3{
101
+ float:left;
102
+ }
103
+ .sidebar-header .add_remove{
104
+ padding-top: 10px;
105
+ float: right;
106
+ line-height: 26px;
89
107
  }
@@ -50,7 +50,14 @@
50
50
  <div class="row">
51
51
  <div class="span4">
52
52
  <div class="databases">
53
- <h3>Databases</h3>
53
+ <div class="sidebar-header">
54
+ <h3>Databases</h3>
55
+ <div class="add_remove">
56
+ <a class="add">ADD</a>
57
+ <a class="delete">REMOVE</a>
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
54
61
  <div class="database_list">
55
62
  <table>
56
63
  <tbody>
@@ -153,6 +160,16 @@
153
160
  </div>
154
161
  <div class="modal-footer"><span>&copy; Bagwan Pankaj 2012</span></div>
155
162
  </div>
163
+ <div id="loader" style="display:none" class="modal">
164
+ <div class="modal-body">
165
+ <img src="/images/ajax-loader.gif"></img>
166
+ </div>
167
+ </div>
168
+ <div id="modal_skeleton" style="display:none" class="modal">
169
+ <div class="modal-header"></div>
170
+ <div class="modal-body"></div>
171
+ <div class="modal-footer"></div>
172
+ </div>
156
173
 
157
174
  <footer>
158
175
  <p>&copy; Bagwan Pankaj 2012</p>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humongous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.pre
4
+ version: 0.1.4.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vegas
16
- requirement: &2160705620 !ruby/object:Gem::Requirement
16
+ requirement: &2160166020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.8
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160705620
24
+ version_requirements: *2160166020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sinatra
27
- requirement: &2160704860 !ruby/object:Gem::Requirement
27
+ requirement: &2160164040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2160704860
35
+ version_requirements: *2160164040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bson_ext
38
- requirement: &2160704260 !ruby/object:Gem::Requirement
38
+ requirement: &2160157780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.5.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2160704260
46
+ version_requirements: *2160157780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: mongo
49
- requirement: &2160703340 !ruby/object:Gem::Requirement
49
+ requirement: &2160155040 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.5.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2160703340
57
+ version_requirements: *2160155040
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json
60
- requirement: &2160702320 !ruby/object:Gem::Requirement
60
+ requirement: &2160152160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.5
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2160702320
68
+ version_requirements: *2160152160
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: crack
71
- requirement: &2160701000 !ruby/object:Gem::Requirement
71
+ requirement: &2160150400 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - =
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 0.3.1
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2160701000
79
+ version_requirements: *2160150400
80
80
  description: ! 'Humongous: A Ruby way to browse and maintain mongo instance. Using
81
81
  HTML5.'
82
82
  email: bagwanpankaj@gmail.com
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ! '>='
118
118
  - !ruby/object:Gem::Version
119
- version: '0'
119
+ version: 1.9.2
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements: