Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

2234 linhas
107 KiB

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