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