nucleus 0.1.0

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