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