grape-swagger-rails 0.0.4 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,193 @@
1
+
2
+ // The purpose of the `Content` object is to abstract away the data conversions
3
+ // to and from raw content entities as strings. For example, you want to be able
4
+ // to pass in a Javascript object and have it be automatically converted into a
5
+ // JSON string if the `content-type` is set to a JSON-based media type.
6
+ // Conversely, you want to be able to transparently get back a Javascript object
7
+ // in the response if the `content-type` is a JSON-based media-type.
8
+
9
+ // One limitation of the current implementation is that it [assumes the `charset` is UTF-8](https://github.com/spire-io/shred/issues/5).
10
+
11
+ // The `Content` constructor takes an options object, which *must* have either a
12
+ // `body` or `data` property and *may* have a `type` property indicating the
13
+ // media type. If there is no `type` attribute, a default will be inferred.
14
+ var Content = function(options) {
15
+ this.body = options.body;
16
+ this.data = options.data;
17
+ this.type = options.type;
18
+ };
19
+
20
+ Content.prototype = {
21
+ // Treat `toString()` as asking for the `content.body`. That is, the raw content entity.
22
+ //
23
+ // toString: function() { return this.body; }
24
+ //
25
+ // Commented out, but I've forgotten why. :/
26
+ };
27
+
28
+
29
+ // `Content` objects have the following attributes:
30
+ Object.defineProperties(Content.prototype,{
31
+
32
+ // - **type**. Typically accessed as `content.type`, reflects the `content-type`
33
+ // header associated with the request or response. If not passed as an options
34
+ // to the constructor or set explicitly, it will infer the type the `data`
35
+ // attribute, if possible, and, failing that, will default to `text/plain`.
36
+ type: {
37
+ get: function() {
38
+ if (this._type) {
39
+ return this._type;
40
+ } else {
41
+ if (this._data) {
42
+ switch(typeof this._data) {
43
+ case "string": return "text/plain";
44
+ case "object": return "application/json";
45
+ }
46
+ }
47
+ }
48
+ return "text/plain";
49
+ },
50
+ set: function(value) {
51
+ this._type = value;
52
+ return this;
53
+ },
54
+ enumerable: true
55
+ },
56
+
57
+ // - **data**. Typically accessed as `content.data`, reflects the content entity
58
+ // converted into Javascript data. This can be a string, if the `type` is, say,
59
+ // `text/plain`, but can also be a Javascript object. The conversion applied is
60
+ // based on the `processor` attribute. The `data` attribute can also be set
61
+ // directly, in which case the conversion will be done the other way, to infer
62
+ // the `body` attribute.
63
+ data: {
64
+ get: function() {
65
+ if (this._body) {
66
+ return this.processor.parser(this._body);
67
+ } else {
68
+ return this._data;
69
+ }
70
+ },
71
+ set: function(data) {
72
+ if (this._body&&data) Errors.setDataWithBody(this);
73
+ this._data = data;
74
+ return this;
75
+ },
76
+ enumerable: true
77
+ },
78
+
79
+ // - **body**. Typically accessed as `content.body`, reflects the content entity
80
+ // as a UTF-8 string. It is the mirror of the `data` attribute. If you set the
81
+ // `data` attribute, the `body` attribute will be inferred and vice-versa. If
82
+ // you attempt to set both, an exception is raised.
83
+ body: {
84
+ get: function() {
85
+ if (this._data) {
86
+ return this.processor.stringify(this._data);
87
+ } else {
88
+ return this._body.toString();
89
+ }
90
+ },
91
+ set: function(body) {
92
+ if (this._data&&body) Errors.setBodyWithData(this);
93
+ this._body = body;
94
+ return this;
95
+ },
96
+ enumerable: true
97
+ },
98
+
99
+ // - **processor**. The functions that will be used to convert to/from `data` and
100
+ // `body` attributes. You can add processors. The two that are built-in are for
101
+ // `text/plain`, which is basically an identity transformation and
102
+ // `application/json` and other JSON-based media types (including custom media
103
+ // types with `+json`). You can add your own processors. See below.
104
+ processor: {
105
+ get: function() {
106
+ var processor = Content.processors[this.type];
107
+ if (processor) {
108
+ return processor;
109
+ } else {
110
+ // Return the first processor that matches any part of the
111
+ // content type. ex: application/vnd.foobar.baz+json will match json.
112
+ var main = this.type.split(";")[0];
113
+ var parts = main.split(/\+|\//);
114
+ for (var i=0, l=parts.length; i < l; i++) {
115
+ processor = Content.processors[parts[i]]
116
+ }
117
+ return processor || {parser:identity,stringify:toString};
118
+ }
119
+ },
120
+ enumerable: true
121
+ },
122
+
123
+ // - **length**. Typically accessed as `content.length`, returns the length in
124
+ // bytes of the raw content entity.
125
+ length: {
126
+ get: function() {
127
+ if (typeof Buffer !== 'undefined') {
128
+ return Buffer.byteLength(this.body);
129
+ }
130
+ return this.body.length;
131
+ }
132
+ }
133
+ });
134
+
135
+ Content.processors = {};
136
+
137
+ // The `registerProcessor` function allows you to add your own processors to
138
+ // convert content entities. Each processor consists of a Javascript object with
139
+ // two properties:
140
+ // - **parser**. The function used to parse a raw content entity and convert it
141
+ // into a Javascript data type.
142
+ // - **stringify**. The function used to convert a Javascript data type into a
143
+ // raw content entity.
144
+ Content.registerProcessor = function(types,processor) {
145
+
146
+ // You can pass an array of types that will trigger this processor, or just one.
147
+ // We determine the array via duck-typing here.
148
+ if (types.forEach) {
149
+ types.forEach(function(type) {
150
+ Content.processors[type] = processor;
151
+ });
152
+ } else {
153
+ // If you didn't pass an array, we just use what you pass in.
154
+ Content.processors[types] = processor;
155
+ }
156
+ };
157
+
158
+ // Register the identity processor, which is used for text-based media types.
159
+ var identity = function(x) { return x; }
160
+ , toString = function(x) { return x.toString(); }
161
+ Content.registerProcessor(
162
+ ["text/html","text/plain","text"],
163
+ { parser: identity, stringify: toString });
164
+
165
+ // Register the JSON processor, which is used for JSON-based media types.
166
+ Content.registerProcessor(
167
+ ["application/json; charset=utf-8","application/json","json"],
168
+ {
169
+ parser: function(string) {
170
+ return JSON.parse(string);
171
+ },
172
+ stringify: function(data) {
173
+ return JSON.stringify(data); }});
174
+
175
+ var qs = require('querystring');
176
+ // Register the post processor, which is used for JSON-based media types.
177
+ Content.registerProcessor(
178
+ ["application/x-www-form-urlencoded"],
179
+ { parser : qs.parse, stringify : qs.stringify });
180
+
181
+ // Error functions are defined separately here in an attempt to make the code
182
+ // easier to read.
183
+ var Errors = {
184
+ setDataWithBody: function(object) {
185
+ throw new Error("Attempt to set data attribute of a content object " +
186
+ "when the body attributes was already set.");
187
+ },
188
+ setBodyWithData: function(object) {
189
+ throw new Error("Attempt to set body attribute of a content object " +
190
+ "when the data attributes was already set.");
191
+ }
192
+ }
193
+ module.exports = Content;
@@ -1,1204 +1,1199 @@
1
- $(function() {
2
-
3
- // Helper function for vertically aligning DOM elements
4
- // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
5
- $.fn.vAlign = function() {
6
- return this.each(function(i){
7
- var ah = $(this).height();
8
- var ph = $(this).parent().height();
9
- var mh = (ph - ah) / 2;
10
- $(this).css('margin-top', mh);
11
- });
12
- };
13
-
14
- $.fn.stretchFormtasticInputWidthToParent = function() {
15
- return this.each(function(i){
16
- var p_width = $(this).closest("form").innerWidth();
17
- var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10);
18
- var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
19
- $(this).css('width', p_width - p_padding - this_padding);
20
- });
21
- };
22
-
23
- $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
24
-
25
- // Vertically center these paragraphs
26
- // Parent may need a min-height for this to work..
27
- $('ul.downplayed li div.content p').vAlign();
28
-
29
- // When a sandbox form is submitted..
30
- $("form.sandbox").submit(function(){
31
-
32
- var error_free = true;
33
-
34
- // Cycle through the forms required inputs
35
- $(this).find("input.required").each(function() {
36
-
37
- // Remove any existing error styles from the input
38
- $(this).removeClass('error');
39
-
40
- // Tack the error style on if the input is empty..
41
- if ($(this).val() == '') {
42
- $(this).addClass('error');
43
- $(this).wiggle();
44
- error_free = false;
45
- }
46
-
47
- });
48
-
49
- return error_free;
50
- });
51
-
52
- });
53
-
54
- function clippyCopiedCallback(a) {
55
- $('#api_key_copied').fadeIn().delay(1000).fadeOut();
56
-
57
- // var b = $("#clippy_tooltip_" + a);
58
- // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
59
- // b.attr("title", "copy to clipboard")
60
- // },
61
- // 500))
62
- }
63
-
64
- // Logging function that accounts for browsers that don't have window.console
65
- function log() {
66
- if (window.console) console.log.apply(console,arguments);
67
- }
68
- // Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
69
- if (Function.prototype.bind && console && typeof console.log == "object") {
70
- [
71
- "log","info","warn","error","assert","dir","clear","profile","profileEnd"
72
- ].forEach(function (method) {
73
- console[method] = this.bind(console[method], console);
74
- }, Function.prototype.call);
75
- }
76
-
77
- var Docs = {
78
-
79
- shebang: function() {
80
-
81
- // If shebang has an operation nickname in it..
82
- // e.g. /docs/#!/words/get_search
83
- var fragments = $.param.fragment().split('/');
84
- fragments.shift(); // get rid of the bang
85
-
86
- switch (fragments.length) {
87
- case 1:
88
- // Expand all operations for the resource and scroll to it
89
- // log('shebang resource:' + fragments[0]);
90
- var dom_id = 'resource_' + fragments[0];
91
-
92
- Docs.expandEndpointListForResource(fragments[0]);
93
- $("#"+dom_id).slideto({highlight: false});
94
- break;
95
- case 2:
96
- // Refer to the endpoint DOM element, e.g. #words_get_search
97
- // log('shebang endpoint: ' + fragments.join('_'));
98
-
99
- // Expand Resource
100
- Docs.expandEndpointListForResource(fragments[0]);
101
- $("#"+dom_id).slideto({highlight: false});
102
-
103
- // Expand operation
104
- var li_dom_id = fragments.join('_');
105
- var li_content_dom_id = li_dom_id + "_content";
106
-
107
- // log("li_dom_id " + li_dom_id);
108
- // log("li_content_dom_id " + li_content_dom_id);
109
-
110
- Docs.expandOperation($('#'+li_content_dom_id));
111
- $('#'+li_dom_id).slideto({highlight: false});
112
- break;
113
- }
114
-
115
- },
116
-
117
- toggleEndpointListForResource: function(resource) {
118
- var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
119
- if (elem.is(':visible')) {
120
- Docs.collapseEndpointListForResource(resource);
121
- } else {
122
- Docs.expandEndpointListForResource(resource);
123
- }
124
- },
125
-
126
- // Expand resource
127
- expandEndpointListForResource: function(resource) {
128
- var resource = Docs.escapeResourceName(resource);
129
- if (resource == '') {
130
- $('.resource ul.endpoints').slideDown();
131
- return;
132
- }
133
-
134
- $('li#resource_' + resource).addClass('active');
135
-
136
- var elem = $('li#resource_' + resource + ' ul.endpoints');
137
- elem.slideDown();
138
- },
139
-
140
- // Collapse resource and mark as explicitly closed
141
- collapseEndpointListForResource: function(resource) {
142
- var resource = Docs.escapeResourceName(resource);
143
- $('li#resource_' + resource).removeClass('active');
144
-
145
- var elem = $('li#resource_' + resource + ' ul.endpoints');
146
- elem.slideUp();
147
- },
148
-
149
- expandOperationsForResource: function(resource) {
150
- // Make sure the resource container is open..
151
- Docs.expandEndpointListForResource(resource);
152
-
153
- if (resource == '') {
154
- $('.resource ul.endpoints li.operation div.content').slideDown();
155
- return;
156
- }
157
-
158
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
159
- Docs.expandOperation($(this));
160
- });
161
- },
162
-
163
- collapseOperationsForResource: function(resource) {
164
- // Make sure the resource container is open..
165
- Docs.expandEndpointListForResource(resource);
166
-
167
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
168
- Docs.collapseOperation($(this));
169
- });
170
- },
171
-
172
- escapeResourceName: function(resource) {
173
- return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
174
- },
175
-
176
- expandOperation: function(elem) {
177
- elem.slideDown();
178
- },
179
-
180
- collapseOperation: function(elem) {
181
- elem.slideUp();
182
- }
183
-
184
- };
1
+ $(function() {
2
+
3
+ // Helper function for vertically aligning DOM elements
4
+ // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
5
+ $.fn.vAlign = function() {
6
+ return this.each(function(i){
7
+ var ah = $(this).height();
8
+ var ph = $(this).parent().height();
9
+ var mh = (ph - ah) / 2;
10
+ $(this).css('margin-top', mh);
11
+ });
12
+ };
13
+
14
+ $.fn.stretchFormtasticInputWidthToParent = function() {
15
+ return this.each(function(i){
16
+ var p_width = $(this).closest("form").innerWidth();
17
+ var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10);
18
+ var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
19
+ $(this).css('width', p_width - p_padding - this_padding);
20
+ });
21
+ };
22
+
23
+ $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
24
+
25
+ // Vertically center these paragraphs
26
+ // Parent may need a min-height for this to work..
27
+ $('ul.downplayed li div.content p').vAlign();
28
+
29
+ // When a sandbox form is submitted..
30
+ $("form.sandbox").submit(function(){
31
+
32
+ var error_free = true;
33
+
34
+ // Cycle through the forms required inputs
35
+ $(this).find("input.required").each(function() {
36
+
37
+ // Remove any existing error styles from the input
38
+ $(this).removeClass('error');
39
+
40
+ // Tack the error style on if the input is empty..
41
+ if ($(this).val() == '') {
42
+ $(this).addClass('error');
43
+ $(this).wiggle();
44
+ error_free = false;
45
+ }
46
+
47
+ });
48
+
49
+ return error_free;
50
+ });
51
+
52
+ });
53
+
54
+ function clippyCopiedCallback(a) {
55
+ $('#api_key_copied').fadeIn().delay(1000).fadeOut();
56
+
57
+ // var b = $("#clippy_tooltip_" + a);
58
+ // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
59
+ // b.attr("title", "copy to clipboard")
60
+ // },
61
+ // 500))
62
+ }
63
+
64
+ // Logging function that accounts for browsers that don't have window.console
65
+ function log() {
66
+ if (window.console) console.log.apply(console,arguments);
67
+ }
68
+ // Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
69
+ if (Function.prototype.bind && console && typeof console.log == "object") {
70
+ [
71
+ "log","info","warn","error","assert","dir","clear","profile","profileEnd"
72
+ ].forEach(function (method) {
73
+ console[method] = this.bind(console[method], console);
74
+ }, Function.prototype.call);
75
+ }
76
+
77
+ var Docs = {
78
+
79
+ shebang: function() {
80
+
81
+ // If shebang has an operation nickname in it..
82
+ // e.g. /docs/#!/words/get_search
83
+ var fragments = $.param.fragment().split('/');
84
+ fragments.shift(); // get rid of the bang
85
+
86
+ switch (fragments.length) {
87
+ case 1:
88
+ // Expand all operations for the resource and scroll to it
89
+ // log('shebang resource:' + fragments[0]);
90
+ var dom_id = 'resource_' + fragments[0];
91
+
92
+ Docs.expandEndpointListForResource(fragments[0]);
93
+ $("#"+dom_id).slideto({highlight: false});
94
+ break;
95
+ case 2:
96
+ // Refer to the endpoint DOM element, e.g. #words_get_search
97
+ // log('shebang endpoint: ' + fragments.join('_'));
98
+
99
+ // Expand Resource
100
+ Docs.expandEndpointListForResource(fragments[0]);
101
+ $("#"+dom_id).slideto({highlight: false});
102
+
103
+ // Expand operation
104
+ var li_dom_id = fragments.join('_');
105
+ var li_content_dom_id = li_dom_id + "_content";
106
+
107
+ // log("li_dom_id " + li_dom_id);
108
+ // log("li_content_dom_id " + li_content_dom_id);
109
+
110
+ Docs.expandOperation($('#'+li_content_dom_id));
111
+ $('#'+li_dom_id).slideto({highlight: false});
112
+ break;
113
+ }
114
+
115
+ },
116
+
117
+ toggleEndpointListForResource: function(resource) {
118
+ var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
119
+ if (elem.is(':visible')) {
120
+ Docs.collapseEndpointListForResource(resource);
121
+ } else {
122
+ Docs.expandEndpointListForResource(resource);
123
+ }
124
+ },
125
+
126
+ // Expand resource
127
+ expandEndpointListForResource: function(resource) {
128
+ var resource = Docs.escapeResourceName(resource);
129
+ if (resource == '') {
130
+ $('.resource ul.endpoints').slideDown();
131
+ return;
132
+ }
133
+
134
+ $('li#resource_' + resource).addClass('active');
135
+
136
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
137
+ elem.slideDown();
138
+ },
139
+
140
+ // Collapse resource and mark as explicitly closed
141
+ collapseEndpointListForResource: function(resource) {
142
+ var resource = Docs.escapeResourceName(resource);
143
+ $('li#resource_' + resource).removeClass('active');
144
+
145
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
146
+ elem.slideUp();
147
+ },
148
+
149
+ expandOperationsForResource: function(resource) {
150
+ // Make sure the resource container is open..
151
+ Docs.expandEndpointListForResource(resource);
152
+
153
+ if (resource == '') {
154
+ $('.resource ul.endpoints li.operation div.content').slideDown();
155
+ return;
156
+ }
157
+
158
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
159
+ Docs.expandOperation($(this));
160
+ });
161
+ },
162
+
163
+ collapseOperationsForResource: function(resource) {
164
+ // Make sure the resource container is open..
165
+ Docs.expandEndpointListForResource(resource);
166
+
167
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
168
+ Docs.collapseOperation($(this));
169
+ });
170
+ },
171
+
172
+ escapeResourceName: function(resource) {
173
+ return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
174
+ },
175
+
176
+ expandOperation: function(elem) {
177
+ elem.slideDown();
178
+ },
179
+
180
+ collapseOperation: function(elem) {
181
+ elem.slideUp();
182
+ }
183
+
184
+ };
185
185
  (function() {
186
186
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
187
187
  templates['content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
188
- helpers = helpers || Handlebars.helpers;
189
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0;
188
+ this.compilerInfo = [4,'>= 1.0.0'];
189
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
190
+ var buffer = "", stack1, functionType="function", self=this;
190
191
 
191
192
  function program1(depth0,data) {
192
193
 
193
- var buffer = "", stack1, stack2;
194
- buffer += "\n ";
195
- foundHelper = helpers.produces;
196
- stack1 = foundHelper || depth0.produces;
197
- stack2 = helpers.each;
198
- tmp1 = self.program(2, program2, data);
199
- tmp1.hash = {};
200
- tmp1.fn = tmp1;
201
- tmp1.inverse = self.noop;
202
- stack1 = stack2.call(depth0, stack1, tmp1);
194
+ var buffer = "", stack1;
195
+ buffer += "\n ";
196
+ stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
203
197
  if(stack1 || stack1 === 0) { buffer += stack1; }
204
198
  buffer += "\n";
205
- return buffer;}
199
+ return buffer;
200
+ }
206
201
  function program2(depth0,data) {
207
202
 
208
203
  var buffer = "", stack1;
209
204
  buffer += "\n <option value=\"";
210
- stack1 = depth0;
211
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
212
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "this", { hash: {} }); }
205
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
213
206
  if(stack1 || stack1 === 0) { buffer += stack1; }
214
207
  buffer += "\">";
215
- stack1 = depth0;
216
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
217
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "this", { hash: {} }); }
208
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
218
209
  if(stack1 || stack1 === 0) { buffer += stack1; }
219
210
  buffer += "</option>\n ";
220
- return buffer;}
211
+ return buffer;
212
+ }
221
213
 
222
214
  function program4(depth0,data) {
223
215
 
224
216
 
225
- return "\n <option value=\"application/json\">application/json</option>\n";}
217
+ return "\n <option value=\"application/json\">application/json</option>\n";
218
+ }
226
219
 
227
220
  buffer += "<label for=\"contentType\"></label>\n<select name=\"contentType\">\n";
228
- foundHelper = helpers.produces;
229
- stack1 = foundHelper || depth0.produces;
230
- stack2 = helpers['if'];
231
- tmp1 = self.program(1, program1, data);
232
- tmp1.hash = {};
233
- tmp1.fn = tmp1;
234
- tmp1.inverse = self.program(4, program4, data);
235
- stack1 = stack2.call(depth0, stack1, tmp1);
221
+ stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
236
222
  if(stack1 || stack1 === 0) { buffer += stack1; }
237
223
  buffer += "\n</select>\n";
238
- return buffer;});
224
+ return buffer;
225
+ });
239
226
  })();
240
227
 
241
228
  (function() {
242
229
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
243
230
  templates['main'] = template(function (Handlebars,depth0,helpers,partials,data) {
244
- helpers = helpers || Handlebars.helpers;
245
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
231
+ this.compilerInfo = [4,'>= 1.0.0'];
232
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
233
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
246
234
 
247
235
  function program1(depth0,data) {
248
236
 
237
+ var buffer = "", stack1, stack2;
238
+ buffer += "\n <div class=\"info_title\">"
239
+ + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
240
+ + "</div>\n <div class=\"info_description\">";
241
+ stack2 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.description)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
242
+ if(stack2 || stack2 === 0) { buffer += stack2; }
243
+ buffer += "</div>\n ";
244
+ stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.termsOfServiceUrl), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
245
+ if(stack2 || stack2 === 0) { buffer += stack2; }
246
+ buffer += "\n ";
247
+ stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
248
+ if(stack2 || stack2 === 0) { buffer += stack2; }
249
+ buffer += "\n ";
250
+ stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
251
+ if(stack2 || stack2 === 0) { buffer += stack2; }
252
+ buffer += "\n ";
253
+ return buffer;
254
+ }
255
+ function program2(depth0,data) {
256
+
257
+ var buffer = "", stack1;
258
+ buffer += "<div class=\"info_tos\"><a href=\""
259
+ + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.termsOfServiceUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
260
+ + "\">Terms of service</a></div>";
261
+ return buffer;
262
+ }
263
+
264
+ function program4(depth0,data) {
265
+
266
+ var buffer = "", stack1;
267
+ buffer += "<div class='info_contact'><a href=\"mailto:"
268
+ + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
269
+ + "\">Contact the developer</a></div>";
270
+ return buffer;
271
+ }
272
+
273
+ function program6(depth0,data) {
274
+
275
+ var buffer = "", stack1;
276
+ buffer += "<div class='info_license'><a href='"
277
+ + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.licenseUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
278
+ + "'>"
279
+ + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
280
+ + "</a></div>";
281
+ return buffer;
282
+ }
283
+
284
+ function program8(depth0,data) {
285
+
249
286
  var buffer = "", stack1;
250
287
  buffer += "\n , <span style=\"font-variant: small-caps\">api version</span>: ";
251
- foundHelper = helpers.apiVersion;
252
- stack1 = foundHelper || depth0.apiVersion;
253
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
254
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "apiVersion", { hash: {} }); }
255
- buffer += escapeExpression(stack1) + "\n ";
256
- return buffer;}
257
-
258
- buffer += "\n<div class='container' id='resources_container'>\n <ul id='resources'>\n </ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";
259
- foundHelper = helpers.basePath;
260
- stack1 = foundHelper || depth0.basePath;
261
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
262
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "basePath", { hash: {} }); }
263
- buffer += escapeExpression(stack1) + "\n ";
264
- foundHelper = helpers.apiVersion;
265
- stack1 = foundHelper || depth0.apiVersion;
266
- stack2 = helpers['if'];
267
- tmp1 = self.program(1, program1, data);
268
- tmp1.hash = {};
269
- tmp1.fn = tmp1;
270
- tmp1.inverse = self.noop;
271
- stack1 = stack2.call(depth0, stack1, tmp1);
288
+ if (stack1 = helpers.apiVersion) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
289
+ else { stack1 = depth0.apiVersion; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
290
+ buffer += escapeExpression(stack1)
291
+ + "\n ";
292
+ return buffer;
293
+ }
294
+
295
+ buffer += "<div class='info' id='api_info'>\n ";
296
+ stack1 = helpers['if'].call(depth0, depth0.info, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
297
+ if(stack1 || stack1 === 0) { buffer += stack1; }
298
+ buffer += "\n</div>\n<div class='container' id='resources_container'>\n <ul id='resources'>\n </ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";
299
+ if (stack1 = helpers.basePath) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
300
+ else { stack1 = depth0.basePath; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
301
+ buffer += escapeExpression(stack1)
302
+ + "\n ";
303
+ stack1 = helpers['if'].call(depth0, depth0.apiVersion, {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data});
272
304
  if(stack1 || stack1 === 0) { buffer += stack1; }
273
305
  buffer += "]</h4>\n </div>\n</div>\n";
274
- return buffer;});
306
+ return buffer;
307
+ });
275
308
  })();
276
309
 
277
310
  (function() {
278
311
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
279
312
  templates['operation'] = template(function (Handlebars,depth0,helpers,partials,data) {
280
- helpers = helpers || Handlebars.helpers;
281
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
313
+ this.compilerInfo = [4,'>= 1.0.0'];
314
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
315
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
282
316
 
283
317
  function program1(depth0,data) {
284
318
 
285
319
  var buffer = "", stack1;
286
- buffer += "\n <h4>Implementation Notes</h4>\n <p>";
287
- foundHelper = helpers.notes;
288
- stack1 = foundHelper || depth0.notes;
289
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
290
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "notes", { hash: {} }); }
320
+ buffer += "\n <h4>Implementation Notes</h4>\n <p>";
321
+ if (stack1 = helpers.notes) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
322
+ else { stack1 = depth0.notes; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
291
323
  if(stack1 || stack1 === 0) { buffer += stack1; }
292
- buffer += "</p>\n ";
293
- return buffer;}
324
+ buffer += "</p>\n ";
325
+ return buffer;
326
+ }
294
327
 
295
328
  function program3(depth0,data) {
296
329
 
297
330
 
298
- return "\n <h4>Response Class</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"content-type\" />\n ";}
331
+ return "\n <h4>Response Class</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n ";
332
+ }
299
333
 
300
334
  function program5(depth0,data) {
301
335
 
302
336
 
303
- return "\n <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" >Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 320px; max-width: 330px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n ";}
337
+ return "\n <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\">Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 100px; max-width: 100px\">Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n ";
338
+ }
304
339
 
305
340
  function program7(depth0,data) {
306
341
 
307
342
 
308
- return "\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Error Status Codes</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n ";}
343
+ return "\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Error Status Codes</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n ";
344
+ }
309
345
 
310
346
  function program9(depth0,data) {
311
347
 
312
348
 
313
- return "\n ";}
349
+ return "\n ";
350
+ }
314
351
 
315
352
  function program11(depth0,data) {
316
353
 
317
354
 
318
- return "\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <img alt='Throbber' class='response_throbber' src='/assets/grape_swagger_rails/throbber.gif' style='display:none' />\n </div>\n ";}
319
-
320
- buffer += "\n <ul class='operations' >\n <li class='";
321
- foundHelper = helpers.httpMethod;
322
- stack1 = foundHelper || depth0.httpMethod;
323
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
324
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
325
- buffer += escapeExpression(stack1) + " operation' id='";
326
- foundHelper = helpers.resourceName;
327
- stack1 = foundHelper || depth0.resourceName;
328
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
329
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "resourceName", { hash: {} }); }
330
- buffer += escapeExpression(stack1) + "_";
331
- foundHelper = helpers.nickname;
332
- stack1 = foundHelper || depth0.nickname;
333
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
334
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "nickname", { hash: {} }); }
335
- buffer += escapeExpression(stack1) + "_";
336
- foundHelper = helpers.httpMethod;
337
- stack1 = foundHelper || depth0.httpMethod;
338
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
339
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
340
- buffer += escapeExpression(stack1) + "_";
341
- foundHelper = helpers.number;
342
- stack1 = foundHelper || depth0.number;
343
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
344
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
345
- buffer += escapeExpression(stack1) + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";
346
- foundHelper = helpers.resourceName;
347
- stack1 = foundHelper || depth0.resourceName;
348
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
349
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "resourceName", { hash: {} }); }
350
- buffer += escapeExpression(stack1) + "/";
351
- foundHelper = helpers.nickname;
352
- stack1 = foundHelper || depth0.nickname;
353
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
354
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "nickname", { hash: {} }); }
355
- buffer += escapeExpression(stack1) + "_";
356
- foundHelper = helpers.httpMethod;
357
- stack1 = foundHelper || depth0.httpMethod;
358
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
359
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
360
- buffer += escapeExpression(stack1) + "_";
361
- foundHelper = helpers.number;
362
- stack1 = foundHelper || depth0.number;
363
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
364
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
365
- buffer += escapeExpression(stack1) + "' class=\"toggleOperation\">";
366
- foundHelper = helpers.httpMethod;
367
- stack1 = foundHelper || depth0.httpMethod;
368
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
369
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
370
- buffer += escapeExpression(stack1) + "</a>\n </span>\n <span class='path'>\n <a href='#!/";
371
- foundHelper = helpers.resourceName;
372
- stack1 = foundHelper || depth0.resourceName;
373
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
374
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "resourceName", { hash: {} }); }
375
- buffer += escapeExpression(stack1) + "/";
376
- foundHelper = helpers.nickname;
377
- stack1 = foundHelper || depth0.nickname;
378
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
379
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "nickname", { hash: {} }); }
380
- buffer += escapeExpression(stack1) + "_";
381
- foundHelper = helpers.httpMethod;
382
- stack1 = foundHelper || depth0.httpMethod;
383
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
384
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
385
- buffer += escapeExpression(stack1) + "_";
386
- foundHelper = helpers.number;
387
- stack1 = foundHelper || depth0.number;
388
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
389
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
390
- buffer += escapeExpression(stack1) + "' class=\"toggleOperation\">";
391
- foundHelper = helpers.path;
392
- stack1 = foundHelper || depth0.path;
393
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
394
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "path", { hash: {} }); }
395
- buffer += escapeExpression(stack1) + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";
396
- foundHelper = helpers.resourceName;
397
- stack1 = foundHelper || depth0.resourceName;
398
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
399
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "resourceName", { hash: {} }); }
400
- buffer += escapeExpression(stack1) + "/";
401
- foundHelper = helpers.nickname;
402
- stack1 = foundHelper || depth0.nickname;
403
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
404
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "nickname", { hash: {} }); }
405
- buffer += escapeExpression(stack1) + "_";
406
- foundHelper = helpers.httpMethod;
407
- stack1 = foundHelper || depth0.httpMethod;
408
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
409
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
410
- buffer += escapeExpression(stack1) + "_";
411
- foundHelper = helpers.number;
412
- stack1 = foundHelper || depth0.number;
413
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
414
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
415
- buffer += escapeExpression(stack1) + "' class=\"toggleOperation\">";
416
- foundHelper = helpers.summary;
417
- stack1 = foundHelper || depth0.summary;
418
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
419
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "summary", { hash: {} }); }
355
+ return "\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <img alt='Throbber' class='response_throbber' src='/assets/grape_swagger_rails/throbber.gif' style='display:none' />\n </div>\n ";
356
+ }
357
+
358
+ buffer += "\n <ul class='operations' >\n <li class='";
359
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
360
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
361
+ buffer += escapeExpression(stack1)
362
+ + " operation' id='";
363
+ if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
364
+ else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
365
+ buffer += escapeExpression(stack1)
366
+ + "_";
367
+ if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
368
+ else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
369
+ buffer += escapeExpression(stack1)
370
+ + "_";
371
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
372
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
373
+ buffer += escapeExpression(stack1)
374
+ + "_";
375
+ if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
376
+ else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
377
+ buffer += escapeExpression(stack1)
378
+ + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";
379
+ if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
380
+ else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
381
+ buffer += escapeExpression(stack1)
382
+ + "/";
383
+ if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
384
+ else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
385
+ buffer += escapeExpression(stack1)
386
+ + "_";
387
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
388
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
389
+ buffer += escapeExpression(stack1)
390
+ + "_";
391
+ if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
392
+ else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
393
+ buffer += escapeExpression(stack1)
394
+ + "' class=\"toggleOperation\">";
395
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
396
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
397
+ buffer += escapeExpression(stack1)
398
+ + "</a>\n </span>\n <span class='path'>\n <a href='#!/";
399
+ if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
400
+ else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
401
+ buffer += escapeExpression(stack1)
402
+ + "/";
403
+ if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
404
+ else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
405
+ buffer += escapeExpression(stack1)
406
+ + "_";
407
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
408
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
409
+ buffer += escapeExpression(stack1)
410
+ + "_";
411
+ if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
412
+ else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
413
+ buffer += escapeExpression(stack1)
414
+ + "' class=\"toggleOperation\">";
415
+ if (stack1 = helpers.path) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
416
+ else { stack1 = depth0.path; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
417
+ buffer += escapeExpression(stack1)
418
+ + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";
419
+ if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
420
+ else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
421
+ buffer += escapeExpression(stack1)
422
+ + "/";
423
+ if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
424
+ else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
425
+ buffer += escapeExpression(stack1)
426
+ + "_";
427
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
428
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
429
+ buffer += escapeExpression(stack1)
430
+ + "_";
431
+ if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
432
+ else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
433
+ buffer += escapeExpression(stack1)
434
+ + "' class=\"toggleOperation\">";
435
+ if (stack1 = helpers.summary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
436
+ else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
420
437
  if(stack1 || stack1 === 0) { buffer += stack1; }
421
- buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";
422
- foundHelper = helpers.resourceName;
423
- stack1 = foundHelper || depth0.resourceName;
424
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
425
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "resourceName", { hash: {} }); }
426
- buffer += escapeExpression(stack1) + "_";
427
- foundHelper = helpers.nickname;
428
- stack1 = foundHelper || depth0.nickname;
429
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
430
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "nickname", { hash: {} }); }
431
- buffer += escapeExpression(stack1) + "_";
432
- foundHelper = helpers.httpMethod;
433
- stack1 = foundHelper || depth0.httpMethod;
434
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
435
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "httpMethod", { hash: {} }); }
436
- buffer += escapeExpression(stack1) + "_";
437
- foundHelper = helpers.number;
438
- stack1 = foundHelper || depth0.number;
439
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
440
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
441
- buffer += escapeExpression(stack1) + "_content' style='display:none'>\n ";
442
- foundHelper = helpers.notes;
443
- stack1 = foundHelper || depth0.notes;
444
- stack2 = helpers['if'];
445
- tmp1 = self.program(1, program1, data);
446
- tmp1.hash = {};
447
- tmp1.fn = tmp1;
448
- tmp1.inverse = self.noop;
449
- stack1 = stack2.call(depth0, stack1, tmp1);
438
+ buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";
439
+ if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
440
+ else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
441
+ buffer += escapeExpression(stack1)
442
+ + "_";
443
+ if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
444
+ else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
445
+ buffer += escapeExpression(stack1)
446
+ + "_";
447
+ if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
448
+ else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
449
+ buffer += escapeExpression(stack1)
450
+ + "_";
451
+ if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
452
+ else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
453
+ buffer += escapeExpression(stack1)
454
+ + "_content' style='display:none'>\n ";
455
+ stack1 = helpers['if'].call(depth0, depth0.notes, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
450
456
  if(stack1 || stack1 === 0) { buffer += stack1; }
451
- buffer += "\n ";
452
- foundHelper = helpers.responseClass;
453
- stack1 = foundHelper || depth0.responseClass;
454
- stack2 = helpers['if'];
455
- tmp1 = self.program(3, program3, data);
456
- tmp1.hash = {};
457
- tmp1.fn = tmp1;
458
- tmp1.inverse = self.noop;
459
- stack1 = stack2.call(depth0, stack1, tmp1);
457
+ buffer += "\n ";
458
+ stack1 = helpers['if'].call(depth0, depth0.type, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
460
459
  if(stack1 || stack1 === 0) { buffer += stack1; }
461
- buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";
462
- foundHelper = helpers.parameters;
463
- stack1 = foundHelper || depth0.parameters;
464
- stack2 = helpers['if'];
465
- tmp1 = self.program(5, program5, data);
466
- tmp1.hash = {};
467
- tmp1.fn = tmp1;
468
- tmp1.inverse = self.noop;
469
- stack1 = stack2.call(depth0, stack1, tmp1);
460
+ buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";
461
+ stack1 = helpers['if'].call(depth0, depth0.parameters, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
470
462
  if(stack1 || stack1 === 0) { buffer += stack1; }
471
- buffer += "\n ";
472
- foundHelper = helpers.errorResponses;
473
- stack1 = foundHelper || depth0.errorResponses;
474
- stack2 = helpers['if'];
475
- tmp1 = self.program(7, program7, data);
476
- tmp1.hash = {};
477
- tmp1.fn = tmp1;
478
- tmp1.inverse = self.noop;
479
- stack1 = stack2.call(depth0, stack1, tmp1);
463
+ buffer += "\n ";
464
+ stack1 = helpers['if'].call(depth0, depth0.responseMessages, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
480
465
  if(stack1 || stack1 === 0) { buffer += stack1; }
481
- buffer += "\n ";
482
- foundHelper = helpers.isReadOnly;
483
- stack1 = foundHelper || depth0.isReadOnly;
484
- stack2 = helpers['if'];
485
- tmp1 = self.program(9, program9, data);
486
- tmp1.hash = {};
487
- tmp1.fn = tmp1;
488
- tmp1.inverse = self.program(11, program11, data);
489
- stack1 = stack2.call(depth0, stack1, tmp1);
466
+ buffer += "\n ";
467
+ stack1 = helpers['if'].call(depth0, depth0.isReadOnly, {hash:{},inverse:self.program(11, program11, data),fn:self.program(9, program9, data),data:data});
490
468
  if(stack1 || stack1 === 0) { buffer += stack1; }
491
- buffer += "\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
492
- return buffer;});
469
+ buffer += "\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
470
+ return buffer;
471
+ });
493
472
  })();
494
473
 
495
474
  (function() {
496
475
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
497
476
  templates['param'] = template(function (Handlebars,depth0,helpers,partials,data) {
498
- helpers = helpers || Handlebars.helpers;
499
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
477
+ this.compilerInfo = [4,'>= 1.0.0'];
478
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
479
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
500
480
 
501
481
  function program1(depth0,data) {
502
482
 
503
- var buffer = "", stack1, stack2;
483
+ var buffer = "", stack1;
504
484
  buffer += "\n ";
505
- foundHelper = helpers.isFile;
506
- stack1 = foundHelper || depth0.isFile;
507
- stack2 = helpers['if'];
508
- tmp1 = self.program(2, program2, data);
509
- tmp1.hash = {};
510
- tmp1.fn = tmp1;
511
- tmp1.inverse = self.program(4, program4, data);
512
- stack1 = stack2.call(depth0, stack1, tmp1);
485
+ stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
513
486
  if(stack1 || stack1 === 0) { buffer += stack1; }
514
487
  buffer += "\n ";
515
- return buffer;}
488
+ return buffer;
489
+ }
516
490
  function program2(depth0,data) {
517
491
 
518
492
  var buffer = "", stack1;
519
493
  buffer += "\n <input type=\"file\" name='";
520
- foundHelper = helpers.name;
521
- stack1 = foundHelper || depth0.name;
522
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
523
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
524
- buffer += escapeExpression(stack1) + "'/>\n ";
525
- return buffer;}
494
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
495
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
496
+ buffer += escapeExpression(stack1)
497
+ + "'/>\n <div class=\"parameter-content-type\" />\n ";
498
+ return buffer;
499
+ }
526
500
 
527
501
  function program4(depth0,data) {
528
502
 
529
- var buffer = "", stack1, stack2;
503
+ var buffer = "", stack1;
530
504
  buffer += "\n ";
531
- foundHelper = helpers.defaultValue;
532
- stack1 = foundHelper || depth0.defaultValue;
533
- stack2 = helpers['if'];
534
- tmp1 = self.program(5, program5, data);
535
- tmp1.hash = {};
536
- tmp1.fn = tmp1;
537
- tmp1.inverse = self.program(7, program7, data);
538
- stack1 = stack2.call(depth0, stack1, tmp1);
505
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
539
506
  if(stack1 || stack1 === 0) { buffer += stack1; }
540
507
  buffer += "\n ";
541
- return buffer;}
508
+ return buffer;
509
+ }
542
510
  function program5(depth0,data) {
543
511
 
544
512
  var buffer = "", stack1;
545
513
  buffer += "\n <textarea class='body-textarea' name='";
546
- foundHelper = helpers.name;
547
- stack1 = foundHelper || depth0.name;
548
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
549
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
550
- buffer += escapeExpression(stack1) + "'>";
551
- foundHelper = helpers.defaultValue;
552
- stack1 = foundHelper || depth0.defaultValue;
553
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
554
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
555
- buffer += escapeExpression(stack1) + "</textarea>\n ";
556
- return buffer;}
514
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
515
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
516
+ buffer += escapeExpression(stack1)
517
+ + "'>";
518
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
519
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
520
+ buffer += escapeExpression(stack1)
521
+ + "</textarea>\n ";
522
+ return buffer;
523
+ }
557
524
 
558
525
  function program7(depth0,data) {
559
526
 
560
527
  var buffer = "", stack1;
561
528
  buffer += "\n <textarea class='body-textarea' name='";
562
- foundHelper = helpers.name;
563
- stack1 = foundHelper || depth0.name;
564
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
565
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
566
- buffer += escapeExpression(stack1) + "'></textarea>\n <br />\n <div class=\"content-type\" />\n ";
567
- return buffer;}
529
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
530
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
531
+ buffer += escapeExpression(stack1)
532
+ + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n ";
533
+ return buffer;
534
+ }
568
535
 
569
536
  function program9(depth0,data) {
570
537
 
571
- var buffer = "", stack1, stack2;
538
+ var buffer = "", stack1;
572
539
  buffer += "\n ";
573
- foundHelper = helpers.defaultValue;
574
- stack1 = foundHelper || depth0.defaultValue;
575
- stack2 = helpers['if'];
576
- tmp1 = self.program(10, program10, data);
577
- tmp1.hash = {};
578
- tmp1.fn = tmp1;
579
- tmp1.inverse = self.program(12, program12, data);
580
- stack1 = stack2.call(depth0, stack1, tmp1);
540
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
581
541
  if(stack1 || stack1 === 0) { buffer += stack1; }
582
542
  buffer += "\n ";
583
- return buffer;}
543
+ return buffer;
544
+ }
584
545
  function program10(depth0,data) {
585
546
 
586
547
  var buffer = "", stack1;
587
548
  buffer += "\n <input class='parameter' minlength='0' name='";
588
- foundHelper = helpers.name;
589
- stack1 = foundHelper || depth0.name;
590
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
591
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
592
- buffer += escapeExpression(stack1) + "' placeholder='' type='text' value='";
593
- foundHelper = helpers.defaultValue;
594
- stack1 = foundHelper || depth0.defaultValue;
595
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
596
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
597
- buffer += escapeExpression(stack1) + "'/>\n ";
598
- return buffer;}
549
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
550
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
551
+ buffer += escapeExpression(stack1)
552
+ + "' placeholder='' type='text' value='";
553
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
554
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
555
+ buffer += escapeExpression(stack1)
556
+ + "'/>\n ";
557
+ return buffer;
558
+ }
599
559
 
600
560
  function program12(depth0,data) {
601
561
 
602
562
  var buffer = "", stack1;
603
563
  buffer += "\n <input class='parameter' minlength='0' name='";
604
- foundHelper = helpers.name;
605
- stack1 = foundHelper || depth0.name;
606
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
607
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
608
- buffer += escapeExpression(stack1) + "' placeholder='' type='text' value=''/>\n ";
609
- return buffer;}
564
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
565
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
566
+ buffer += escapeExpression(stack1)
567
+ + "' placeholder='' type='text' value=''/>\n ";
568
+ return buffer;
569
+ }
610
570
 
611
571
  buffer += "<td class='code'>";
612
- foundHelper = helpers.name;
613
- stack1 = foundHelper || depth0.name;
614
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
615
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
616
- buffer += escapeExpression(stack1) + "</td>\n<td>\n\n ";
617
- foundHelper = helpers.isBody;
618
- stack1 = foundHelper || depth0.isBody;
619
- stack2 = helpers['if'];
620
- tmp1 = self.program(1, program1, data);
621
- tmp1.hash = {};
622
- tmp1.fn = tmp1;
623
- tmp1.inverse = self.program(9, program9, data);
624
- stack1 = stack2.call(depth0, stack1, tmp1);
572
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
573
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
574
+ buffer += escapeExpression(stack1)
575
+ + "</td>\n<td>\n\n ";
576
+ stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
625
577
  if(stack1 || stack1 === 0) { buffer += stack1; }
626
578
  buffer += "\n\n</td>\n<td>";
627
- foundHelper = helpers.description;
628
- stack1 = foundHelper || depth0.description;
629
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
630
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
579
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
580
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
581
+ if(stack1 || stack1 === 0) { buffer += stack1; }
582
+ buffer += "</td>\n<td>";
583
+ if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
584
+ else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
631
585
  if(stack1 || stack1 === 0) { buffer += stack1; }
632
- buffer += "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n\n";
633
- return buffer;});
586
+ buffer += "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n";
587
+ return buffer;
588
+ });
634
589
  })();
635
590
 
636
591
  (function() {
637
592
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
638
593
  templates['param_list'] = template(function (Handlebars,depth0,helpers,partials,data) {
639
- helpers = helpers || Handlebars.helpers;
640
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
594
+ this.compilerInfo = [4,'>= 1.0.0'];
595
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
596
+ var buffer = "", stack1, stack2, self=this, functionType="function", escapeExpression=this.escapeExpression;
641
597
 
642
598
  function program1(depth0,data) {
643
599
 
644
600
 
645
- return "\n ";}
601
+ return " multiple='multiple'";
602
+ }
646
603
 
647
604
  function program3(depth0,data) {
648
605
 
649
- var buffer = "", stack1, stack2;
650
- buffer += "\n ";
651
- foundHelper = helpers.defaultValue;
652
- stack1 = foundHelper || depth0.defaultValue;
653
- stack2 = helpers['if'];
654
- tmp1 = self.program(4, program4, data);
655
- tmp1.hash = {};
656
- tmp1.fn = tmp1;
657
- tmp1.inverse = self.program(6, program6, data);
658
- stack1 = stack2.call(depth0, stack1, tmp1);
659
- if(stack1 || stack1 === 0) { buffer += stack1; }
660
- buffer += "\n ";
661
- return buffer;}
662
- function program4(depth0,data) {
663
606
 
664
-
665
- return "\n ";}
607
+ return "\n ";
608
+ }
666
609
 
610
+ function program5(depth0,data) {
611
+
612
+ var buffer = "", stack1;
613
+ buffer += "\n ";
614
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
615
+ if(stack1 || stack1 === 0) { buffer += stack1; }
616
+ buffer += "\n ";
617
+ return buffer;
618
+ }
667
619
  function program6(depth0,data) {
668
620
 
669
621
 
670
- return "\n <option selected=\"\" value=''></option>\n ";}
622
+ return "\n ";
623
+ }
671
624
 
672
625
  function program8(depth0,data) {
673
626
 
674
- var buffer = "", stack1, stack2;
675
- buffer += "\n ";
676
- foundHelper = helpers.isDefault;
677
- stack1 = foundHelper || depth0.isDefault;
678
- stack2 = helpers['if'];
679
- tmp1 = self.program(9, program9, data);
680
- tmp1.hash = {};
681
- tmp1.fn = tmp1;
682
- tmp1.inverse = self.program(11, program11, data);
683
- stack1 = stack2.call(depth0, stack1, tmp1);
684
- if(stack1 || stack1 === 0) { buffer += stack1; }
627
+ var buffer = "", stack1;
685
628
  buffer += "\n ";
686
- return buffer;}
629
+ stack1 = helpers['if'].call(depth0, depth0.allowMultiple, {hash:{},inverse:self.program(11, program11, data),fn:self.program(9, program9, data),data:data});
630
+ if(stack1 || stack1 === 0) { buffer += stack1; }
631
+ buffer += "\n ";
632
+ return buffer;
633
+ }
687
634
  function program9(depth0,data) {
688
635
 
689
- var buffer = "", stack1;
690
- buffer += "\n <option value='";
691
- foundHelper = helpers.value;
692
- stack1 = foundHelper || depth0.value;
693
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
694
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "value", { hash: {} }); }
695
- buffer += escapeExpression(stack1) + "'>";
696
- foundHelper = helpers.value;
697
- stack1 = foundHelper || depth0.value;
698
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
699
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "value", { hash: {} }); }
700
- buffer += escapeExpression(stack1) + " (default)</option>\n ";
701
- return buffer;}
636
+
637
+ return "\n ";
638
+ }
702
639
 
703
640
  function program11(depth0,data) {
704
641
 
642
+
643
+ return "\n <option selected=\"\" value=''></option>\n ";
644
+ }
645
+
646
+ function program13(depth0,data) {
647
+
648
+ var buffer = "", stack1;
649
+ buffer += "\n ";
650
+ stack1 = helpers['if'].call(depth0, depth0.isDefault, {hash:{},inverse:self.program(16, program16, data),fn:self.program(14, program14, data),data:data});
651
+ if(stack1 || stack1 === 0) { buffer += stack1; }
652
+ buffer += "\n ";
653
+ return buffer;
654
+ }
655
+ function program14(depth0,data) {
656
+
705
657
  var buffer = "", stack1;
706
- buffer += "\n <option value='";
707
- foundHelper = helpers.value;
708
- stack1 = foundHelper || depth0.value;
709
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
710
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "value", { hash: {} }); }
711
- buffer += escapeExpression(stack1) + "'>";
712
- foundHelper = helpers.value;
713
- stack1 = foundHelper || depth0.value;
714
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
715
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "value", { hash: {} }); }
716
- buffer += escapeExpression(stack1) + "</option>\n ";
717
- return buffer;}
658
+ buffer += "\n <option selected=\"\" value='";
659
+ if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
660
+ else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
661
+ buffer += escapeExpression(stack1)
662
+ + "'>";
663
+ if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
664
+ else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
665
+ buffer += escapeExpression(stack1)
666
+ + " (default)</option>\n ";
667
+ return buffer;
668
+ }
669
+
670
+ function program16(depth0,data) {
671
+
672
+ var buffer = "", stack1;
673
+ buffer += "\n <option value='";
674
+ if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
675
+ else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
676
+ buffer += escapeExpression(stack1)
677
+ + "'>";
678
+ if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
679
+ else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
680
+ buffer += escapeExpression(stack1)
681
+ + "</option>\n ";
682
+ return buffer;
683
+ }
718
684
 
719
685
  buffer += "<td class='code'>";
720
- foundHelper = helpers.name;
721
- stack1 = foundHelper || depth0.name;
722
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
723
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
724
- buffer += escapeExpression(stack1) + "</td>\n<td>\n <select class='parameter' name='";
725
- foundHelper = helpers.name;
726
- stack1 = foundHelper || depth0.name;
727
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
728
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
729
- buffer += escapeExpression(stack1) + "'>\n ";
730
- foundHelper = helpers.required;
731
- stack1 = foundHelper || depth0.required;
732
- stack2 = helpers['if'];
733
- tmp1 = self.program(1, program1, data);
734
- tmp1.hash = {};
735
- tmp1.fn = tmp1;
736
- tmp1.inverse = self.program(3, program3, data);
737
- stack1 = stack2.call(depth0, stack1, tmp1);
738
- if(stack1 || stack1 === 0) { buffer += stack1; }
739
- buffer += "\n ";
740
- foundHelper = helpers.allowableValues;
741
- stack1 = foundHelper || depth0.allowableValues;
742
- stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.descriptiveValues);
743
- stack2 = helpers.each;
744
- tmp1 = self.program(8, program8, data);
745
- tmp1.hash = {};
746
- tmp1.fn = tmp1;
747
- tmp1.inverse = self.noop;
748
- stack1 = stack2.call(depth0, stack1, tmp1);
686
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
687
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
688
+ buffer += escapeExpression(stack1)
689
+ + "</td>\n<td>\n <select ";
690
+ stack1 = helpers['if'].call(depth0, depth0.allowMultiple, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
749
691
  if(stack1 || stack1 === 0) { buffer += stack1; }
750
- buffer += "\n </select>\n</td>\n<td>";
751
- foundHelper = helpers.description;
752
- stack1 = foundHelper || depth0.description;
753
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
754
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
692
+ buffer += " class='parameter' name='";
693
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
694
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
695
+ buffer += escapeExpression(stack1)
696
+ + "'>\n ";
697
+ stack1 = helpers['if'].call(depth0, depth0.required, {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
755
698
  if(stack1 || stack1 === 0) { buffer += stack1; }
756
- buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
757
- return buffer;});
699
+ buffer += "\n ";
700
+ stack2 = helpers.each.call(depth0, ((stack1 = depth0.allowableValues),stack1 == null || stack1 === false ? stack1 : stack1.descriptiveValues), {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data});
701
+ if(stack2 || stack2 === 0) { buffer += stack2; }
702
+ buffer += "\n </select>\n</td>\n<td>";
703
+ if (stack2 = helpers.description) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
704
+ else { stack2 = depth0.description; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
705
+ if(stack2 || stack2 === 0) { buffer += stack2; }
706
+ buffer += "</td>\n<td>";
707
+ if (stack2 = helpers.paramType) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
708
+ else { stack2 = depth0.paramType; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
709
+ if(stack2 || stack2 === 0) { buffer += stack2; }
710
+ buffer += "</td>\n<td><span class=\"model-signature\"></span></td>";
711
+ return buffer;
712
+ });
758
713
  })();
759
714
 
760
715
  (function() {
761
716
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
762
717
  templates['param_readonly'] = template(function (Handlebars,depth0,helpers,partials,data) {
763
- helpers = helpers || Handlebars.helpers;
764
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
718
+ this.compilerInfo = [4,'>= 1.0.0'];
719
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
720
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
765
721
 
766
722
  function program1(depth0,data) {
767
723
 
768
724
  var buffer = "", stack1;
769
725
  buffer += "\n <textarea class='body-textarea' readonly='readonly' name='";
770
- foundHelper = helpers.name;
771
- stack1 = foundHelper || depth0.name;
772
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
773
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
774
- buffer += escapeExpression(stack1) + "'>";
775
- foundHelper = helpers.defaultValue;
776
- stack1 = foundHelper || depth0.defaultValue;
777
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
778
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
779
- buffer += escapeExpression(stack1) + "</textarea>\n ";
780
- return buffer;}
726
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
727
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
728
+ buffer += escapeExpression(stack1)
729
+ + "'>";
730
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
731
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
732
+ buffer += escapeExpression(stack1)
733
+ + "</textarea>\n ";
734
+ return buffer;
735
+ }
781
736
 
782
737
  function program3(depth0,data) {
783
738
 
784
- var buffer = "", stack1, stack2;
739
+ var buffer = "", stack1;
785
740
  buffer += "\n ";
786
- foundHelper = helpers.defaultValue;
787
- stack1 = foundHelper || depth0.defaultValue;
788
- stack2 = helpers['if'];
789
- tmp1 = self.program(4, program4, data);
790
- tmp1.hash = {};
791
- tmp1.fn = tmp1;
792
- tmp1.inverse = self.program(6, program6, data);
793
- stack1 = stack2.call(depth0, stack1, tmp1);
741
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
794
742
  if(stack1 || stack1 === 0) { buffer += stack1; }
795
743
  buffer += "\n ";
796
- return buffer;}
744
+ return buffer;
745
+ }
797
746
  function program4(depth0,data) {
798
747
 
799
748
  var buffer = "", stack1;
800
749
  buffer += "\n ";
801
- foundHelper = helpers.defaultValue;
802
- stack1 = foundHelper || depth0.defaultValue;
803
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
804
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
805
- buffer += escapeExpression(stack1) + "\n ";
806
- return buffer;}
750
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
751
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
752
+ buffer += escapeExpression(stack1)
753
+ + "\n ";
754
+ return buffer;
755
+ }
807
756
 
808
757
  function program6(depth0,data) {
809
758
 
810
759
 
811
- return "\n (empty)\n ";}
760
+ return "\n (empty)\n ";
761
+ }
812
762
 
813
763
  buffer += "<td class='code'>";
814
- foundHelper = helpers.name;
815
- stack1 = foundHelper || depth0.name;
816
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
817
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
818
- buffer += escapeExpression(stack1) + "</td>\n<td>\n ";
819
- foundHelper = helpers.isBody;
820
- stack1 = foundHelper || depth0.isBody;
821
- stack2 = helpers['if'];
822
- tmp1 = self.program(1, program1, data);
823
- tmp1.hash = {};
824
- tmp1.fn = tmp1;
825
- tmp1.inverse = self.program(3, program3, data);
826
- stack1 = stack2.call(depth0, stack1, tmp1);
764
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
765
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
766
+ buffer += escapeExpression(stack1)
767
+ + "</td>\n<td>\n ";
768
+ stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
827
769
  if(stack1 || stack1 === 0) { buffer += stack1; }
828
770
  buffer += "\n</td>\n<td>";
829
- foundHelper = helpers.description;
830
- stack1 = foundHelper || depth0.description;
831
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
832
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
771
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
772
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
773
+ if(stack1 || stack1 === 0) { buffer += stack1; }
774
+ buffer += "</td>\n<td>";
775
+ if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
776
+ else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
833
777
  if(stack1 || stack1 === 0) { buffer += stack1; }
834
778
  buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
835
- return buffer;});
779
+ return buffer;
780
+ });
836
781
  })();
837
782
 
838
783
  (function() {
839
784
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
840
785
  templates['param_readonly_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
841
- helpers = helpers || Handlebars.helpers;
842
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
786
+ this.compilerInfo = [4,'>= 1.0.0'];
787
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
788
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
843
789
 
844
790
  function program1(depth0,data) {
845
791
 
846
792
  var buffer = "", stack1;
847
793
  buffer += "\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";
848
- foundHelper = helpers.name;
849
- stack1 = foundHelper || depth0.name;
850
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
851
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
852
- buffer += escapeExpression(stack1) + "'>";
853
- foundHelper = helpers.defaultValue;
854
- stack1 = foundHelper || depth0.defaultValue;
855
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
856
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
857
- buffer += escapeExpression(stack1) + "</textarea>\n ";
858
- return buffer;}
794
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
795
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
796
+ buffer += escapeExpression(stack1)
797
+ + "'>";
798
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
799
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
800
+ buffer += escapeExpression(stack1)
801
+ + "</textarea>\n ";
802
+ return buffer;
803
+ }
859
804
 
860
805
  function program3(depth0,data) {
861
806
 
862
- var buffer = "", stack1, stack2;
807
+ var buffer = "", stack1;
863
808
  buffer += "\n ";
864
- foundHelper = helpers.defaultValue;
865
- stack1 = foundHelper || depth0.defaultValue;
866
- stack2 = helpers['if'];
867
- tmp1 = self.program(4, program4, data);
868
- tmp1.hash = {};
869
- tmp1.fn = tmp1;
870
- tmp1.inverse = self.program(6, program6, data);
871
- stack1 = stack2.call(depth0, stack1, tmp1);
809
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
872
810
  if(stack1 || stack1 === 0) { buffer += stack1; }
873
811
  buffer += "\n ";
874
- return buffer;}
812
+ return buffer;
813
+ }
875
814
  function program4(depth0,data) {
876
815
 
877
816
  var buffer = "", stack1;
878
817
  buffer += "\n ";
879
- foundHelper = helpers.defaultValue;
880
- stack1 = foundHelper || depth0.defaultValue;
881
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
882
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
883
- buffer += escapeExpression(stack1) + "\n ";
884
- return buffer;}
818
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
819
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
820
+ buffer += escapeExpression(stack1)
821
+ + "\n ";
822
+ return buffer;
823
+ }
885
824
 
886
825
  function program6(depth0,data) {
887
826
 
888
827
 
889
- return "\n (empty)\n ";}
828
+ return "\n (empty)\n ";
829
+ }
890
830
 
891
831
  buffer += "<td class='code required'>";
892
- foundHelper = helpers.name;
893
- stack1 = foundHelper || depth0.name;
894
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
895
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
896
- buffer += escapeExpression(stack1) + "</td>\n<td>\n ";
897
- foundHelper = helpers.isBody;
898
- stack1 = foundHelper || depth0.isBody;
899
- stack2 = helpers['if'];
900
- tmp1 = self.program(1, program1, data);
901
- tmp1.hash = {};
902
- tmp1.fn = tmp1;
903
- tmp1.inverse = self.program(3, program3, data);
904
- stack1 = stack2.call(depth0, stack1, tmp1);
832
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
833
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
834
+ buffer += escapeExpression(stack1)
835
+ + "</td>\n<td>\n ";
836
+ stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
905
837
  if(stack1 || stack1 === 0) { buffer += stack1; }
906
838
  buffer += "\n</td>\n<td>";
907
- foundHelper = helpers.description;
908
- stack1 = foundHelper || depth0.description;
909
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
910
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
839
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
840
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
841
+ if(stack1 || stack1 === 0) { buffer += stack1; }
842
+ buffer += "</td>\n<td>";
843
+ if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
844
+ else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
911
845
  if(stack1 || stack1 === 0) { buffer += stack1; }
912
846
  buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
913
- return buffer;});
847
+ return buffer;
848
+ });
914
849
  })();
915
850
 
916
851
  (function() {
917
852
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
918
853
  templates['param_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
919
- helpers = helpers || Handlebars.helpers;
920
- var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
854
+ this.compilerInfo = [4,'>= 1.0.0'];
855
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
856
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
921
857
 
922
858
  function program1(depth0,data) {
923
859
 
924
- var buffer = "", stack1, stack2;
860
+ var buffer = "", stack1;
925
861
  buffer += "\n ";
926
- foundHelper = helpers.isFile;
927
- stack1 = foundHelper || depth0.isFile;
928
- stack2 = helpers['if'];
929
- tmp1 = self.program(2, program2, data);
930
- tmp1.hash = {};
931
- tmp1.fn = tmp1;
932
- tmp1.inverse = self.program(4, program4, data);
933
- stack1 = stack2.call(depth0, stack1, tmp1);
862
+ stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
934
863
  if(stack1 || stack1 === 0) { buffer += stack1; }
935
864
  buffer += "\n ";
936
- return buffer;}
865
+ return buffer;
866
+ }
937
867
  function program2(depth0,data) {
938
868
 
939
869
  var buffer = "", stack1;
940
870
  buffer += "\n <input type=\"file\" name='";
941
- foundHelper = helpers.name;
942
- stack1 = foundHelper || depth0.name;
943
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
944
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
945
- buffer += escapeExpression(stack1) + "'/>\n ";
946
- return buffer;}
871
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
872
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
873
+ buffer += escapeExpression(stack1)
874
+ + "'/>\n ";
875
+ return buffer;
876
+ }
947
877
 
948
878
  function program4(depth0,data) {
949
879
 
950
- var buffer = "", stack1, stack2;
880
+ var buffer = "", stack1;
951
881
  buffer += "\n ";
952
- foundHelper = helpers.defaultValue;
953
- stack1 = foundHelper || depth0.defaultValue;
954
- stack2 = helpers['if'];
955
- tmp1 = self.program(5, program5, data);
956
- tmp1.hash = {};
957
- tmp1.fn = tmp1;
958
- tmp1.inverse = self.program(7, program7, data);
959
- stack1 = stack2.call(depth0, stack1, tmp1);
882
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
960
883
  if(stack1 || stack1 === 0) { buffer += stack1; }
961
884
  buffer += "\n ";
962
- return buffer;}
885
+ return buffer;
886
+ }
963
887
  function program5(depth0,data) {
964
888
 
965
889
  var buffer = "", stack1;
966
890
  buffer += "\n <textarea class='body-textarea' placeholder='(required)' name='";
967
- foundHelper = helpers.name;
968
- stack1 = foundHelper || depth0.name;
969
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
970
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
971
- buffer += escapeExpression(stack1) + "'>";
972
- foundHelper = helpers.defaultValue;
973
- stack1 = foundHelper || depth0.defaultValue;
974
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
975
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
976
- buffer += escapeExpression(stack1) + "</textarea>\n ";
977
- return buffer;}
891
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
892
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
893
+ buffer += escapeExpression(stack1)
894
+ + "'>";
895
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
896
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
897
+ buffer += escapeExpression(stack1)
898
+ + "</textarea>\n ";
899
+ return buffer;
900
+ }
978
901
 
979
902
  function program7(depth0,data) {
980
903
 
981
904
  var buffer = "", stack1;
982
905
  buffer += "\n <textarea class='body-textarea' placeholder='(required)' name='";
983
- foundHelper = helpers.name;
984
- stack1 = foundHelper || depth0.name;
985
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
986
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
987
- buffer += escapeExpression(stack1) + "'></textarea>\n <br />\n <div class=\"content-type\" />\n ";
988
- return buffer;}
906
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
907
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
908
+ buffer += escapeExpression(stack1)
909
+ + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n ";
910
+ return buffer;
911
+ }
989
912
 
990
913
  function program9(depth0,data) {
991
914
 
992
- var buffer = "", stack1, stack2;
915
+ var buffer = "", stack1;
993
916
  buffer += "\n ";
994
- foundHelper = helpers.isFile;
995
- stack1 = foundHelper || depth0.isFile;
996
- stack2 = helpers['if'];
997
- tmp1 = self.program(10, program10, data);
998
- tmp1.hash = {};
999
- tmp1.fn = tmp1;
1000
- tmp1.inverse = self.program(12, program12, data);
1001
- stack1 = stack2.call(depth0, stack1, tmp1);
917
+ stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
1002
918
  if(stack1 || stack1 === 0) { buffer += stack1; }
1003
919
  buffer += "\n ";
1004
- return buffer;}
920
+ return buffer;
921
+ }
1005
922
  function program10(depth0,data) {
1006
923
 
1007
924
  var buffer = "", stack1;
1008
925
  buffer += "\n <input class='parameter' class='required' type='file' name='";
1009
- foundHelper = helpers.name;
1010
- stack1 = foundHelper || depth0.name;
1011
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1012
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1013
- buffer += escapeExpression(stack1) + "'/>\n ";
1014
- return buffer;}
926
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
927
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
928
+ buffer += escapeExpression(stack1)
929
+ + "'/>\n ";
930
+ return buffer;
931
+ }
1015
932
 
1016
933
  function program12(depth0,data) {
1017
934
 
1018
- var buffer = "", stack1, stack2;
935
+ var buffer = "", stack1;
1019
936
  buffer += "\n ";
1020
- foundHelper = helpers.defaultValue;
1021
- stack1 = foundHelper || depth0.defaultValue;
1022
- stack2 = helpers['if'];
1023
- tmp1 = self.program(13, program13, data);
1024
- tmp1.hash = {};
1025
- tmp1.fn = tmp1;
1026
- tmp1.inverse = self.program(15, program15, data);
1027
- stack1 = stack2.call(depth0, stack1, tmp1);
937
+ stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
1028
938
  if(stack1 || stack1 === 0) { buffer += stack1; }
1029
939
  buffer += "\n ";
1030
- return buffer;}
940
+ return buffer;
941
+ }
1031
942
  function program13(depth0,data) {
1032
943
 
1033
944
  var buffer = "", stack1;
1034
945
  buffer += "\n <input class='parameter required' minlength='1' name='";
1035
- foundHelper = helpers.name;
1036
- stack1 = foundHelper || depth0.name;
1037
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1038
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1039
- buffer += escapeExpression(stack1) + "' placeholder='(required)' type='text' value='";
1040
- foundHelper = helpers.defaultValue;
1041
- stack1 = foundHelper || depth0.defaultValue;
1042
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1043
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "defaultValue", { hash: {} }); }
1044
- buffer += escapeExpression(stack1) + "'/>\n ";
1045
- return buffer;}
946
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
947
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
948
+ buffer += escapeExpression(stack1)
949
+ + "' placeholder='(required)' type='text' value='";
950
+ if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
951
+ else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
952
+ buffer += escapeExpression(stack1)
953
+ + "'/>\n ";
954
+ return buffer;
955
+ }
1046
956
 
1047
957
  function program15(depth0,data) {
1048
958
 
1049
959
  var buffer = "", stack1;
1050
960
  buffer += "\n <input class='parameter required' minlength='1' name='";
1051
- foundHelper = helpers.name;
1052
- stack1 = foundHelper || depth0.name;
1053
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1054
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1055
- buffer += escapeExpression(stack1) + "' placeholder='(required)' type='text' value=''/>\n ";
1056
- return buffer;}
961
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
962
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
963
+ buffer += escapeExpression(stack1)
964
+ + "' placeholder='(required)' type='text' value=''/>\n ";
965
+ return buffer;
966
+ }
1057
967
 
1058
968
  buffer += "<td class='code required'>";
1059
- foundHelper = helpers.name;
1060
- stack1 = foundHelper || depth0.name;
1061
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1062
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1063
- buffer += escapeExpression(stack1) + "</td>\n<td>\n ";
1064
- foundHelper = helpers.isBody;
1065
- stack1 = foundHelper || depth0.isBody;
1066
- stack2 = helpers['if'];
1067
- tmp1 = self.program(1, program1, data);
1068
- tmp1.hash = {};
1069
- tmp1.fn = tmp1;
1070
- tmp1.inverse = self.program(9, program9, data);
1071
- stack1 = stack2.call(depth0, stack1, tmp1);
969
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
970
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
971
+ buffer += escapeExpression(stack1)
972
+ + "</td>\n<td>\n ";
973
+ stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
1072
974
  if(stack1 || stack1 === 0) { buffer += stack1; }
1073
975
  buffer += "\n</td>\n<td>\n <strong>";
1074
- foundHelper = helpers.description;
1075
- stack1 = foundHelper || depth0.description;
1076
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1077
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "description", { hash: {} }); }
976
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
977
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
978
+ if(stack1 || stack1 === 0) { buffer += stack1; }
979
+ buffer += "</strong>\n</td>\n<td>";
980
+ if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
981
+ else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1078
982
  if(stack1 || stack1 === 0) { buffer += stack1; }
1079
- buffer += "</strong>\n</td>\n<td><span class=\"model-signature\"></span></td>\n";
1080
- return buffer;});
983
+ buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
984
+ return buffer;
985
+ });
986
+ })();
987
+
988
+ (function() {
989
+ var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
990
+ templates['parameter_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
991
+ this.compilerInfo = [4,'>= 1.0.0'];
992
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
993
+ var buffer = "", stack1, functionType="function", self=this;
994
+
995
+ function program1(depth0,data) {
996
+
997
+ var buffer = "", stack1;
998
+ buffer += "\n ";
999
+ stack1 = helpers.each.call(depth0, depth0.consumes, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
1000
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1001
+ buffer += "\n";
1002
+ return buffer;
1003
+ }
1004
+ function program2(depth0,data) {
1005
+
1006
+ var buffer = "", stack1;
1007
+ buffer += "\n <option value=\"";
1008
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1009
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1010
+ buffer += "\">";
1011
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1012
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1013
+ buffer += "</option>\n ";
1014
+ return buffer;
1015
+ }
1016
+
1017
+ function program4(depth0,data) {
1018
+
1019
+
1020
+ return "\n <option value=\"application/json\">application/json</option>\n";
1021
+ }
1022
+
1023
+ buffer += "<label for=\"parameterContentType\"></label>\n<select name=\"parameterContentType\">\n";
1024
+ stack1 = helpers['if'].call(depth0, depth0.consumes, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
1025
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1026
+ buffer += "\n</select>\n";
1027
+ return buffer;
1028
+ });
1081
1029
  })();
1082
1030
 
1083
1031
  (function() {
1084
1032
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1085
1033
  templates['resource'] = template(function (Handlebars,depth0,helpers,partials,data) {
1086
- helpers = helpers || Handlebars.helpers;
1087
- var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
1088
-
1089
-
1090
- buffer += "<div class='heading'>\n <h2>\n <a href='#!/";
1091
- foundHelper = helpers.name;
1092
- stack1 = foundHelper || depth0.name;
1093
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1094
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1095
- buffer += escapeExpression(stack1) + "' onclick=\"Docs.toggleEndpointListForResource('";
1096
- foundHelper = helpers.name;
1097
- stack1 = foundHelper || depth0.name;
1098
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1099
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1100
- buffer += escapeExpression(stack1) + "');\">/";
1101
- foundHelper = helpers.name;
1102
- stack1 = foundHelper || depth0.name;
1103
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1104
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1105
- buffer += escapeExpression(stack1) + "</a>\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
1106
- foundHelper = helpers.name;
1107
- stack1 = foundHelper || depth0.name;
1108
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1109
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1110
- buffer += escapeExpression(stack1) + "' id='endpointListTogger_";
1111
- foundHelper = helpers.name;
1112
- stack1 = foundHelper || depth0.name;
1113
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1114
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1115
- buffer += escapeExpression(stack1) + "'\n onclick=\"Docs.toggleEndpointListForResource('";
1116
- foundHelper = helpers.name;
1117
- stack1 = foundHelper || depth0.name;
1118
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1119
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1120
- buffer += escapeExpression(stack1) + "');\">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";
1121
- foundHelper = helpers.name;
1122
- stack1 = foundHelper || depth0.name;
1123
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1124
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1125
- buffer += escapeExpression(stack1) + "'); return false;\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.expandOperationsForResource('";
1126
- foundHelper = helpers.name;
1127
- stack1 = foundHelper || depth0.name;
1128
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1129
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1130
- buffer += escapeExpression(stack1) + "'); return false;\">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='";
1131
- foundHelper = helpers.url;
1132
- stack1 = foundHelper || depth0.url;
1133
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1134
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "url", { hash: {} }); }
1135
- buffer += escapeExpression(stack1) + "'>Raw</a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";
1136
- foundHelper = helpers.name;
1137
- stack1 = foundHelper || depth0.name;
1138
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1139
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
1140
- buffer += escapeExpression(stack1) + "_endpoint_list' style='display:none'>\n\n</ul>\n";
1141
- return buffer;});
1034
+ this.compilerInfo = [4,'>= 1.0.0'];
1035
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1036
+ var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
1037
+
1038
+ function program1(depth0,data) {
1039
+
1040
+
1041
+ return " : ";
1042
+ }
1043
+
1044
+ buffer += "<div class='heading'>\n <h2>\n <a href='#!/";
1045
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1046
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1047
+ buffer += escapeExpression(stack1)
1048
+ + "' onclick=\"Docs.toggleEndpointListForResource('";
1049
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1050
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1051
+ buffer += escapeExpression(stack1)
1052
+ + "');\">";
1053
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1054
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1055
+ buffer += escapeExpression(stack1)
1056
+ + "</a> ";
1057
+ options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
1058
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, options); }
1059
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1060
+ if (!helpers.description) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
1061
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1062
+ if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1063
+ else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1064
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1065
+ buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
1066
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1067
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1068
+ buffer += escapeExpression(stack1)
1069
+ + "' id='endpointListTogger_";
1070
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1071
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1072
+ buffer += escapeExpression(stack1)
1073
+ + "'\n onclick=\"Docs.toggleEndpointListForResource('";
1074
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1075
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1076
+ buffer += escapeExpression(stack1)
1077
+ + "');\">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";
1078
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1079
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1080
+ buffer += escapeExpression(stack1)
1081
+ + "'); return false;\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.expandOperationsForResource('";
1082
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1083
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1084
+ buffer += escapeExpression(stack1)
1085
+ + "'); return false;\">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='";
1086
+ if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1087
+ else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1088
+ buffer += escapeExpression(stack1)
1089
+ + "'>Raw</a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";
1090
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1091
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1092
+ buffer += escapeExpression(stack1)
1093
+ + "_endpoint_list' style='display:none'>\n\n</ul>\n";
1094
+ return buffer;
1095
+ });
1096
+ })();
1097
+
1098
+ (function() {
1099
+ var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1100
+ templates['response_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
1101
+ this.compilerInfo = [4,'>= 1.0.0'];
1102
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1103
+ var buffer = "", stack1, functionType="function", self=this;
1104
+
1105
+ function program1(depth0,data) {
1106
+
1107
+ var buffer = "", stack1;
1108
+ buffer += "\n ";
1109
+ stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
1110
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1111
+ buffer += "\n";
1112
+ return buffer;
1113
+ }
1114
+ function program2(depth0,data) {
1115
+
1116
+ var buffer = "", stack1;
1117
+ buffer += "\n <option value=\"";
1118
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1119
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1120
+ buffer += "\">";
1121
+ stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1122
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1123
+ buffer += "</option>\n ";
1124
+ return buffer;
1125
+ }
1126
+
1127
+ function program4(depth0,data) {
1128
+
1129
+
1130
+ return "\n <option value=\"application/json\">application/json</option>\n";
1131
+ }
1132
+
1133
+ buffer += "<label for=\"responseContentType\"></label>\n<select name=\"responseContentType\">\n";
1134
+ stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
1135
+ if(stack1 || stack1 === 0) { buffer += stack1; }
1136
+ buffer += "\n</select>\n";
1137
+ return buffer;
1138
+ });
1142
1139
  })();
1143
1140
 
1144
1141
  (function() {
1145
1142
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1146
1143
  templates['signature'] = template(function (Handlebars,depth0,helpers,partials,data) {
1147
- helpers = helpers || Handlebars.helpers;
1148
- var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
1144
+ this.compilerInfo = [4,'>= 1.0.0'];
1145
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1146
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
1149
1147
 
1150
1148
 
1151
1149
  buffer += "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\">Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\">Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n ";
1152
- foundHelper = helpers.signature;
1153
- stack1 = foundHelper || depth0.signature;
1154
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1155
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "signature", { hash: {} }); }
1150
+ if (stack1 = helpers.signature) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1151
+ else { stack1 = depth0.signature; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1156
1152
  if(stack1 || stack1 === 0) { buffer += stack1; }
1157
1153
  buffer += "\n </div>\n\n <div class=\"snippet\">\n <pre><code>";
1158
- foundHelper = helpers.sampleJSON;
1159
- stack1 = foundHelper || depth0.sampleJSON;
1160
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1161
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "sampleJSON", { hash: {} }); }
1162
- buffer += escapeExpression(stack1) + "</code></pre>\n <small class=\"notice\"></small>\n </div>\n</div>\n\n";
1163
- return buffer;});
1154
+ if (stack1 = helpers.sampleJSON) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1155
+ else { stack1 = depth0.sampleJSON; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1156
+ buffer += escapeExpression(stack1)
1157
+ + "</code></pre>\n <small class=\"notice\"></small>\n </div>\n</div>\n\n";
1158
+ return buffer;
1159
+ });
1164
1160
  })();
1165
1161
 
1166
1162
  (function() {
1167
1163
  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1168
1164
  templates['status_code'] = template(function (Handlebars,depth0,helpers,partials,data) {
1169
- helpers = helpers || Handlebars.helpers;
1170
- var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;
1165
+ this.compilerInfo = [4,'>= 1.0.0'];
1166
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1167
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
1171
1168
 
1172
1169
 
1173
1170
  buffer += "<td width='15%' class='code'>";
1174
- foundHelper = helpers.code;
1175
- stack1 = foundHelper || depth0.code;
1176
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1177
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "code", { hash: {} }); }
1178
- buffer += escapeExpression(stack1) + "</td>\n<td>";
1179
- foundHelper = helpers.reason;
1180
- stack1 = foundHelper || depth0.reason;
1181
- if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
1182
- else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "reason", { hash: {} }); }
1171
+ if (stack1 = helpers.code) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1172
+ else { stack1 = depth0.code; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1173
+ buffer += escapeExpression(stack1)
1174
+ + "</td>\n<td>";
1175
+ if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1176
+ else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1183
1177
  if(stack1 || stack1 === 0) { buffer += stack1; }
1184
- buffer += "</td>\n\n";
1185
- return buffer;});
1178
+ buffer += "</td>\n";
1179
+ return buffer;
1180
+ });
1186
1181
  })();
1187
1182
 
1188
1183
 
1189
1184
 
1190
- // Generated by CoffeeScript 1.4.0
1185
+ // Generated by CoffeeScript 1.6.3
1191
1186
  (function() {
1192
- var ContentTypeView, HeaderView, MainView, OperationView, ParameterView, ResourceView, SignatureView, StatusCodeView, SwaggerUi,
1187
+ var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
1193
1188
  __hasProp = {}.hasOwnProperty,
1194
1189
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
1195
1190
 
1196
1191
  SwaggerUi = (function(_super) {
1197
-
1198
1192
  __extends(SwaggerUi, _super);
1199
1193
 
1200
1194
  function SwaggerUi() {
1201
- return SwaggerUi.__super__.constructor.apply(this, arguments);
1195
+ _ref = SwaggerUi.__super__.constructor.apply(this, arguments);
1196
+ return _ref;
1202
1197
  }
1203
1198
 
1204
1199
  SwaggerUi.prototype.dom_id = "swagger_ui";
@@ -1220,7 +1215,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1220
1215
  this.dom_id = options.dom_id;
1221
1216
  delete options.dom_id;
1222
1217
  }
1223
- if (!($('#' + this.dom_id) != null)) {
1218
+ if ($('#' + this.dom_id) == null) {
1224
1219
  $('body').append('<div id="' + this.dom_id + '"></div>');
1225
1220
  }
1226
1221
  this.options = options;
@@ -1242,18 +1237,24 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1242
1237
  };
1243
1238
 
1244
1239
  SwaggerUi.prototype.updateSwaggerUi = function(data) {
1245
- this.options.discoveryUrl = data.discoveryUrl;
1246
- this.options.apiKey = data.apiKey;
1240
+ this.options.url = data.url;
1247
1241
  return this.load();
1248
1242
  };
1249
1243
 
1250
1244
  SwaggerUi.prototype.load = function() {
1251
- var _ref;
1252
- if ((_ref = this.mainView) != null) {
1253
- _ref.clear();
1245
+ var url, _ref1;
1246
+ if ((_ref1 = this.mainView) != null) {
1247
+ _ref1.clear();
1254
1248
  }
1255
- this.headerView.update(this.options.discoveryUrl, this.options.apiKey);
1256
- return this.api = new SwaggerApi(this.options);
1249
+ url = this.options.url;
1250
+ if (url.indexOf("http") !== 0) {
1251
+ url = this.buildUrl(window.location.href.toString(), url);
1252
+ }
1253
+ this.options.url = url;
1254
+ this.headerView.update(url);
1255
+ this.api = new SwaggerApi(this.options);
1256
+ this.api.build();
1257
+ return this.api;
1257
1258
  };
1258
1259
 
1259
1260
  SwaggerUi.prototype.render = function() {
@@ -1279,6 +1280,18 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1279
1280
  }, 400);
1280
1281
  };
1281
1282
 
1283
+ SwaggerUi.prototype.buildUrl = function(base, url) {
1284
+ var parts;
1285
+ console.log("base is " + base);
1286
+ parts = base.split("/");
1287
+ base = parts[0] + "//" + parts[2];
1288
+ if (url.indexOf("/") === 0) {
1289
+ return base + url;
1290
+ } else {
1291
+ return base + "/" + url;
1292
+ }
1293
+ };
1294
+
1282
1295
  SwaggerUi.prototype.showMessage = function(data) {
1283
1296
  if (data == null) {
1284
1297
  data = '';
@@ -1309,11 +1322,11 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1309
1322
  window.SwaggerUi = SwaggerUi;
1310
1323
 
1311
1324
  HeaderView = (function(_super) {
1312
-
1313
1325
  __extends(HeaderView, _super);
1314
1326
 
1315
1327
  function HeaderView() {
1316
- return HeaderView.__super__.constructor.apply(this, arguments);
1328
+ _ref1 = HeaderView.__super__.constructor.apply(this, arguments);
1329
+ return _ref1;
1317
1330
  }
1318
1331
 
1319
1332
  HeaderView.prototype.events = {
@@ -1328,15 +1341,13 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1328
1341
 
1329
1342
  HeaderView.prototype.showPetStore = function(e) {
1330
1343
  return this.trigger('update-swagger-ui', {
1331
- discoveryUrl: "http://petstore.swagger.wordnik.com/api/api-docs.json",
1332
- apiKey: "special-key"
1344
+ url: "http://petstore.swagger.wordnik.com/api/api-docs"
1333
1345
  });
1334
1346
  };
1335
1347
 
1336
1348
  HeaderView.prototype.showWordnikDev = function(e) {
1337
1349
  return this.trigger('update-swagger-ui', {
1338
- discoveryUrl: "http://api.wordnik.com/v4/resources.json",
1339
- apiKey: ""
1350
+ url: "http://api.wordnik.com/v4/resources.json"
1340
1351
  });
1341
1352
  };
1342
1353
 
@@ -1351,7 +1362,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1351
1362
  e.preventDefault();
1352
1363
  }
1353
1364
  return this.trigger('update-swagger-ui', {
1354
- discoveryUrl: $('#input_baseUrl').val(),
1365
+ url: $('#input_baseUrl').val(),
1355
1366
  apiKey: $('#input_apiKey').val()
1356
1367
  });
1357
1368
  };
@@ -1361,11 +1372,9 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1361
1372
  trigger = false;
1362
1373
  }
1363
1374
  $('#input_baseUrl').val(url);
1364
- $('#input_apiKey').val(apiKey);
1365
1375
  if (trigger) {
1366
1376
  return this.trigger('update-swagger-ui', {
1367
- discoveryUrl: url,
1368
- apiKey: apiKey
1377
+ url: url
1369
1378
  });
1370
1379
  }
1371
1380
  };
@@ -1375,21 +1384,21 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1375
1384
  })(Backbone.View);
1376
1385
 
1377
1386
  MainView = (function(_super) {
1378
-
1379
1387
  __extends(MainView, _super);
1380
1388
 
1381
1389
  function MainView() {
1382
- return MainView.__super__.constructor.apply(this, arguments);
1390
+ _ref2 = MainView.__super__.constructor.apply(this, arguments);
1391
+ return _ref2;
1383
1392
  }
1384
1393
 
1385
1394
  MainView.prototype.initialize = function() {};
1386
1395
 
1387
1396
  MainView.prototype.render = function() {
1388
- var resource, _i, _len, _ref;
1397
+ var resource, _i, _len, _ref3;
1389
1398
  $(this.el).html(Handlebars.templates.main(this.model));
1390
- _ref = this.model.apisArray;
1391
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1392
- resource = _ref[_i];
1399
+ _ref3 = this.model.apisArray;
1400
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
1401
+ resource = _ref3[_i];
1393
1402
  this.addResource(resource);
1394
1403
  }
1395
1404
  return this;
@@ -1415,22 +1424,23 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1415
1424
  })(Backbone.View);
1416
1425
 
1417
1426
  ResourceView = (function(_super) {
1418
-
1419
1427
  __extends(ResourceView, _super);
1420
1428
 
1421
1429
  function ResourceView() {
1422
- return ResourceView.__super__.constructor.apply(this, arguments);
1430
+ _ref3 = ResourceView.__super__.constructor.apply(this, arguments);
1431
+ return _ref3;
1423
1432
  }
1424
1433
 
1425
1434
  ResourceView.prototype.initialize = function() {};
1426
1435
 
1427
1436
  ResourceView.prototype.render = function() {
1428
- var operation, _i, _len, _ref;
1437
+ var operation, _i, _len, _ref4;
1438
+ console.log(this.model.description);
1429
1439
  $(this.el).html(Handlebars.templates.resource(this.model));
1430
1440
  this.number = 0;
1431
- _ref = this.model.operationsArray;
1432
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1433
- operation = _ref[_i];
1441
+ _ref4 = this.model.operationsArray;
1442
+ for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
1443
+ operation = _ref4[_i];
1434
1444
  this.addOperation(operation);
1435
1445
  }
1436
1446
  return this;
@@ -1453,13 +1463,15 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1453
1463
  })(Backbone.View);
1454
1464
 
1455
1465
  OperationView = (function(_super) {
1456
-
1457
1466
  __extends(OperationView, _super);
1458
1467
 
1459
1468
  function OperationView() {
1460
- return OperationView.__super__.constructor.apply(this, arguments);
1469
+ _ref4 = OperationView.__super__.constructor.apply(this, arguments);
1470
+ return _ref4;
1461
1471
  }
1462
1472
 
1473
+ OperationView.prototype.invocationUrl = null;
1474
+
1463
1475
  OperationView.prototype.events = {
1464
1476
  'submit .sandbox': 'submitOperation',
1465
1477
  'click .submit': 'submitOperation',
@@ -1470,8 +1482,8 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1470
1482
  OperationView.prototype.initialize = function() {};
1471
1483
 
1472
1484
  OperationView.prototype.render = function() {
1473
- var contentTypeModel, contentTypeView, isMethodSubmissionSupported, param, responseSignatureView, signatureModel, statusCode, _i, _j, _len, _len1, _ref, _ref1;
1474
- isMethodSubmissionSupported = jQuery.inArray(this.model.httpMethod, this.model.supportedSubmitMethods()) >= 0;
1485
+ var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
1486
+ isMethodSubmissionSupported = true;
1475
1487
  if (!isMethodSubmissionSupported) {
1476
1488
  this.model.isReadOnly = true;
1477
1489
  }
@@ -1488,36 +1500,44 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1488
1500
  });
1489
1501
  $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
1490
1502
  } else {
1491
- $('.model-signature', $(this.el)).html(this.model.responseClass);
1503
+ $('.model-signature', $(this.el)).html(this.model.type);
1492
1504
  }
1493
1505
  contentTypeModel = {
1494
1506
  isParam: false
1495
1507
  };
1496
- if (this.model.supportedContentTypes) {
1497
- contentTypeModel.produces = this.model.supportedContentTypes;
1498
- }
1499
- if (this.model.produces) {
1500
- contentTypeModel.produces = this.model.produces;
1508
+ contentTypeModel.consumes = this.model.consumes;
1509
+ contentTypeModel.produces = this.model.produces;
1510
+ _ref5 = this.model.parameters;
1511
+ for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1512
+ param = _ref5[_i];
1513
+ type = param.type || param.dataType;
1514
+ if (type.toLowerCase() === 'file') {
1515
+ if (!contentTypeModel.consumes) {
1516
+ console.log("set content type ");
1517
+ contentTypeModel.consumes = 'multipart/form-data';
1518
+ }
1519
+ }
1501
1520
  }
1502
- contentTypeView = new ContentTypeView({
1521
+ responseContentTypeView = new ResponseContentTypeView({
1503
1522
  model: contentTypeModel
1504
1523
  });
1505
- $('.content-type', $(this.el)).append(contentTypeView.render().el);
1506
- _ref = this.model.parameters;
1507
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1508
- param = _ref[_i];
1509
- this.addParameter(param);
1524
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
1525
+ _ref6 = this.model.parameters;
1526
+ for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1527
+ param = _ref6[_j];
1528
+ this.addParameter(param, contentTypeModel.consumes);
1510
1529
  }
1511
- _ref1 = this.model.errorResponses;
1512
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
1513
- statusCode = _ref1[_j];
1530
+ _ref7 = this.model.responseMessages;
1531
+ for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1532
+ statusCode = _ref7[_k];
1514
1533
  this.addStatusCode(statusCode);
1515
1534
  }
1516
1535
  return this;
1517
1536
  };
1518
1537
 
1519
- OperationView.prototype.addParameter = function(param) {
1538
+ OperationView.prototype.addParameter = function(param, consumes) {
1520
1539
  var paramView;
1540
+ param.consumes = consumes;
1521
1541
  paramView = new ParameterView({
1522
1542
  model: param,
1523
1543
  tagName: 'tr',
@@ -1536,8 +1556,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1536
1556
  };
1537
1557
 
1538
1558
  OperationView.prototype.submitOperation = function(e) {
1539
- var bodyParam, consumes, error_free, form, headerParams, invocationUrl, isFileUpload, isFormPost, map, o, obj, param, paramContentTypeField, responseContentTypeField, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4,
1540
- _this = this;
1559
+ var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
1541
1560
  if (e != null) {
1542
1561
  e.preventDefault();
1543
1562
  }
@@ -1558,105 +1577,144 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1558
1577
  });
1559
1578
  if (error_free) {
1560
1579
  map = {};
1561
- _ref = form.serializeArray();
1562
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1563
- o = _ref[_i];
1580
+ opts = {
1581
+ parent: this
1582
+ };
1583
+ isFileUpload = false;
1584
+ _ref5 = form.find("input");
1585
+ for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1586
+ o = _ref5[_i];
1564
1587
  if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1565
1588
  map[o.name] = o.value;
1566
1589
  }
1590
+ if (o.type === "file") {
1591
+ isFileUpload = true;
1592
+ }
1567
1593
  }
1568
- isFileUpload = form.children().find('input[type~="file"]').size() !== 0;
1569
- isFormPost = false;
1570
- consumes = "application/json";
1571
- if (this.model.consumes && this.model.consumes.length > 0) {
1572
- consumes = this.model.consumes[0];
1573
- } else {
1574
- _ref1 = this.model.parameters;
1575
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
1576
- o = _ref1[_j];
1577
- if (o.paramType === 'form') {
1578
- isFormPost = true;
1579
- consumes = false;
1580
- }
1594
+ _ref6 = form.find("textarea");
1595
+ for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1596
+ o = _ref6[_j];
1597
+ if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1598
+ map["body"] = o.value;
1581
1599
  }
1582
- if (isFileUpload) {
1583
- consumes = false;
1584
- } else if (this.model.httpMethod.toLowerCase() === "post" && isFormPost === false) {
1585
- consumes = "application/json";
1600
+ }
1601
+ _ref7 = form.find("select");
1602
+ for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1603
+ o = _ref7[_k];
1604
+ val = this.getSelectedValue(o);
1605
+ if ((val != null) && jQuery.trim(val).length > 0) {
1606
+ map[o.name] = val;
1586
1607
  }
1587
1608
  }
1609
+ opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val();
1610
+ opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val();
1611
+ $(".response_throbber", $(this.el)).show();
1588
1612
  if (isFileUpload) {
1589
- bodyParam = new FormData();
1590
- _ref2 = this.model.parameters;
1591
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
1592
- param = _ref2[_k];
1593
- if ((param.paramType === 'body' || 'form') && param.name !== 'file' && (map[param.name] != null)) {
1594
- bodyParam.append(param.name, map[param.name]);
1595
- }
1596
- }
1597
- $.each(form.children().find('input[type~="file"]'), function(i, el) {
1598
- return bodyParam.append($(el).attr('name'), el.files[0]);
1599
- });
1600
- console.log(bodyParam);
1601
- } else if (isFormPost) {
1602
- bodyParam = new FormData();
1603
- _ref3 = this.model.parameters;
1604
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
1605
- param = _ref3[_l];
1606
- if (map[param.name] != null) {
1607
- bodyParam.append(param.name, map[param.name]);
1608
- }
1609
- }
1613
+ return this.handleFileUpload(map, form);
1610
1614
  } else {
1611
- bodyParam = null;
1612
- _ref4 = this.model.parameters;
1613
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
1614
- param = _ref4[_m];
1615
- if (param.paramType === 'body') {
1616
- bodyParam = map[param.name];
1617
- }
1618
- }
1615
+ return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
1619
1616
  }
1620
- log("bodyParam = " + bodyParam);
1621
- headerParams = null;
1622
- invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true);
1623
- log('submitting ' + invocationUrl);
1624
- $(".request_url", $(this.el)).html("<pre>" + invocationUrl + "</pre>");
1625
- $(".response_throbber", $(this.el)).show();
1626
- obj = {
1627
- type: this.model.httpMethod,
1628
- url: invocationUrl,
1629
- headers: headerParams,
1630
- data: bodyParam,
1631
- contentType: consumes,
1632
- dataType: 'json',
1633
- processData: false,
1634
- error: function(xhr, textStatus, error) {
1635
- return _this.showErrorStatus(xhr, textStatus, error);
1636
- },
1637
- success: function(data) {
1638
- return _this.showResponse(data);
1639
- },
1640
- complete: function(data) {
1641
- return _this.showCompleteStatus(data);
1642
- }
1643
- };
1644
- paramContentTypeField = $("td select[name=contentType]", $(this.el)).val();
1645
- if (paramContentTypeField) {
1646
- obj.contentType = paramContentTypeField;
1617
+ }
1618
+ };
1619
+
1620
+ OperationView.prototype.success = function(response, parent) {
1621
+ return parent.showCompleteStatus(response);
1622
+ };
1623
+
1624
+ OperationView.prototype.handleFileUpload = function(map, form) {
1625
+ var bodyParam, headerParams, o, obj, param, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7,
1626
+ _this = this;
1627
+ console.log("it's a file upload");
1628
+ _ref5 = form.serializeArray();
1629
+ for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1630
+ o = _ref5[_i];
1631
+ if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1632
+ map[o.name] = o.value;
1633
+ }
1634
+ }
1635
+ bodyParam = new FormData();
1636
+ _ref6 = this.model.parameters;
1637
+ for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1638
+ param = _ref6[_j];
1639
+ if (param.paramType === 'form') {
1640
+ bodyParam.append(param.name, map[param.name]);
1641
+ }
1642
+ }
1643
+ headerParams = {};
1644
+ _ref7 = this.model.parameters;
1645
+ for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1646
+ param = _ref7[_k];
1647
+ if (param.paramType === 'header') {
1648
+ headerParams[param.name] = map[param.name];
1649
+ }
1650
+ }
1651
+ console.log(headerParams);
1652
+ $.each($('input[type~="file"]'), function(i, el) {
1653
+ return bodyParam.append($(el).attr('name'), el.files[0]);
1654
+ });
1655
+ console.log(bodyParam);
1656
+ this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true);
1657
+ $(".request_url", $(this.el)).html("<pre>" + this.invocationUrl + "</pre>");
1658
+ obj = {
1659
+ type: this.model.method,
1660
+ url: this.invocationUrl,
1661
+ headers: headerParams,
1662
+ data: bodyParam,
1663
+ dataType: 'json',
1664
+ contentType: false,
1665
+ processData: false,
1666
+ error: function(data, textStatus, error) {
1667
+ return _this.showErrorStatus(_this.wrap(data), _this);
1668
+ },
1669
+ success: function(data) {
1670
+ return _this.showResponse(data, _this);
1671
+ },
1672
+ complete: function(data) {
1673
+ return _this.showCompleteStatus(_this.wrap(data), _this);
1647
1674
  }
1648
- log('content type = ' + obj.contentType);
1649
- if (!obj.data || (obj.type === 'GET' || obj.type === 'DELETE')) {
1650
- obj.contentType = false;
1675
+ };
1676
+ if (window.authorizations) {
1677
+ window.authorizations.apply(obj);
1678
+ }
1679
+ jQuery.ajax(obj);
1680
+ return false;
1681
+ };
1682
+
1683
+ OperationView.prototype.wrap = function(data) {
1684
+ var o,
1685
+ _this = this;
1686
+ o = {};
1687
+ o.content = {};
1688
+ o.content.data = data.responseText;
1689
+ o.getHeaders = function() {
1690
+ return {
1691
+ "Content-Type": data.getResponseHeader("Content-Type")
1692
+ };
1693
+ };
1694
+ o.request = {};
1695
+ o.request.url = this.invocationUrl;
1696
+ o.status = data.status;
1697
+ return o;
1698
+ };
1699
+
1700
+ OperationView.prototype.getSelectedValue = function(select) {
1701
+ var opt, options, _i, _len, _ref5;
1702
+ if (!select.multiple) {
1703
+ return select.value;
1704
+ } else {
1705
+ options = [];
1706
+ _ref5 = select.options;
1707
+ for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1708
+ opt = _ref5[_i];
1709
+ if (opt.selected) {
1710
+ options.push(opt.value);
1711
+ }
1651
1712
  }
1652
- log('content type is now = ' + obj.contentType);
1653
- responseContentTypeField = $('.content > .content-type > div > select[name=contentType]', $(this.el)).val();
1654
- if (responseContentTypeField) {
1655
- obj.headers = obj.headers != null ? obj.headers : {};
1656
- obj.headers.accept = responseContentTypeField;
1713
+ if (options.length > 0) {
1714
+ return options.join(",");
1715
+ } else {
1716
+ return null;
1657
1717
  }
1658
- jQuery.ajax(obj);
1659
- return false;
1660
1718
  }
1661
1719
  };
1662
1720
 
@@ -1674,12 +1732,12 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1674
1732
  return $(".response_body", $(this.el)).html(escape(prettyJson));
1675
1733
  };
1676
1734
 
1677
- OperationView.prototype.showErrorStatus = function(data) {
1678
- return this.showStatus(data);
1735
+ OperationView.prototype.showErrorStatus = function(data, parent) {
1736
+ return parent.showStatus(data);
1679
1737
  };
1680
1738
 
1681
- OperationView.prototype.showCompleteStatus = function(data) {
1682
- return this.showStatus(data);
1739
+ OperationView.prototype.showCompleteStatus = function(data, parent) {
1740
+ return parent.showStatus(data);
1683
1741
  };
1684
1742
 
1685
1743
  OperationView.prototype.formatXml = function(xml) {
@@ -1735,9 +1793,9 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1735
1793
  padding = '';
1736
1794
  indent += transitions[fromTo];
1737
1795
  padding = ((function() {
1738
- var _j, _ref, _results;
1796
+ var _j, _ref5, _results;
1739
1797
  _results = [];
1740
- for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) {
1798
+ for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
1741
1799
  _results.push(' ');
1742
1800
  }
1743
1801
  return _results;
@@ -1756,18 +1814,33 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1756
1814
  };
1757
1815
 
1758
1816
  OperationView.prototype.showStatus = function(data) {
1759
- var code, pre, response_body;
1760
- try {
1761
- code = $('<code />').text(JSON.stringify(JSON.parse(data.responseText), null, 2));
1817
+ var code, content, contentType, headers, pre, response_body;
1818
+ content = data.content.data;
1819
+ headers = data.getHeaders();
1820
+ contentType = headers["Content-Type"];
1821
+ if (content === void 0) {
1822
+ code = $('<code />').text("no content");
1823
+ pre = $('<pre class="json" />').append(code);
1824
+ } else if (contentType.indexOf("application/json") === 0 || contentType.indexOf("application/hal+json") === 0) {
1825
+ code = $('<code />').text(JSON.stringify(JSON.parse(content), null, 2));
1762
1826
  pre = $('<pre class="json" />').append(code);
1763
- } catch (error) {
1764
- code = $('<code />').text(this.formatXml(data.responseText));
1827
+ } else if (contentType.indexOf("application/xml") === 0) {
1828
+ code = $('<code />').text(this.formatXml(content));
1765
1829
  pre = $('<pre class="xml" />').append(code);
1830
+ } else if (contentType.indexOf("text/html") === 0) {
1831
+ code = $('<code />').html(content);
1832
+ pre = $('<pre class="xml" />').append(code);
1833
+ } else if (contentType.indexOf("image/") === 0) {
1834
+ pre = $('<img>').attr('src', data.request.url);
1835
+ } else {
1836
+ code = $('<code />').text(content);
1837
+ pre = $('<pre class="json" />').append(code);
1766
1838
  }
1767
1839
  response_body = pre;
1840
+ $(".request_url", $(this.el)).html("<pre>" + data.request.url + "</pre>");
1768
1841
  $(".response_code", $(this.el)).html("<pre>" + data.status + "</pre>");
1769
1842
  $(".response_body", $(this.el)).html(response_body);
1770
- $(".response_headers", $(this.el)).html("<pre>" + data.getAllResponseHeaders() + "</pre>");
1843
+ $(".response_headers", $(this.el)).html("<pre>" + JSON.stringify(data.getHeaders(), null, " ").replace(/\n/g, "<br>") + "</pre>");
1771
1844
  $(".response", $(this.el)).slideDown();
1772
1845
  $(".response_hider", $(this.el)).show();
1773
1846
  $(".response_throbber", $(this.el)).hide();
@@ -1776,7 +1849,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1776
1849
 
1777
1850
  OperationView.prototype.toggleOperationContent = function() {
1778
1851
  var elem;
1779
- elem = $('#' + Docs.escapeResourceName(this.model.resourceName) + "_" + this.model.nickname + "_" + this.model.httpMethod + "_" + this.model.number + "_content");
1852
+ elem = $('#' + Docs.escapeResourceName(this.model.resourceName) + "_" + this.model.nickname + "_" + this.model.method + "_" + this.model.number + "_content");
1780
1853
  if (elem.is(':visible')) {
1781
1854
  return Docs.collapseOperation(elem);
1782
1855
  } else {
@@ -1789,11 +1862,11 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1789
1862
  })(Backbone.View);
1790
1863
 
1791
1864
  StatusCodeView = (function(_super) {
1792
-
1793
1865
  __extends(StatusCodeView, _super);
1794
1866
 
1795
1867
  function StatusCodeView() {
1796
- return StatusCodeView.__super__.constructor.apply(this, arguments);
1868
+ _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
1869
+ return _ref5;
1797
1870
  }
1798
1871
 
1799
1872
  StatusCodeView.prototype.initialize = function() {};
@@ -1814,21 +1887,22 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1814
1887
  })(Backbone.View);
1815
1888
 
1816
1889
  ParameterView = (function(_super) {
1817
-
1818
1890
  __extends(ParameterView, _super);
1819
1891
 
1820
1892
  function ParameterView() {
1821
- return ParameterView.__super__.constructor.apply(this, arguments);
1893
+ _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
1894
+ return _ref6;
1822
1895
  }
1823
1896
 
1824
1897
  ParameterView.prototype.initialize = function() {};
1825
1898
 
1826
1899
  ParameterView.prototype.render = function() {
1827
- var contentTypeModel, contentTypeView, signatureModel, signatureView, template;
1900
+ var contentTypeModel, isParam, parameterContentTypeView, responseContentTypeView, signatureModel, signatureView, template, type;
1901
+ type = this.model.type || this.model.dataType;
1828
1902
  if (this.model.paramType === 'body') {
1829
1903
  this.model.isBody = true;
1830
1904
  }
1831
- if (this.model.dataType === 'file') {
1905
+ if (type.toLowerCase() === 'file') {
1832
1906
  this.model.isFile = true;
1833
1907
  }
1834
1908
  template = this.template();
@@ -1847,19 +1921,25 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1847
1921
  } else {
1848
1922
  $('.model-signature', $(this.el)).html(this.model.signature);
1849
1923
  }
1924
+ isParam = false;
1925
+ if (this.model.isBody) {
1926
+ isParam = true;
1927
+ }
1850
1928
  contentTypeModel = {
1851
- isParam: false
1929
+ isParam: isParam
1852
1930
  };
1853
- if (this.model.supportedContentTypes) {
1854
- contentTypeModel.produces = this.model.supportedContentTypes;
1855
- }
1856
- if (this.model.produces) {
1857
- contentTypeModel.produces = this.model.produces;
1931
+ contentTypeModel.consumes = this.model.consumes;
1932
+ if (isParam) {
1933
+ parameterContentTypeView = new ParameterContentTypeView({
1934
+ model: contentTypeModel
1935
+ });
1936
+ $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
1937
+ } else {
1938
+ responseContentTypeView = new ResponseContentTypeView({
1939
+ model: contentTypeModel
1940
+ });
1941
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
1858
1942
  }
1859
- contentTypeView = new ContentTypeView({
1860
- model: contentTypeModel
1861
- });
1862
- $('.content-type', $(this.el)).append(contentTypeView.render().el);
1863
1943
  return this;
1864
1944
  };
1865
1945
 
@@ -1888,11 +1968,11 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1888
1968
  })(Backbone.View);
1889
1969
 
1890
1970
  SignatureView = (function(_super) {
1891
-
1892
1971
  __extends(SignatureView, _super);
1893
1972
 
1894
1973
  function SignatureView() {
1895
- return SignatureView.__super__.constructor.apply(this, arguments);
1974
+ _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
1975
+ return _ref7;
1896
1976
  }
1897
1977
 
1898
1978
  SignatureView.prototype.events = {
@@ -1957,11 +2037,11 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1957
2037
  })(Backbone.View);
1958
2038
 
1959
2039
  ContentTypeView = (function(_super) {
1960
-
1961
2040
  __extends(ContentTypeView, _super);
1962
2041
 
1963
2042
  function ContentTypeView() {
1964
- return ContentTypeView.__super__.constructor.apply(this, arguments);
2043
+ _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
2044
+ return _ref8;
1965
2045
  }
1966
2046
 
1967
2047
  ContentTypeView.prototype.initialize = function() {};
@@ -1970,12 +2050,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1970
2050
  var template;
1971
2051
  template = this.template();
1972
2052
  $(this.el).html(template(this.model));
1973
- this.isParam = this.model.isParam;
1974
- if (this.isParam) {
1975
- $('label[for=contentType]', $(this.el)).text('Parameter content type:');
1976
- } else {
1977
- $('label[for=contentType]', $(this.el)).text('Response Content Type');
1978
- }
2053
+ $('label[for=contentType]', $(this.el)).text('Response Content Type');
1979
2054
  return this;
1980
2055
  };
1981
2056
 
@@ -1987,4 +2062,56 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
1987
2062
 
1988
2063
  })(Backbone.View);
1989
2064
 
2065
+ ResponseContentTypeView = (function(_super) {
2066
+ __extends(ResponseContentTypeView, _super);
2067
+
2068
+ function ResponseContentTypeView() {
2069
+ _ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments);
2070
+ return _ref9;
2071
+ }
2072
+
2073
+ ResponseContentTypeView.prototype.initialize = function() {};
2074
+
2075
+ ResponseContentTypeView.prototype.render = function() {
2076
+ var template;
2077
+ template = this.template();
2078
+ $(this.el).html(template(this.model));
2079
+ $('label[for=responseContentType]', $(this.el)).text('Response Content Type');
2080
+ return this;
2081
+ };
2082
+
2083
+ ResponseContentTypeView.prototype.template = function() {
2084
+ return Handlebars.templates.response_content_type;
2085
+ };
2086
+
2087
+ return ResponseContentTypeView;
2088
+
2089
+ })(Backbone.View);
2090
+
2091
+ ParameterContentTypeView = (function(_super) {
2092
+ __extends(ParameterContentTypeView, _super);
2093
+
2094
+ function ParameterContentTypeView() {
2095
+ _ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments);
2096
+ return _ref10;
2097
+ }
2098
+
2099
+ ParameterContentTypeView.prototype.initialize = function() {};
2100
+
2101
+ ParameterContentTypeView.prototype.render = function() {
2102
+ var template;
2103
+ template = this.template();
2104
+ $(this.el).html(template(this.model));
2105
+ $('label[for=parameterContentType]', $(this.el)).text('Parameter content type:');
2106
+ return this;
2107
+ };
2108
+
2109
+ ParameterContentTypeView.prototype.template = function() {
2110
+ return Handlebars.templates.parameter_content_type;
2111
+ };
2112
+
2113
+ return ParameterContentTypeView;
2114
+
2115
+ })(Backbone.View);
2116
+
1990
2117
  }).call(this);