integration of tornado and swagger-ui
[releng.git] / utils / test / result_collection_api / tornado_swagger_ui / tornado_swagger / static / swagger-ui.js
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 log = function(){
66   log.history = log.history || [];
67   log.history.push(arguments);
68   if(this.console){
69     console.log( Array.prototype.slice.call(arguments) );
70   }
71 };
72
73 // Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
74 if (Function.prototype.bind && console && typeof console.log == "object") {
75     [
76       "log","info","warn","error","assert","dir","clear","profile","profileEnd"
77     ].forEach(function (method) {
78         console[method] = this.bind(console[method], console);
79     }, Function.prototype.call);
80 }
81
82 var Docs = {
83
84         shebang: function() {
85
86                 // If shebang has an operation nickname in it..
87                 // e.g. /docs/#!/words/get_search
88                 var fragments = $.param.fragment().split('/');
89                 fragments.shift(); // get rid of the bang
90
91                 switch (fragments.length) {
92                         case 1:
93                                 // Expand all operations for the resource and scroll to it
94                                 log('shebang resource:' + fragments[0]);
95                                 var dom_id = 'resource_' + fragments[0];
96
97                                 Docs.expandEndpointListForResource(fragments[0]);
98                                 $("#"+dom_id).slideto({highlight: false});
99                                 break;
100                         case 2:
101                                 // Refer to the endpoint DOM element, e.g. #words_get_search
102                                 log('shebang endpoint: ' + fragments.join('_'));
103
104         // Expand Resource
105         Docs.expandEndpointListForResource(fragments[0]);
106         $("#"+dom_id).slideto({highlight: false});
107
108         // Expand operation
109                                 var li_dom_id = fragments.join('_');
110                                 var li_content_dom_id = li_dom_id + "_content";
111
112         log("li_dom_id " + li_dom_id);
113         log("li_content_dom_id " + li_content_dom_id);
114
115                                 Docs.expandOperation($('#'+li_content_dom_id));
116                                 $('#'+li_dom_id).slideto({highlight: false});
117                                 break;
118                 }
119
120         },
121
122         toggleEndpointListForResource: function(resource) {
123                 var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
124                 if (elem.is(':visible')) {
125                         Docs.collapseEndpointListForResource(resource);
126                 } else {
127                         Docs.expandEndpointListForResource(resource);
128                 }
129         },
130
131         // Expand resource
132         expandEndpointListForResource: function(resource) {
133                 var resource = Docs.escapeResourceName(resource);
134                 if (resource == '') {
135                         $('.resource ul.endpoints').slideDown();
136                         return;
137                 }
138                 
139                 $('li#resource_' + resource).addClass('active');
140
141                 var elem = $('li#resource_' + resource + ' ul.endpoints');
142                 elem.slideDown();
143         },
144
145         // Collapse resource and mark as explicitly closed
146         collapseEndpointListForResource: function(resource) {
147                 var resource = Docs.escapeResourceName(resource);
148                 $('li#resource_' + resource).removeClass('active');
149
150                 var elem = $('li#resource_' + resource + ' ul.endpoints');
151                 elem.slideUp();
152         },
153
154         expandOperationsForResource: function(resource) {
155                 // Make sure the resource container is open..
156                 Docs.expandEndpointListForResource(resource);
157                 
158                 if (resource == '') {
159                         $('.resource ul.endpoints li.operation div.content').slideDown();
160                         return;
161                 }
162
163                 $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
164                         Docs.expandOperation($(this));
165                 });
166         },
167
168         collapseOperationsForResource: function(resource) {
169                 // Make sure the resource container is open..
170                 Docs.expandEndpointListForResource(resource);
171
172                 $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
173                         Docs.collapseOperation($(this));
174                 });
175         },
176
177         escapeResourceName: function(resource) {
178                 return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
179         },
180
181         expandOperation: function(elem) {
182                 elem.slideDown();
183         },
184
185         collapseOperation: function(elem) {
186                 elem.slideUp();
187         }
188 };(function() {
189   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
190 templates['content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
191   this.compilerInfo = [4,'>= 1.0.0'];
192 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
193   var buffer = "", stack1, functionType="function", self=this;
194
195 function program1(depth0,data) {
196   
197   var buffer = "", stack1;
198   buffer += "\n  ";
199   stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
200   if(stack1 || stack1 === 0) { buffer += stack1; }
201   buffer += "\n";
202   return buffer;
203   }
204 function program2(depth0,data) {
205   
206   var buffer = "", stack1;
207   buffer += "\n <option value=\"";
208   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
209   if(stack1 || stack1 === 0) { buffer += stack1; }
210   buffer += "\">";
211   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
212   if(stack1 || stack1 === 0) { buffer += stack1; }
213   buffer += "</option>\n        ";
214   return buffer;
215   }
216
217 function program4(depth0,data) {
218   
219   
220   return "\n  <option value=\"application/json\">application/json</option>\n";
221   }
222
223   buffer += "<label for=\"contentType\"></label>\n<select name=\"contentType\">\n";
224   stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
225   if(stack1 || stack1 === 0) { buffer += stack1; }
226   buffer += "\n</select>\n";
227   return buffer;
228   });
229 })();
230
231 (function() {
232   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
233 templates['main'] = template(function (Handlebars,depth0,helpers,partials,data) {
234   this.compilerInfo = [4,'>= 1.0.0'];
235 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
236   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
237
238 function program1(depth0,data) {
239   
240   var buffer = "", stack1, stack2;
241   buffer += "\n    <div class=\"info_title\">"
242     + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
243     + "</div>\n    <div class=\"info_description\">";
244   stack2 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.description)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
245   if(stack2 || stack2 === 0) { buffer += stack2; }
246   buffer += "</div>\n    ";
247   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});
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.contact), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
251   if(stack2 || stack2 === 0) { buffer += stack2; }
252   buffer += "\n    ";
253   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});
254   if(stack2 || stack2 === 0) { buffer += stack2; }
255   buffer += "\n  ";
256   return buffer;
257   }
258 function program2(depth0,data) {
259   
260   var buffer = "", stack1;
261   buffer += "<div class=\"info_tos\"><a href=\""
262     + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.termsOfServiceUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
263     + "\">Terms of service</a></div>";
264   return buffer;
265   }
266
267 function program4(depth0,data) {
268   
269   var buffer = "", stack1;
270   buffer += "<div class='info_contact'><a href=\"mailto:"
271     + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
272     + "\">Contact the developer</a></div>";
273   return buffer;
274   }
275
276 function program6(depth0,data) {
277   
278   var buffer = "", stack1;
279   buffer += "<div class='info_license'><a href='"
280     + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.licenseUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
281     + "'>"
282     + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
283     + "</a></div>";
284   return buffer;
285   }
286
287 function program8(depth0,data) {
288   
289   var buffer = "", stack1;
290   buffer += "\n        , <span style=\"font-variant: small-caps\">api version</span>: ";
291   if (stack1 = helpers.apiVersion) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
292   else { stack1 = depth0.apiVersion; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
293   buffer += escapeExpression(stack1)
294     + "\n        ";
295   return buffer;
296   }
297
298   buffer += "<div class='info' id='api_info'>\n  ";
299   stack1 = helpers['if'].call(depth0, depth0.info, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
300   if(stack1 || stack1 === 0) { buffer += stack1; }
301   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>: ";
302   if (stack1 = helpers.basePath) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
303   else { stack1 = depth0.basePath; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
304   buffer += escapeExpression(stack1)
305     + "\n        ";
306   stack1 = helpers['if'].call(depth0, depth0.apiVersion, {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data});
307   if(stack1 || stack1 === 0) { buffer += stack1; }
308   buffer += "]</h4>\n    </div>\n</div>\n";
309   return buffer;
310   });
311 })();
312
313 (function() {
314   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
315 templates['operation'] = template(function (Handlebars,depth0,helpers,partials,data) {
316   this.compilerInfo = [4,'>= 1.0.0'];
317 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
318   var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
319
320 function program1(depth0,data) {
321   
322   var buffer = "", stack1;
323   buffer += "\n        <h4>Implementation Notes</h4>\n        <p>";
324   if (stack1 = helpers.notes) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
325   else { stack1 = depth0.notes; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
326   if(stack1 || stack1 === 0) { buffer += stack1; }
327   buffer += "</p>\n        ";
328   return buffer;
329   }
330
331 function program3(depth0,data) {
332   
333   
334   return "\n        <div class=\"auth\">\n        <span class=\"api-ic ic-error\"></span>";
335   }
336
337 function program5(depth0,data) {
338   
339   var buffer = "", stack1;
340   buffer += "\n          <div id=\"api_information_panel\" style=\"top: 526px; left: 776px; display: none;\">\n          ";
341   stack1 = helpers.each.call(depth0, depth0, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
342   if(stack1 || stack1 === 0) { buffer += stack1; }
343   buffer += "\n          </div>\n        ";
344   return buffer;
345   }
346 function program6(depth0,data) {
347   
348   var buffer = "", stack1, stack2;
349   buffer += "\n            <div title='";
350   stack2 = ((stack1 = depth0.description),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
351   if(stack2 || stack2 === 0) { buffer += stack2; }
352   buffer += "'>"
353     + escapeExpression(((stack1 = depth0.scope),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
354     + "</div>\n          ";
355   return buffer;
356   }
357
358 function program8(depth0,data) {
359   
360   
361   return "</div>";
362   }
363
364 function program10(depth0,data) {
365   
366   
367   return "\n        <div class='access'>\n          <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n        </div>\n        ";
368   }
369
370 function program12(depth0,data) {
371   
372   
373   return "\n          <h4>Response Class</h4>\n          <p><span class=\"model-signature\" /></p>\n          <br/>\n          <div class=\"response-content-type\" />\n        ";
374   }
375
376 function program14(depth0,data) {
377   
378   
379   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          ";
380   }
381
382 function program16(depth0,data) {
383   
384   
385   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          ";
386   }
387
388 function program18(depth0,data) {
389   
390   
391   return "\n          ";
392   }
393
394 function program20(depth0,data) {
395   
396   
397   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='images/throbber.gif' style='display:none' />\n          </div>\n          ";
398   }
399
400   buffer += "\n  <ul class='operations' >\n    <li class='";
401   if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
402   else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
403   buffer += escapeExpression(stack1)
404     + " operation' id='";
405   if (stack1 = helpers.parentId) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
406   else { stack1 = depth0.parentId; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
407   buffer += escapeExpression(stack1)
408     + "_";
409   if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
410   else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
411   buffer += escapeExpression(stack1)
412     + "'>\n      <div class='heading'>\n        <h3>\n          <span class='http_method'>\n          <a href='#!/";
413   if (stack1 = helpers.parentId) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
414   else { stack1 = depth0.parentId; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
415   buffer += escapeExpression(stack1)
416     + "/";
417   if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
418   else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
419   buffer += escapeExpression(stack1)
420     + "' class=\"toggleOperation\">";
421   if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
422   else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
423   buffer += escapeExpression(stack1)
424     + "</a>\n          </span>\n          <span class='path'>\n          <a href='#!/";
425   if (stack1 = helpers.parentId) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
426   else { stack1 = depth0.parentId; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
427   buffer += escapeExpression(stack1)
428     + "/";
429   if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
430   else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
431   buffer += escapeExpression(stack1)
432     + "' class=\"toggleOperation\">";
433   if (stack1 = helpers.path) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
434   else { stack1 = depth0.path; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
435   buffer += escapeExpression(stack1)
436     + "</a>\n          </span>\n        </h3>\n        <ul class='options'>\n          <li>\n          <a href='#!/";
437   if (stack1 = helpers.parentId) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
438   else { stack1 = depth0.parentId; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
439   buffer += escapeExpression(stack1)
440     + "/";
441   if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
442   else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
443   buffer += escapeExpression(stack1)
444     + "' class=\"toggleOperation\">";
445   if (stack1 = helpers.summary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
446   else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
447   if(stack1 || stack1 === 0) { buffer += stack1; }
448   buffer += "</a>\n          </li>\n        </ul>\n      </div>\n      <div class='content' id='";
449   if (stack1 = helpers.parentId) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
450   else { stack1 = depth0.parentId; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
451   buffer += escapeExpression(stack1)
452     + "_";
453   if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
454   else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
455   buffer += escapeExpression(stack1)
456     + "_content' style='display:none'>\n        ";
457   stack1 = helpers['if'].call(depth0, depth0.notes, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
458   if(stack1 || stack1 === 0) { buffer += stack1; }
459   buffer += "\n        ";
460   options = {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data};
461   if (stack1 = helpers.oauth) { stack1 = stack1.call(depth0, options); }
462   else { stack1 = depth0.oauth; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
463   if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
464   if(stack1 || stack1 === 0) { buffer += stack1; }
465   buffer += "\n        ";
466   stack1 = helpers.each.call(depth0, depth0.oauth, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
467   if(stack1 || stack1 === 0) { buffer += stack1; }
468   buffer += "\n        ";
469   options = {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data};
470   if (stack1 = helpers.oauth) { stack1 = stack1.call(depth0, options); }
471   else { stack1 = depth0.oauth; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
472   if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
473   if(stack1 || stack1 === 0) { buffer += stack1; }
474   buffer += "\n        ";
475   options = {hash:{},inverse:self.noop,fn:self.program(10, program10, data),data:data};
476   if (stack1 = helpers.oauth) { stack1 = stack1.call(depth0, options); }
477   else { stack1 = depth0.oauth; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
478   if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
479   if(stack1 || stack1 === 0) { buffer += stack1; }
480   buffer += "\n        ";
481   stack1 = helpers['if'].call(depth0, depth0.type, {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data});
482   if(stack1 || stack1 === 0) { buffer += stack1; }
483   buffer += "\n        <form accept-charset='UTF-8' class='sandbox'>\n          <div style='margin:0;padding:0;display:inline'></div>\n          ";
484   stack1 = helpers['if'].call(depth0, depth0.parameters, {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data});
485   if(stack1 || stack1 === 0) { buffer += stack1; }
486   buffer += "\n          ";
487   stack1 = helpers['if'].call(depth0, depth0.responseMessages, {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
488   if(stack1 || stack1 === 0) { buffer += stack1; }
489   buffer += "\n          ";
490   stack1 = helpers['if'].call(depth0, depth0.isReadOnly, {hash:{},inverse:self.program(20, program20, data),fn:self.program(18, program18, data),data:data});
491   if(stack1 || stack1 === 0) { buffer += stack1; }
492   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";
493   return buffer;
494   });
495 })();
496
497 (function() {
498   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
499 templates['param'] = template(function (Handlebars,depth0,helpers,partials,data) {
500   this.compilerInfo = [4,'>= 1.0.0'];
501 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
502   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
503
504 function program1(depth0,data) {
505   
506   var buffer = "", stack1;
507   buffer += "\n         ";
508   stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
509   if(stack1 || stack1 === 0) { buffer += stack1; }
510   buffer += "\n ";
511   return buffer;
512   }
513 function program2(depth0,data) {
514   
515   var buffer = "", stack1;
516   buffer += "\n                 <input type=\"file\" name='";
517   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
518   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
519   buffer += escapeExpression(stack1)
520     + "'/>\n                    <div class=\"parameter-content-type\" />\n              ";
521   return buffer;
522   }
523
524 function program4(depth0,data) {
525   
526   var buffer = "", stack1;
527   buffer += "\n                 ";
528   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
529   if(stack1 || stack1 === 0) { buffer += stack1; }
530   buffer += "\n         ";
531   return buffer;
532   }
533 function program5(depth0,data) {
534   
535   var buffer = "", stack1;
536   buffer += "\n                         <textarea class='body-textarea' name='";
537   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
538   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
539   buffer += escapeExpression(stack1)
540     + "'>";
541   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
542   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
543   buffer += escapeExpression(stack1)
544     + "</textarea>\n                    ";
545   return buffer;
546   }
547
548 function program7(depth0,data) {
549   
550   var buffer = "", stack1;
551   buffer += "\n                         <textarea class='body-textarea' name='";
552   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
553   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
554   buffer += escapeExpression(stack1)
555     + "'></textarea>\n                          <br />\n                                <div class=\"parameter-content-type\" />\n                      ";
556   return buffer;
557   }
558
559 function program9(depth0,data) {
560   
561   var buffer = "", stack1;
562   buffer += "\n         ";
563   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
564   if(stack1 || stack1 === 0) { buffer += stack1; }
565   buffer += "\n ";
566   return buffer;
567   }
568 function program10(depth0,data) {
569   
570   var buffer = "", stack1;
571   buffer += "\n                 <input class='parameter' minlength='0' name='";
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     + "' placeholder='' type='text' value='";
576   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
577   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
578   buffer += escapeExpression(stack1)
579     + "'/>\n            ";
580   return buffer;
581   }
582
583 function program12(depth0,data) {
584   
585   var buffer = "", stack1;
586   buffer += "\n                 <input class='parameter' minlength='0' name='";
587   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
588   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
589   buffer += escapeExpression(stack1)
590     + "' placeholder='' type='text' value=''/>\n                ";
591   return buffer;
592   }
593
594   buffer += "<td class='code'>";
595   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
596   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
597   buffer += escapeExpression(stack1)
598     + "</td>\n<td>\n\n  ";
599   stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
600   if(stack1 || stack1 === 0) { buffer += stack1; }
601   buffer += "\n\n</td>\n<td>";
602   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
603   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
604   if(stack1 || stack1 === 0) { buffer += stack1; }
605   buffer += "</td>\n<td>";
606   if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
607   else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
608   if(stack1 || stack1 === 0) { buffer += stack1; }
609   buffer += "</td>\n<td>\n      <span class=\"model-signature\"></span>\n</td>\n";
610   return buffer;
611   });
612 })();
613
614 (function() {
615   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
616 templates['param_list'] = template(function (Handlebars,depth0,helpers,partials,data) {
617   this.compilerInfo = [4,'>= 1.0.0'];
618 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
619   var buffer = "", stack1, stack2, options, self=this, helperMissing=helpers.helperMissing, functionType="function", escapeExpression=this.escapeExpression;
620
621 function program1(depth0,data) {
622   
623   
624   return " multiple='multiple'";
625   }
626
627 function program3(depth0,data) {
628   
629   
630   return "\n    ";
631   }
632
633 function program5(depth0,data) {
634   
635   var buffer = "", stack1;
636   buffer += "\n      ";
637   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
638   if(stack1 || stack1 === 0) { buffer += stack1; }
639   buffer += "\n    ";
640   return buffer;
641   }
642 function program6(depth0,data) {
643   
644   
645   return "\n      ";
646   }
647
648 function program8(depth0,data) {
649   
650   var buffer = "", stack1, stack2, options;
651   buffer += "\n        ";
652   options = {hash:{},inverse:self.program(11, program11, data),fn:self.program(9, program9, data),data:data};
653   stack2 = ((stack1 = helpers.isArray || depth0.isArray),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "isArray", depth0, options));
654   if(stack2 || stack2 === 0) { buffer += stack2; }
655   buffer += "\n      ";
656   return buffer;
657   }
658 function program9(depth0,data) {
659   
660   
661   return "\n        ";
662   }
663
664 function program11(depth0,data) {
665   
666   
667   return "\n          <option selected=\"\" value=''></option>\n        ";
668   }
669
670 function program13(depth0,data) {
671   
672   var buffer = "", stack1;
673   buffer += "\n      ";
674   stack1 = helpers['if'].call(depth0, depth0.isDefault, {hash:{},inverse:self.program(16, program16, data),fn:self.program(14, program14, data),data:data});
675   if(stack1 || stack1 === 0) { buffer += stack1; }
676   buffer += "\n    ";
677   return buffer;
678   }
679 function program14(depth0,data) {
680   
681   var buffer = "", stack1;
682   buffer += "\n        <option selected=\"\" value='";
683   if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
684   else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
685   buffer += escapeExpression(stack1)
686     + "'>";
687   if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
688   else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
689   buffer += escapeExpression(stack1)
690     + " (default)</option>\n      ";
691   return buffer;
692   }
693
694 function program16(depth0,data) {
695   
696   var buffer = "", stack1;
697   buffer += "\n        <option value='";
698   if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
699   else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
700   buffer += escapeExpression(stack1)
701     + "'>";
702   if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
703   else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
704   buffer += escapeExpression(stack1)
705     + "</option>\n      ";
706   return buffer;
707   }
708
709   buffer += "<td class='code'>";
710   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
711   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
712   buffer += escapeExpression(stack1)
713     + "</td>\n<td>\n  <select ";
714   options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
715   stack2 = ((stack1 = helpers.isArray || depth0.isArray),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "isArray", depth0, options));
716   if(stack2 || stack2 === 0) { buffer += stack2; }
717   buffer += " class='parameter' name='";
718   if (stack2 = helpers.name) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
719   else { stack2 = depth0.name; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
720   buffer += escapeExpression(stack2)
721     + "'>\n    ";
722   stack2 = helpers['if'].call(depth0, depth0.required, {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
723   if(stack2 || stack2 === 0) { buffer += stack2; }
724   buffer += "\n    ";
725   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});
726   if(stack2 || stack2 === 0) { buffer += stack2; }
727   buffer += "\n  </select>\n</td>\n<td>";
728   if (stack2 = helpers.description) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
729   else { stack2 = depth0.description; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
730   if(stack2 || stack2 === 0) { buffer += stack2; }
731   buffer += "</td>\n<td>";
732   if (stack2 = helpers.paramType) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
733   else { stack2 = depth0.paramType; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
734   if(stack2 || stack2 === 0) { buffer += stack2; }
735   buffer += "</td>\n<td><span class=\"model-signature\"></span></td>";
736   return buffer;
737   });
738 })();
739
740 (function() {
741   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
742 templates['param_readonly'] = template(function (Handlebars,depth0,helpers,partials,data) {
743   this.compilerInfo = [4,'>= 1.0.0'];
744 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
745   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
746
747 function program1(depth0,data) {
748   
749   var buffer = "", stack1;
750   buffer += "\n        <textarea class='body-textarea' readonly='readonly' name='";
751   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
752   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
753   buffer += escapeExpression(stack1)
754     + "'>";
755   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
756   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
757   buffer += escapeExpression(stack1)
758     + "</textarea>\n    ";
759   return buffer;
760   }
761
762 function program3(depth0,data) {
763   
764   var buffer = "", stack1;
765   buffer += "\n        ";
766   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
767   if(stack1 || stack1 === 0) { buffer += stack1; }
768   buffer += "\n    ";
769   return buffer;
770   }
771 function program4(depth0,data) {
772   
773   var buffer = "", stack1;
774   buffer += "\n            ";
775   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
776   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
777   buffer += escapeExpression(stack1)
778     + "\n        ";
779   return buffer;
780   }
781
782 function program6(depth0,data) {
783   
784   
785   return "\n            (empty)\n        ";
786   }
787
788   buffer += "<td class='code'>";
789   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
790   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
791   buffer += escapeExpression(stack1)
792     + "</td>\n<td>\n    ";
793   stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
794   if(stack1 || stack1 === 0) { buffer += stack1; }
795   buffer += "\n</td>\n<td>";
796   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
797   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
798   if(stack1 || stack1 === 0) { buffer += stack1; }
799   buffer += "</td>\n<td>";
800   if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
801   else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
802   if(stack1 || stack1 === 0) { buffer += stack1; }
803   buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
804   return buffer;
805   });
806 })();
807
808 (function() {
809   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
810 templates['param_readonly_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
811   this.compilerInfo = [4,'>= 1.0.0'];
812 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
813   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
814
815 function program1(depth0,data) {
816   
817   var buffer = "", stack1;
818   buffer += "\n        <textarea class='body-textarea'  readonly='readonly' placeholder='(required)' name='";
819   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
820   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
821   buffer += escapeExpression(stack1)
822     + "'>";
823   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
824   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
825   buffer += escapeExpression(stack1)
826     + "</textarea>\n    ";
827   return buffer;
828   }
829
830 function program3(depth0,data) {
831   
832   var buffer = "", stack1;
833   buffer += "\n        ";
834   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
835   if(stack1 || stack1 === 0) { buffer += stack1; }
836   buffer += "\n    ";
837   return buffer;
838   }
839 function program4(depth0,data) {
840   
841   var buffer = "", stack1;
842   buffer += "\n            ";
843   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
844   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
845   buffer += escapeExpression(stack1)
846     + "\n        ";
847   return buffer;
848   }
849
850 function program6(depth0,data) {
851   
852   
853   return "\n            (empty)\n        ";
854   }
855
856   buffer += "<td class='code required'>";
857   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
858   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
859   buffer += escapeExpression(stack1)
860     + "</td>\n<td>\n    ";
861   stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
862   if(stack1 || stack1 === 0) { buffer += stack1; }
863   buffer += "\n</td>\n<td>";
864   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
865   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
866   if(stack1 || stack1 === 0) { buffer += stack1; }
867   buffer += "</td>\n<td>";
868   if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
869   else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
870   if(stack1 || stack1 === 0) { buffer += stack1; }
871   buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
872   return buffer;
873   });
874 })();
875
876 (function() {
877   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
878 templates['param_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
879   this.compilerInfo = [4,'>= 1.0.0'];
880 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
881   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
882
883 function program1(depth0,data) {
884   
885   var buffer = "", stack1;
886   buffer += "\n         ";
887   stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
888   if(stack1 || stack1 === 0) { buffer += stack1; }
889   buffer += "\n ";
890   return buffer;
891   }
892 function program2(depth0,data) {
893   
894   var buffer = "", stack1;
895   buffer += "\n                 <input type=\"file\" name='";
896   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
897   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
898   buffer += escapeExpression(stack1)
899     + "'/>\n            ";
900   return buffer;
901   }
902
903 function program4(depth0,data) {
904   
905   var buffer = "", stack1;
906   buffer += "\n                 ";
907   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
908   if(stack1 || stack1 === 0) { buffer += stack1; }
909   buffer += "\n         ";
910   return buffer;
911   }
912 function program5(depth0,data) {
913   
914   var buffer = "", stack1;
915   buffer += "\n                         <textarea class='body-textarea' placeholder='(required)' name='";
916   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
917   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
918   buffer += escapeExpression(stack1)
919     + "'>";
920   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
921   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
922   buffer += escapeExpression(stack1)
923     + "</textarea>\n                    ";
924   return buffer;
925   }
926
927 function program7(depth0,data) {
928   
929   var buffer = "", stack1;
930   buffer += "\n                         <textarea class='body-textarea' placeholder='(required)' name='";
931   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
932   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
933   buffer += escapeExpression(stack1)
934     + "'></textarea>\n                          <br />\n                                <div class=\"parameter-content-type\" />\n                      ";
935   return buffer;
936   }
937
938 function program9(depth0,data) {
939   
940   var buffer = "", stack1;
941   buffer += "\n         ";
942   stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
943   if(stack1 || stack1 === 0) { buffer += stack1; }
944   buffer += "\n ";
945   return buffer;
946   }
947 function program10(depth0,data) {
948   
949   var buffer = "", stack1;
950   buffer += "\n                 <input class='parameter' class='required' type='file' name='";
951   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
952   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
953   buffer += escapeExpression(stack1)
954     + "'/>\n            ";
955   return buffer;
956   }
957
958 function program12(depth0,data) {
959   
960   var buffer = "", stack1;
961   buffer += "\n                 ";
962   stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
963   if(stack1 || stack1 === 0) { buffer += stack1; }
964   buffer += "\n         ";
965   return buffer;
966   }
967 function program13(depth0,data) {
968   
969   var buffer = "", stack1;
970   buffer += "\n                         <input class='parameter required' minlength='1' name='";
971   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
972   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
973   buffer += escapeExpression(stack1)
974     + "' placeholder='(required)' type='text' value='";
975   if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
976   else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
977   buffer += escapeExpression(stack1)
978     + "'/>\n                    ";
979   return buffer;
980   }
981
982 function program15(depth0,data) {
983   
984   var buffer = "", stack1;
985   buffer += "\n                         <input class='parameter required' minlength='1' name='";
986   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
987   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
988   buffer += escapeExpression(stack1)
989     + "' placeholder='(required)' type='text' value=''/>\n                      ";
990   return buffer;
991   }
992
993   buffer += "<td class='code required'>";
994   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
995   else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
996   buffer += escapeExpression(stack1)
997     + "</td>\n<td>\n    ";
998   stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
999   if(stack1 || stack1 === 0) { buffer += stack1; }
1000   buffer += "\n</td>\n<td>\n    <strong>";
1001   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1002   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1003   if(stack1 || stack1 === 0) { buffer += stack1; }
1004   buffer += "</strong>\n</td>\n<td>";
1005   if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1006   else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1007   if(stack1 || stack1 === 0) { buffer += stack1; }
1008   buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
1009   return buffer;
1010   });
1011 })();
1012
1013 (function() {
1014   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1015 templates['parameter_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
1016   this.compilerInfo = [4,'>= 1.0.0'];
1017 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1018   var buffer = "", stack1, functionType="function", self=this;
1019
1020 function program1(depth0,data) {
1021   
1022   var buffer = "", stack1;
1023   buffer += "\n  ";
1024   stack1 = helpers.each.call(depth0, depth0.consumes, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
1025   if(stack1 || stack1 === 0) { buffer += stack1; }
1026   buffer += "\n";
1027   return buffer;
1028   }
1029 function program2(depth0,data) {
1030   
1031   var buffer = "", stack1;
1032   buffer += "\n  <option value=\"";
1033   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1034   if(stack1 || stack1 === 0) { buffer += stack1; }
1035   buffer += "\">";
1036   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1037   if(stack1 || stack1 === 0) { buffer += stack1; }
1038   buffer += "</option>\n  ";
1039   return buffer;
1040   }
1041
1042 function program4(depth0,data) {
1043   
1044   
1045   return "\n  <option value=\"application/json\">application/json</option>\n";
1046   }
1047
1048   buffer += "<label for=\"parameterContentType\"></label>\n<select name=\"parameterContentType\">\n";
1049   stack1 = helpers['if'].call(depth0, depth0.consumes, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
1050   if(stack1 || stack1 === 0) { buffer += stack1; }
1051   buffer += "\n</select>\n";
1052   return buffer;
1053   });
1054 })();
1055
1056 (function() {
1057   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1058 templates['resource'] = template(function (Handlebars,depth0,helpers,partials,data) {
1059   this.compilerInfo = [4,'>= 1.0.0'];
1060 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1061   var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
1062
1063 function program1(depth0,data) {
1064   
1065   
1066   return " : ";
1067   }
1068
1069   buffer += "<div class='heading'>\n  <h2>\n    <a href='#!/";
1070   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1071   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1072   buffer += escapeExpression(stack1)
1073     + "' onclick=\"Docs.toggleEndpointListForResource('";
1074   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1075   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1076   buffer += escapeExpression(stack1)
1077     + "');\">";
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     + "</a> ";
1082   options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
1083   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, options); }
1084   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1085   if (!helpers.description) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
1086   if(stack1 || stack1 === 0) { buffer += stack1; }
1087   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1088   else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1089   if(stack1 || stack1 === 0) { buffer += stack1; }
1090   buffer += "\n  </h2>\n  <ul class='options'>\n    <li>\n      <a href='#!/";
1091   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1092   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1093   buffer += escapeExpression(stack1)
1094     + "' id='endpointListTogger_";
1095   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1096   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1097   buffer += escapeExpression(stack1)
1098     + "'\n         onclick=\"Docs.toggleEndpointListForResource('";
1099   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1100   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1101   buffer += escapeExpression(stack1)
1102     + "');\">Show/Hide</a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.collapseOperationsForResource('";
1103   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1104   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1105   buffer += escapeExpression(stack1)
1106     + "'); return false;\">\n        List Operations\n      </a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.expandOperationsForResource('";
1107   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1108   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1109   buffer += escapeExpression(stack1)
1110     + "'); return false;\">\n        Expand Operations\n      </a>\n    </li>\n    <li>\n      <a href='";
1111   if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1112   else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1113   buffer += escapeExpression(stack1)
1114     + "'>Raw</a>\n    </li>\n  </ul>\n</div>\n<ul class='endpoints' id='";
1115   if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1116   else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1117   buffer += escapeExpression(stack1)
1118     + "_endpoint_list' style='display:none'>\n\n</ul>\n";
1119   return buffer;
1120   });
1121 })();
1122
1123 (function() {
1124   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1125 templates['response_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
1126   this.compilerInfo = [4,'>= 1.0.0'];
1127 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1128   var buffer = "", stack1, functionType="function", self=this;
1129
1130 function program1(depth0,data) {
1131   
1132   var buffer = "", stack1;
1133   buffer += "\n  ";
1134   stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
1135   if(stack1 || stack1 === 0) { buffer += stack1; }
1136   buffer += "\n";
1137   return buffer;
1138   }
1139 function program2(depth0,data) {
1140   
1141   var buffer = "", stack1;
1142   buffer += "\n  <option value=\"";
1143   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1144   if(stack1 || stack1 === 0) { buffer += stack1; }
1145   buffer += "\">";
1146   stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
1147   if(stack1 || stack1 === 0) { buffer += stack1; }
1148   buffer += "</option>\n  ";
1149   return buffer;
1150   }
1151
1152 function program4(depth0,data) {
1153   
1154   
1155   return "\n  <option value=\"application/json\">application/json</option>\n";
1156   }
1157
1158   buffer += "<label for=\"responseContentType\"></label>\n<select name=\"responseContentType\">\n";
1159   stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
1160   if(stack1 || stack1 === 0) { buffer += stack1; }
1161   buffer += "\n</select>\n";
1162   return buffer;
1163   });
1164 })();
1165
1166 (function() {
1167   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1168 templates['signature'] = template(function (Handlebars,depth0,helpers,partials,data) {
1169   this.compilerInfo = [4,'>= 1.0.0'];
1170 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1171   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
1172
1173
1174   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        ";
1175   if (stack1 = helpers.signature) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1176   else { stack1 = depth0.signature; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1177   if(stack1 || stack1 === 0) { buffer += stack1; }
1178   buffer += "\n    </div>\n\n    <div class=\"snippet\">\n        <pre><code>";
1179   if (stack1 = helpers.sampleJSON) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1180   else { stack1 = depth0.sampleJSON; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1181   buffer += escapeExpression(stack1)
1182     + "</code></pre>\n        <small class=\"notice\"></small>\n    </div>\n</div>\n\n";
1183   return buffer;
1184   });
1185 })();
1186
1187 (function() {
1188   var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
1189 templates['status_code'] = template(function (Handlebars,depth0,helpers,partials,data) {
1190   this.compilerInfo = [4,'>= 1.0.0'];
1191 helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1192   var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
1193
1194
1195   buffer += "<td width='15%' class='code'>";
1196   if (stack1 = helpers.code) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1197   else { stack1 = depth0.code; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1198   buffer += escapeExpression(stack1)
1199     + "</td>\n<td>";
1200   if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1201   else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1202   if(stack1 || stack1 === 0) { buffer += stack1; }
1203   buffer += "</td>\n";
1204   return buffer;
1205   });
1206 })();
1207
1208
1209
1210 // Generated by CoffeeScript 1.6.3
1211 (function() {
1212   var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
1213     __hasProp = {}.hasOwnProperty,
1214     __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; };
1215
1216   SwaggerUi = (function(_super) {
1217     __extends(SwaggerUi, _super);
1218
1219     function SwaggerUi() {
1220       _ref = SwaggerUi.__super__.constructor.apply(this, arguments);
1221       return _ref;
1222     }
1223
1224     SwaggerUi.prototype.dom_id = "swagger_ui";
1225
1226     SwaggerUi.prototype.options = null;
1227
1228     SwaggerUi.prototype.api = null;
1229
1230     SwaggerUi.prototype.headerView = null;
1231
1232     SwaggerUi.prototype.mainView = null;
1233
1234     SwaggerUi.prototype.initialize = function(options) {
1235       var _this = this;
1236       if (options == null) {
1237         options = {};
1238       }
1239       if (options.dom_id != null) {
1240         this.dom_id = options.dom_id;
1241         delete options.dom_id;
1242       }
1243       if ($('#' + this.dom_id) == null) {
1244         $('body').append('<div id="' + this.dom_id + '"></div>');
1245       }
1246       this.options = options;
1247       this.options.success = function() {
1248         return _this.render();
1249       };
1250       this.options.progress = function(d) {
1251         return _this.showMessage(d);
1252       };
1253       this.options.failure = function(d) {
1254         return _this.onLoadFailure(d);
1255       };
1256       this.headerView = new HeaderView({
1257         el: $('#header')
1258       });
1259       return this.headerView.on('update-swagger-ui', function(data) {
1260         return _this.updateSwaggerUi(data);
1261       });
1262     };
1263
1264     SwaggerUi.prototype.updateSwaggerUi = function(data) {
1265       this.options.url = data.url;
1266       return this.load();
1267     };
1268
1269     SwaggerUi.prototype.load = function() {
1270       var url, _ref1;
1271       if ((_ref1 = this.mainView) != null) {
1272         _ref1.clear();
1273       }
1274       url = this.options.url;
1275       if (url.indexOf("http") !== 0) {
1276         url = this.buildUrl(window.location.href.toString(), url);
1277       }
1278       this.options.url = url;
1279       this.headerView.update(url);
1280       this.api = new SwaggerApi(this.options);
1281       this.api.build();
1282       return this.api;
1283     };
1284
1285     SwaggerUi.prototype.render = function() {
1286       var _this = this;
1287       this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
1288       this.mainView = new MainView({
1289         model: this.api,
1290         el: $('#' + this.dom_id)
1291       }).render();
1292       this.showMessage();
1293       switch (this.options.docExpansion) {
1294         case "full":
1295           Docs.expandOperationsForResource('');
1296           break;
1297         case "list":
1298           Docs.collapseOperationsForResource('');
1299       }
1300       if (this.options.onComplete) {
1301         this.options.onComplete(this.api, this);
1302       }
1303       return setTimeout(function() {
1304         return Docs.shebang();
1305       }, 400);
1306     };
1307
1308     SwaggerUi.prototype.buildUrl = function(base, url) {
1309       var endOfPath, parts;
1310       log("base is " + base);
1311       if (url.indexOf("/") === 0) {
1312         parts = base.split("/");
1313         base = parts[0] + "//" + parts[2];
1314         return base + url;
1315       } else {
1316         endOfPath = base.length;
1317         if (base.indexOf("?") > -1) {
1318           endOfPath = Math.min(endOfPath, base.indexOf("?"));
1319         }
1320         if (base.indexOf("#") > -1) {
1321           endOfPath = Math.min(endOfPath, base.indexOf("#"));
1322         }
1323         base = base.substring(0, endOfPath);
1324         if (base.indexOf("/", base.length - 1) !== -1) {
1325           return base + url;
1326         }
1327         return base + "/" + url;
1328       }
1329     };
1330
1331     SwaggerUi.prototype.showMessage = function(data) {
1332       if (data == null) {
1333         data = '';
1334       }
1335       $('#message-bar').removeClass('message-fail');
1336       $('#message-bar').addClass('message-success');
1337       return $('#message-bar').html(data);
1338     };
1339
1340     SwaggerUi.prototype.onLoadFailure = function(data) {
1341       var val;
1342       if (data == null) {
1343         data = '';
1344       }
1345       $('#message-bar').removeClass('message-success');
1346       $('#message-bar').addClass('message-fail');
1347       val = $('#message-bar').html(data);
1348       if (this.options.onFailure != null) {
1349         this.options.onFailure(data);
1350       }
1351       return val;
1352     };
1353
1354     return SwaggerUi;
1355
1356   })(Backbone.Router);
1357
1358   window.SwaggerUi = SwaggerUi;
1359
1360   HeaderView = (function(_super) {
1361     __extends(HeaderView, _super);
1362
1363     function HeaderView() {
1364       _ref1 = HeaderView.__super__.constructor.apply(this, arguments);
1365       return _ref1;
1366     }
1367
1368     HeaderView.prototype.events = {
1369       'click #show-pet-store-icon': 'showPetStore',
1370       'click #show-wordnik-dev-icon': 'showWordnikDev',
1371       'click #explore': 'showCustom',
1372       'keyup #input_baseUrl': 'showCustomOnKeyup',
1373       'keyup #input_apiKey': 'showCustomOnKeyup'
1374     };
1375
1376     HeaderView.prototype.initialize = function() {};
1377
1378     HeaderView.prototype.showPetStore = function(e) {
1379       return this.trigger('update-swagger-ui', {
1380         url: "http://petstore.swagger.wordnik.com/api/api-docs"
1381       });
1382     };
1383
1384     HeaderView.prototype.showWordnikDev = function(e) {
1385       return this.trigger('update-swagger-ui', {
1386         url: "http://api.wordnik.com/v4/resources.json"
1387       });
1388     };
1389
1390     HeaderView.prototype.showCustomOnKeyup = function(e) {
1391       if (e.keyCode === 13) {
1392         return this.showCustom();
1393       }
1394     };
1395
1396     HeaderView.prototype.showCustom = function(e) {
1397       if (e != null) {
1398         e.preventDefault();
1399       }
1400       return this.trigger('update-swagger-ui', {
1401         url: $('#input_baseUrl').val(),
1402         apiKey: $('#input_apiKey').val()
1403       });
1404     };
1405
1406     HeaderView.prototype.update = function(url, apiKey, trigger) {
1407       if (trigger == null) {
1408         trigger = false;
1409       }
1410       $('#input_baseUrl').val(url);
1411       if (trigger) {
1412         return this.trigger('update-swagger-ui', {
1413           url: url
1414         });
1415       }
1416     };
1417
1418     return HeaderView;
1419
1420   })(Backbone.View);
1421
1422   MainView = (function(_super) {
1423     __extends(MainView, _super);
1424
1425     function MainView() {
1426       _ref2 = MainView.__super__.constructor.apply(this, arguments);
1427       return _ref2;
1428     }
1429
1430     MainView.prototype.initialize = function() {};
1431
1432     MainView.prototype.render = function() {
1433       var counter, id, resource, resources, _i, _len, _ref3;
1434       $(this.el).html(Handlebars.templates.main(this.model));
1435       resources = {};
1436       counter = 0;
1437       _ref3 = this.model.apisArray;
1438       for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
1439         resource = _ref3[_i];
1440         id = resource.name;
1441         while (typeof resources[id] !== 'undefined') {
1442           id = id + "_" + counter;
1443           counter += 1;
1444         }
1445         resource.id = id;
1446         resources[id] = resource;
1447         this.addResource(resource);
1448       }
1449       return this;
1450     };
1451
1452     MainView.prototype.addResource = function(resource) {
1453       var resourceView;
1454       resourceView = new ResourceView({
1455         model: resource,
1456         tagName: 'li',
1457         id: 'resource_' + resource.id,
1458         className: 'resource'
1459       });
1460       return $('#resources').append(resourceView.render().el);
1461     };
1462
1463     MainView.prototype.clear = function() {
1464       return $(this.el).html('');
1465     };
1466
1467     return MainView;
1468
1469   })(Backbone.View);
1470
1471   ResourceView = (function(_super) {
1472     __extends(ResourceView, _super);
1473
1474     function ResourceView() {
1475       _ref3 = ResourceView.__super__.constructor.apply(this, arguments);
1476       return _ref3;
1477     }
1478
1479     ResourceView.prototype.initialize = function() {};
1480
1481     ResourceView.prototype.render = function() {
1482       var counter, id, methods, operation, _i, _len, _ref4;
1483       $(this.el).html(Handlebars.templates.resource(this.model));
1484       methods = {};
1485       _ref4 = this.model.operationsArray;
1486       for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
1487         operation = _ref4[_i];
1488         counter = 0;
1489         id = operation.nickname;
1490         while (typeof methods[id] !== 'undefined') {
1491           id = id + "_" + counter;
1492           counter += 1;
1493         }
1494         methods[id] = operation;
1495         operation.nickname = id;
1496         operation.parentId = this.model.id;
1497         this.addOperation(operation);
1498       }
1499       return this;
1500     };
1501
1502     ResourceView.prototype.addOperation = function(operation) {
1503       var operationView;
1504       operation.number = this.number;
1505       operationView = new OperationView({
1506         model: operation,
1507         tagName: 'li',
1508         className: 'endpoint'
1509       });
1510       $('.endpoints', $(this.el)).append(operationView.render().el);
1511       return this.number++;
1512     };
1513
1514     return ResourceView;
1515
1516   })(Backbone.View);
1517
1518   OperationView = (function(_super) {
1519     __extends(OperationView, _super);
1520
1521     function OperationView() {
1522       _ref4 = OperationView.__super__.constructor.apply(this, arguments);
1523       return _ref4;
1524     }
1525
1526     OperationView.prototype.invocationUrl = null;
1527
1528     OperationView.prototype.events = {
1529       'submit .sandbox': 'submitOperation',
1530       'click .submit': 'submitOperation',
1531       'click .response_hider': 'hideResponse',
1532       'click .toggleOperation': 'toggleOperationContent',
1533       'mouseenter .api-ic': 'mouseEnter',
1534       'mouseout .api-ic': 'mouseExit'
1535     };
1536
1537     OperationView.prototype.initialize = function() {};
1538
1539     OperationView.prototype.mouseEnter = function(e) {
1540       var elem, hgh, pos, scMaxX, scMaxY, scX, scY, wd, x, y;
1541       elem = $(e.currentTarget.parentNode).find('#api_information_panel');
1542       x = event.pageX;
1543       y = event.pageY;
1544       scX = $(window).scrollLeft();
1545       scY = $(window).scrollTop();
1546       scMaxX = scX + $(window).width();
1547       scMaxY = scY + $(window).height();
1548       wd = elem.width();
1549       hgh = elem.height();
1550       if (x + wd > scMaxX) {
1551         x = scMaxX - wd;
1552       }
1553       if (x < scX) {
1554         x = scX;
1555       }
1556       if (y + hgh > scMaxY) {
1557         y = scMaxY - hgh;
1558       }
1559       if (y < scY) {
1560         y = scY;
1561       }
1562       pos = {};
1563       pos.top = y;
1564       pos.left = x;
1565       elem.css(pos);
1566       return $(e.currentTarget.parentNode).find('#api_information_panel').show();
1567     };
1568
1569     OperationView.prototype.mouseExit = function(e) {
1570       return $(e.currentTarget.parentNode).find('#api_information_panel').hide();
1571     };
1572
1573     OperationView.prototype.render = function() {
1574       var contentTypeModel, isMethodSubmissionSupported, k, o, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, v, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref5, _ref6, _ref7, _ref8;
1575       isMethodSubmissionSupported = true;
1576       if (!isMethodSubmissionSupported) {
1577         this.model.isReadOnly = true;
1578       }
1579       this.model.oauth = null;
1580       if (this.model.authorizations) {
1581         _ref5 = this.model.authorizations;
1582         for (k in _ref5) {
1583           v = _ref5[k];
1584           if (k === "oauth2") {
1585             if (this.model.oauth === null) {
1586               this.model.oauth = {};
1587             }
1588             if (this.model.oauth.scopes === void 0) {
1589               this.model.oauth.scopes = [];
1590             }
1591             for (_i = 0, _len = v.length; _i < _len; _i++) {
1592               o = v[_i];
1593               this.model.oauth.scopes.push(o);
1594             }
1595           }
1596         }
1597       }
1598       $(this.el).html(Handlebars.templates.operation(this.model));
1599       if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') {
1600         signatureModel = {
1601           sampleJSON: this.model.responseSampleJSON,
1602           isParam: false,
1603           signature: this.model.responseClassSignature
1604         };
1605         responseSignatureView = new SignatureView({
1606           model: signatureModel,
1607           tagName: 'div'
1608         });
1609         $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
1610       } else {
1611         $('.model-signature', $(this.el)).html(this.model.type);
1612       }
1613       contentTypeModel = {
1614         isParam: false
1615       };
1616       contentTypeModel.consumes = this.model.consumes;
1617       contentTypeModel.produces = this.model.produces;
1618       _ref6 = this.model.parameters;
1619       for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1620         param = _ref6[_j];
1621         type = param.type || param.dataType;
1622         if (type.toLowerCase() === 'file') {
1623           if (!contentTypeModel.consumes) {
1624             log("set content type ");
1625             contentTypeModel.consumes = 'multipart/form-data';
1626           }
1627         }
1628       }
1629       responseContentTypeView = new ResponseContentTypeView({
1630         model: contentTypeModel
1631       });
1632       $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
1633       _ref7 = this.model.parameters;
1634       for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1635         param = _ref7[_k];
1636         this.addParameter(param, contentTypeModel.consumes);
1637       }
1638       _ref8 = this.model.responseMessages;
1639       for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) {
1640         statusCode = _ref8[_l];
1641         this.addStatusCode(statusCode);
1642       }
1643       return this;
1644     };
1645
1646     OperationView.prototype.addParameter = function(param, consumes) {
1647       var paramView;
1648       param.consumes = consumes;
1649       paramView = new ParameterView({
1650         model: param,
1651         tagName: 'tr',
1652         readOnly: this.model.isReadOnly
1653       });
1654       return $('.operation-params', $(this.el)).append(paramView.render().el);
1655     };
1656
1657     OperationView.prototype.addStatusCode = function(statusCode) {
1658       var statusCodeView;
1659       statusCodeView = new StatusCodeView({
1660         model: statusCode,
1661         tagName: 'tr'
1662       });
1663       return $('.operation-status', $(this.el)).append(statusCodeView.render().el);
1664     };
1665
1666     OperationView.prototype.submitOperation = function(e) {
1667       var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
1668       if (e != null) {
1669         e.preventDefault();
1670       }
1671       form = $('.sandbox', $(this.el));
1672       error_free = true;
1673       form.find("input.required").each(function() {
1674         var _this = this;
1675         $(this).removeClass("error");
1676         if (jQuery.trim($(this).val()) === "") {
1677           $(this).addClass("error");
1678           $(this).wiggle({
1679             callback: function() {
1680               return $(_this).focus();
1681             }
1682           });
1683           return error_free = false;
1684         }
1685       });
1686       if (error_free) {
1687         map = {};
1688         opts = {
1689           parent: this
1690         };
1691         isFileUpload = false;
1692         _ref5 = form.find("input");
1693         for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1694           o = _ref5[_i];
1695           if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1696             map[o.name] = o.value;
1697           }
1698           if (o.type === "file") {
1699             isFileUpload = true;
1700           }
1701         }
1702         _ref6 = form.find("textarea");
1703         for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1704           o = _ref6[_j];
1705           if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1706             map["body"] = o.value;
1707           }
1708         }
1709         _ref7 = form.find("select");
1710         for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1711           o = _ref7[_k];
1712           val = this.getSelectedValue(o);
1713           if ((val != null) && jQuery.trim(val).length > 0) {
1714             map[o.name] = val;
1715           }
1716         }
1717         opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val();
1718         opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val();
1719         $(".response_throbber", $(this.el)).show();
1720         if (isFileUpload) {
1721           return this.handleFileUpload(map, form);
1722         } else {
1723           return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
1724         }
1725       }
1726     };
1727
1728     OperationView.prototype.success = function(response, parent) {
1729       return parent.showCompleteStatus(response);
1730     };
1731
1732     OperationView.prototype.handleFileUpload = function(map, form) {
1733       var bodyParam, el, headerParams, o, obj, param, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref5, _ref6, _ref7, _ref8,
1734         _this = this;
1735       log("it's a file upload");
1736       _ref5 = form.serializeArray();
1737       for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1738         o = _ref5[_i];
1739         if ((o.value != null) && jQuery.trim(o.value).length > 0) {
1740           map[o.name] = o.value;
1741         }
1742       }
1743       bodyParam = new FormData();
1744       _ref6 = this.model.parameters;
1745       for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
1746         param = _ref6[_j];
1747         if (param.paramType === 'form') {
1748           if (map[param.name] !== void 0) {
1749             bodyParam.append(param.name, map[param.name]);
1750           }
1751         }
1752       }
1753       headerParams = {};
1754       _ref7 = this.model.parameters;
1755       for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
1756         param = _ref7[_k];
1757         if (param.paramType === 'header') {
1758           headerParams[param.name] = map[param.name];
1759         }
1760       }
1761       log(headerParams);
1762       _ref8 = form.find('input[type~="file"]');
1763       for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) {
1764         el = _ref8[_l];
1765         bodyParam.append($(el).attr('name'), el.files[0]);
1766       }
1767       log(bodyParam);
1768       this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true);
1769       $(".request_url", $(this.el)).html("<pre>" + this.invocationUrl + "</pre>");
1770       obj = {
1771         type: this.model.method,
1772         url: this.invocationUrl,
1773         headers: headerParams,
1774         data: bodyParam,
1775         dataType: 'json',
1776         contentType: false,
1777         processData: false,
1778         error: function(data, textStatus, error) {
1779           return _this.showErrorStatus(_this.wrap(data), _this);
1780         },
1781         success: function(data) {
1782           return _this.showResponse(data, _this);
1783         },
1784         complete: function(data) {
1785           return _this.showCompleteStatus(_this.wrap(data), _this);
1786         }
1787       };
1788       if (window.authorizations) {
1789         window.authorizations.apply(obj);
1790       }
1791       jQuery.ajax(obj);
1792       return false;
1793     };
1794
1795     OperationView.prototype.wrap = function(data) {
1796       var h, headerArray, headers, i, o, _i, _len;
1797       headers = {};
1798       headerArray = data.getAllResponseHeaders().split("\r");
1799       for (_i = 0, _len = headerArray.length; _i < _len; _i++) {
1800         i = headerArray[_i];
1801         h = i.split(':');
1802         if (h[0] !== void 0 && h[1] !== void 0) {
1803           headers[h[0].trim()] = h[1].trim();
1804         }
1805       }
1806       o = {};
1807       o.content = {};
1808       o.content.data = data.responseText;
1809       o.headers = headers;
1810       o.request = {};
1811       o.request.url = this.invocationUrl;
1812       o.status = data.status;
1813       return o;
1814     };
1815
1816     OperationView.prototype.getSelectedValue = function(select) {
1817       var opt, options, _i, _len, _ref5;
1818       if (!select.multiple) {
1819         return select.value;
1820       } else {
1821         options = [];
1822         _ref5 = select.options;
1823         for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
1824           opt = _ref5[_i];
1825           if (opt.selected) {
1826             options.push(opt.value);
1827           }
1828         }
1829         if (options.length > 0) {
1830           return options.join(",");
1831         } else {
1832           return null;
1833         }
1834       }
1835     };
1836
1837     OperationView.prototype.hideResponse = function(e) {
1838       if (e != null) {
1839         e.preventDefault();
1840       }
1841       $(".response", $(this.el)).slideUp();
1842       return $(".response_hider", $(this.el)).fadeOut();
1843     };
1844
1845     OperationView.prototype.showResponse = function(response) {
1846       var prettyJson;
1847       prettyJson = JSON.stringify(response, null, "\t").replace(/\n/g, "<br>");
1848       return $(".response_body", $(this.el)).html(escape(prettyJson));
1849     };
1850
1851     OperationView.prototype.showErrorStatus = function(data, parent) {
1852       return parent.showStatus(data);
1853     };
1854
1855     OperationView.prototype.showCompleteStatus = function(data, parent) {
1856       return parent.showStatus(data);
1857     };
1858
1859     OperationView.prototype.formatXml = function(xml) {
1860       var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len;
1861       reg = /(>)(<)(\/*)/g;
1862       wsexp = /[ ]*(.*)[ ]+\n/g;
1863       contexp = /(<.+>)(.+\n)/g;
1864       xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
1865       pad = 0;
1866       formatted = '';
1867       lines = xml.split('\n');
1868       indent = 0;
1869       lastType = 'other';
1870       transitions = {
1871         'single->single': 0,
1872         'single->closing': -1,
1873         'single->opening': 0,
1874         'single->other': 0,
1875         'closing->single': 0,
1876         'closing->closing': -1,
1877         'closing->opening': 0,
1878         'closing->other': 0,
1879         'opening->single': 1,
1880         'opening->closing': 0,
1881         'opening->opening': 1,
1882         'opening->other': 1,
1883         'other->single': 0,
1884         'other->closing': -1,
1885         'other->opening': 0,
1886         'other->other': 0
1887       };
1888       _fn = function(ln) {
1889         var fromTo, j, key, padding, type, types, value;
1890         types = {
1891           single: Boolean(ln.match(/<.+\/>/)),
1892           closing: Boolean(ln.match(/<\/.+>/)),
1893           opening: Boolean(ln.match(/<[^!?].*>/))
1894         };
1895         type = ((function() {
1896           var _results;
1897           _results = [];
1898           for (key in types) {
1899             value = types[key];
1900             if (value) {
1901               _results.push(key);
1902             }
1903           }
1904           return _results;
1905         })())[0];
1906         type = type === void 0 ? 'other' : type;
1907         fromTo = lastType + '->' + type;
1908         lastType = type;
1909         padding = '';
1910         indent += transitions[fromTo];
1911         padding = ((function() {
1912           var _j, _ref5, _results;
1913           _results = [];
1914           for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
1915             _results.push('  ');
1916           }
1917           return _results;
1918         })()).join('');
1919         if (fromTo === 'opening->closing') {
1920           return formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
1921         } else {
1922           return formatted += padding + ln + '\n';
1923         }
1924       };
1925       for (_i = 0, _len = lines.length; _i < _len; _i++) {
1926         ln = lines[_i];
1927         _fn(ln);
1928       }
1929       return formatted;
1930     };
1931
1932     OperationView.prototype.showStatus = function(response) {
1933       var code, content, contentType, headers, pre, response_body, url;
1934       if (response.content === void 0) {
1935         content = response.data;
1936         url = response.url;
1937       } else {
1938         content = response.content.data;
1939         url = response.request.url;
1940       }
1941       headers = response.headers;
1942       contentType = headers && headers["Content-Type"] ? headers["Content-Type"].split(";")[0].trim() : null;
1943       if (!content) {
1944         code = $('<code />').text("no content");
1945         pre = $('<pre class="json" />').append(code);
1946       } else if (contentType === "application/json" || /\+json$/.test(contentType)) {
1947         code = $('<code />').text(JSON.stringify(JSON.parse(content), null, "  "));
1948         pre = $('<pre class="json" />').append(code);
1949       } else if (contentType === "application/xml" || /\+xml$/.test(contentType)) {
1950         code = $('<code />').text(this.formatXml(content));
1951         pre = $('<pre class="xml" />').append(code);
1952       } else if (contentType === "text/html") {
1953         code = $('<code />').html(content);
1954         pre = $('<pre class="xml" />').append(code);
1955       } else if (/^image\//.test(contentType)) {
1956         pre = $('<img>').attr('src', url);
1957       } else {
1958         code = $('<code />').text(content);
1959         pre = $('<pre class="json" />').append(code);
1960       }
1961       response_body = pre;
1962       $(".request_url", $(this.el)).html("<pre>" + url + "</pre>");
1963       $(".response_code", $(this.el)).html("<pre>" + response.status + "</pre>");
1964       $(".response_body", $(this.el)).html(response_body);
1965       $(".response_headers", $(this.el)).html("<pre>" + JSON.stringify(response.headers, null, "  ").replace(/\n/g, "<br>") + "</pre>");
1966       $(".response", $(this.el)).slideDown();
1967       $(".response_hider", $(this.el)).show();
1968       $(".response_throbber", $(this.el)).hide();
1969       return hljs.highlightBlock($('.response_body', $(this.el))[0]);
1970     };
1971
1972     OperationView.prototype.toggleOperationContent = function() {
1973       var elem;
1974       elem = $('#' + Docs.escapeResourceName(this.model.parentId) + "_" + this.model.nickname + "_content");
1975       if (elem.is(':visible')) {
1976         return Docs.collapseOperation(elem);
1977       } else {
1978         return Docs.expandOperation(elem);
1979       }
1980     };
1981
1982     return OperationView;
1983
1984   })(Backbone.View);
1985
1986   StatusCodeView = (function(_super) {
1987     __extends(StatusCodeView, _super);
1988
1989     function StatusCodeView() {
1990       _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
1991       return _ref5;
1992     }
1993
1994     StatusCodeView.prototype.initialize = function() {};
1995
1996     StatusCodeView.prototype.render = function() {
1997       var template;
1998       template = this.template();
1999       $(this.el).html(template(this.model));
2000       return this;
2001     };
2002
2003     StatusCodeView.prototype.template = function() {
2004       return Handlebars.templates.status_code;
2005     };
2006
2007     return StatusCodeView;
2008
2009   })(Backbone.View);
2010
2011   ParameterView = (function(_super) {
2012     __extends(ParameterView, _super);
2013
2014     function ParameterView() {
2015       _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
2016       return _ref6;
2017     }
2018
2019     ParameterView.prototype.initialize = function() {
2020       return Handlebars.registerHelper('isArray', function(param, opts) {
2021         if (param.type.toLowerCase() === 'array' || param.allowMultiple) {
2022           return opts.fn(this);
2023         } else {
2024           return opts.inverse(this);
2025         }
2026       });
2027     };
2028
2029     ParameterView.prototype.render = function() {
2030       var contentTypeModel, isParam, parameterContentTypeView, responseContentTypeView, signatureModel, signatureView, template, type;
2031       type = this.model.type || this.model.dataType;
2032       if (this.model.paramType === 'body') {
2033         this.model.isBody = true;
2034       }
2035       if (type.toLowerCase() === 'file') {
2036         this.model.isFile = true;
2037       }
2038       template = this.template();
2039       $(this.el).html(template(this.model));
2040       signatureModel = {
2041         sampleJSON: this.model.sampleJSON,
2042         isParam: true,
2043         signature: this.model.signature
2044       };
2045       if (this.model.sampleJSON) {
2046         signatureView = new SignatureView({
2047           model: signatureModel,
2048           tagName: 'div'
2049         });
2050         $('.model-signature', $(this.el)).append(signatureView.render().el);
2051       } else {
2052         $('.model-signature', $(this.el)).html(this.model.signature);
2053       }
2054       isParam = false;
2055       if (this.model.isBody) {
2056         isParam = true;
2057       }
2058       contentTypeModel = {
2059         isParam: isParam
2060       };
2061       contentTypeModel.consumes = this.model.consumes;
2062       if (isParam) {
2063         parameterContentTypeView = new ParameterContentTypeView({
2064           model: contentTypeModel
2065         });
2066         $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
2067       } else {
2068         responseContentTypeView = new ResponseContentTypeView({
2069           model: contentTypeModel
2070         });
2071         $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
2072       }
2073       return this;
2074     };
2075
2076     ParameterView.prototype.template = function() {
2077       if (this.model.isList) {
2078         return Handlebars.templates.param_list;
2079       } else {
2080         if (this.options.readOnly) {
2081           if (this.model.required) {
2082             return Handlebars.templates.param_readonly_required;
2083           } else {
2084             return Handlebars.templates.param_readonly;
2085           }
2086         } else {
2087           if (this.model.required) {
2088             return Handlebars.templates.param_required;
2089           } else {
2090             return Handlebars.templates.param;
2091           }
2092         }
2093       }
2094     };
2095
2096     return ParameterView;
2097
2098   })(Backbone.View);
2099
2100   SignatureView = (function(_super) {
2101     __extends(SignatureView, _super);
2102
2103     function SignatureView() {
2104       _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
2105       return _ref7;
2106     }
2107
2108     SignatureView.prototype.events = {
2109       'click a.description-link': 'switchToDescription',
2110       'click a.snippet-link': 'switchToSnippet',
2111       'mousedown .snippet': 'snippetToTextArea'
2112     };
2113
2114     SignatureView.prototype.initialize = function() {};
2115
2116     SignatureView.prototype.render = function() {
2117       var template;
2118       template = this.template();
2119       $(this.el).html(template(this.model));
2120       this.switchToDescription();
2121       this.isParam = this.model.isParam;
2122       if (this.isParam) {
2123         $('.notice', $(this.el)).text('Click to set as parameter value');
2124       }
2125       return this;
2126     };
2127
2128     SignatureView.prototype.template = function() {
2129       return Handlebars.templates.signature;
2130     };
2131
2132     SignatureView.prototype.switchToDescription = function(e) {
2133       if (e != null) {
2134         e.preventDefault();
2135       }
2136       $(".snippet", $(this.el)).hide();
2137       $(".description", $(this.el)).show();
2138       $('.description-link', $(this.el)).addClass('selected');
2139       return $('.snippet-link', $(this.el)).removeClass('selected');
2140     };
2141
2142     SignatureView.prototype.switchToSnippet = function(e) {
2143       if (e != null) {
2144         e.preventDefault();
2145       }
2146       $(".description", $(this.el)).hide();
2147       $(".snippet", $(this.el)).show();
2148       $('.snippet-link', $(this.el)).addClass('selected');
2149       return $('.description-link', $(this.el)).removeClass('selected');
2150     };
2151
2152     SignatureView.prototype.snippetToTextArea = function(e) {
2153       var textArea;
2154       if (this.isParam) {
2155         if (e != null) {
2156           e.preventDefault();
2157         }
2158         textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
2159         if ($.trim(textArea.val()) === '') {
2160           return textArea.val(this.model.sampleJSON);
2161         }
2162       }
2163     };
2164
2165     return SignatureView;
2166
2167   })(Backbone.View);
2168
2169   ContentTypeView = (function(_super) {
2170     __extends(ContentTypeView, _super);
2171
2172     function ContentTypeView() {
2173       _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
2174       return _ref8;
2175     }
2176
2177     ContentTypeView.prototype.initialize = function() {};
2178
2179     ContentTypeView.prototype.render = function() {
2180       var template;
2181       template = this.template();
2182       $(this.el).html(template(this.model));
2183       $('label[for=contentType]', $(this.el)).text('Response Content Type');
2184       return this;
2185     };
2186
2187     ContentTypeView.prototype.template = function() {
2188       return Handlebars.templates.content_type;
2189     };
2190
2191     return ContentTypeView;
2192
2193   })(Backbone.View);
2194
2195   ResponseContentTypeView = (function(_super) {
2196     __extends(ResponseContentTypeView, _super);
2197
2198     function ResponseContentTypeView() {
2199       _ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments);
2200       return _ref9;
2201     }
2202
2203     ResponseContentTypeView.prototype.initialize = function() {};
2204
2205     ResponseContentTypeView.prototype.render = function() {
2206       var template;
2207       template = this.template();
2208       $(this.el).html(template(this.model));
2209       $('label[for=responseContentType]', $(this.el)).text('Response Content Type');
2210       return this;
2211     };
2212
2213     ResponseContentTypeView.prototype.template = function() {
2214       return Handlebars.templates.response_content_type;
2215     };
2216
2217     return ResponseContentTypeView;
2218
2219   })(Backbone.View);
2220
2221   ParameterContentTypeView = (function(_super) {
2222     __extends(ParameterContentTypeView, _super);
2223
2224     function ParameterContentTypeView() {
2225       _ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments);
2226       return _ref10;
2227     }
2228
2229     ParameterContentTypeView.prototype.initialize = function() {};
2230
2231     ParameterContentTypeView.prototype.render = function() {
2232       var template;
2233       template = this.template();
2234       $(this.el).html(template(this.model));
2235       $('label[for=parameterContentType]', $(this.el)).text('Parameter content type:');
2236       return this;
2237     };
2238
2239     ParameterContentTypeView.prototype.template = function() {
2240       return Handlebars.templates.parameter_content_type;
2241     };
2242
2243     return ParameterContentTypeView;
2244
2245   })(Backbone.View);
2246
2247 }).call(this);