diff --git a/.idea/dictionaries/richter.xml b/.idea/dictionaries/richter.xml new file mode 100644 index 0000000000..9a7ca3ec4a --- /dev/null +++ b/.idea/dictionaries/richter.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000000..4e5d7279a0 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/jsLinters/jslint.xml b/.idea/jsLinters/jslint.xml new file mode 100644 index 0000000000..7eaed2c8a1 --- /dev/null +++ b/.idea/jsLinters/jslint.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/.idea/libraries/arangodb.xml b/.idea/libraries/arangodb.xml new file mode 100644 index 0000000000..8da9d73f67 --- /dev/null +++ b/.idea/libraries/arangodb.xml @@ -0,0 +1,485 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/admin/js/lib/swagger-ui.js b/html/admin/js/lib/swagger-ui.js index 6e2e9d4e39..b7ffb03e7d 100644 --- a/html/admin/js/lib/swagger-ui.js +++ b/html/admin/js/lib/swagger-ui.js @@ -948,19 +948,18 @@ function program12(depth0,data) { -//@ sourceMappingURL=_swagger-ui.map -// Generated by CoffeeScript 1.6.1 +// Generated by CoffeeScript 1.6.3 (function() { - var ContentTypeView, HeaderView, MainView, OperationView, ParameterView, ResourceView, SignatureView, StatusCodeView, SwaggerUi, + var ContentTypeView, HeaderView, MainView, OperationView, ParameterView, ResourceView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, __hasProp = {}.hasOwnProperty, __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; }; SwaggerUi = (function(_super) { - __extends(SwaggerUi, _super); function SwaggerUi() { - return SwaggerUi.__super__.constructor.apply(this, arguments); + _ref = SwaggerUi.__super__.constructor.apply(this, arguments); + return _ref; } SwaggerUi.prototype.dom_id = "swagger_ui"; @@ -1010,9 +1009,9 @@ function program12(depth0,data) { }; SwaggerUi.prototype.load = function() { - var _ref; - if ((_ref = this.mainView) != null) { - _ref.clear(); + var _ref1; + if ((_ref1 = this.mainView) != null) { + _ref1.clear(); } this.headerView.update(this.options.discoveryUrl, this.options.apiKey); return this.api = new SwaggerApi(this.options); @@ -1071,11 +1070,11 @@ function program12(depth0,data) { window.SwaggerUi = SwaggerUi; HeaderView = (function(_super) { - __extends(HeaderView, _super); function HeaderView() { - return HeaderView.__super__.constructor.apply(this, arguments); + _ref1 = HeaderView.__super__.constructor.apply(this, arguments); + return _ref1; } HeaderView.prototype.events = { @@ -1137,21 +1136,21 @@ function program12(depth0,data) { })(Backbone.View); MainView = (function(_super) { - __extends(MainView, _super); function MainView() { - return MainView.__super__.constructor.apply(this, arguments); + _ref2 = MainView.__super__.constructor.apply(this, arguments); + return _ref2; } MainView.prototype.initialize = function() {}; MainView.prototype.render = function() { - var resource, _i, _len, _ref; + var resource, _i, _len, _ref3; $(this.el).html(Handlebars.templates.main(this.model)); - _ref = this.model.apisArray; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - resource = _ref[_i]; + _ref3 = this.model.apisArray; + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + resource = _ref3[_i]; this.addResource(resource); } return this; @@ -1177,22 +1176,22 @@ function program12(depth0,data) { })(Backbone.View); ResourceView = (function(_super) { - __extends(ResourceView, _super); function ResourceView() { - return ResourceView.__super__.constructor.apply(this, arguments); + _ref3 = ResourceView.__super__.constructor.apply(this, arguments); + return _ref3; } ResourceView.prototype.initialize = function() {}; ResourceView.prototype.render = function() { - var operation, _i, _len, _ref; + var operation, _i, _len, _ref4; $(this.el).html(Handlebars.templates.resource(this.model)); this.number = 0; - _ref = this.model.operationsArray; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - operation = _ref[_i]; + _ref4 = this.model.operationsArray; + for (_i = 0, _len = _ref4.length; _i < _len; _i++) { + operation = _ref4[_i]; this.addOperation(operation); } return this; @@ -1215,11 +1214,11 @@ function program12(depth0,data) { })(Backbone.View); OperationView = (function(_super) { - __extends(OperationView, _super); function OperationView() { - return OperationView.__super__.constructor.apply(this, arguments); + _ref4 = OperationView.__super__.constructor.apply(this, arguments); + return _ref4; } OperationView.prototype.events = { @@ -1233,7 +1232,7 @@ function program12(depth0,data) { OperationView.prototype.initialize = function() {}; OperationView.prototype.render = function() { - var contentTypeModel, contentTypeView, isMethodSubmissionSupported, param, responseSignatureView, signatureModel, statusCode, _i, _j, _len, _len1, _ref, _ref1; + var contentTypeModel, contentTypeView, isMethodSubmissionSupported, param, responseSignatureView, signatureModel, statusCode, _i, _j, _len, _len1, _ref5, _ref6; isMethodSubmissionSupported = jQuery.inArray(this.model.httpMethod, this.model.supportedSubmitMethods()) >= 0; if (!isMethodSubmissionSupported) { this.model.isReadOnly = true; @@ -1266,14 +1265,14 @@ function program12(depth0,data) { model: contentTypeModel }); $('.content-type', $(this.el)).append(contentTypeView.render().el); - _ref = this.model.parameters; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - param = _ref[_i]; + _ref5 = this.model.parameters; + for (_i = 0, _len = _ref5.length; _i < _len; _i++) { + param = _ref5[_i]; this.addParameter(param); } - _ref1 = this.model.errorResponses; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - statusCode = _ref1[_j]; + _ref6 = this.model.errorResponses; + for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { + statusCode = _ref6[_j]; this.addStatusCode(statusCode); } return this; @@ -1299,7 +1298,7 @@ function program12(depth0,data) { }; OperationView.prototype.submitOperation = function(e) { - var bodyParam, consumes, error_free, form, headerParams, invocationUrl, isFileUpload, isFormPost, map, o, obj, param, paramContentTypeField, responseContentTypeField, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4, + var bodyParam, consumes, error_free, form, headerParams, invocationUrl, isFileUpload, isFormPost, map, o, obj, param, paramContentTypeField, responseContentTypeField, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref5, _ref6, _ref7, _ref8, _ref9, _this = this; if (e != null) { e.preventDefault(); @@ -1321,9 +1320,9 @@ function program12(depth0,data) { }); if (error_free) { map = {}; - _ref = form.serializeArray(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - o = _ref[_i]; + _ref5 = form.serializeArray(); + for (_i = 0, _len = _ref5.length; _i < _len; _i++) { + o = _ref5[_i]; if ((o.value != null) && jQuery.trim(o.value).length > 0) { map[o.name] = o.value; } @@ -1334,9 +1333,9 @@ function program12(depth0,data) { if (this.model.consumes && this.model.consumes.length > 0) { consumes = this.model.consumes[0]; } else { - _ref1 = this.model.parameters; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - o = _ref1[_j]; + _ref6 = this.model.parameters; + for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { + o = _ref6[_j]; if (o.paramType === 'form') { isFormPost = true; consumes = false; @@ -1350,9 +1349,9 @@ function program12(depth0,data) { } if (isFileUpload) { bodyParam = new FormData(); - _ref2 = this.model.parameters; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - param = _ref2[_k]; + _ref7 = this.model.parameters; + for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { + param = _ref7[_k]; if (param.paramType === 'body' && param.name !== 'file') { bodyParam.append(param.name, map[param.name]); } @@ -1363,16 +1362,16 @@ function program12(depth0,data) { console.log(bodyParam); } else if (isFormPost) { bodyParam = new FormData(); - _ref3 = this.model.parameters; - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - param = _ref3[_l]; + _ref8 = this.model.parameters; + for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) { + param = _ref8[_l]; bodyParam.append(param.name, map[param.name]); } } else { bodyParam = null; - _ref4 = this.model.parameters; - for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { - param = _ref4[_m]; + _ref9 = this.model.parameters; + for (_m = 0, _len4 = _ref9.length; _m < _len4; _m++) { + param = _ref9[_m]; if (param.paramType === 'body') { bodyParam = map[param.name]; } @@ -1505,9 +1504,9 @@ function program12(depth0,data) { padding = ''; indent += transitions[fromTo]; padding = ((function() { - var _j, _ref, _results; + var _j, _ref5, _results; _results = []; - for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) { + for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) { _results.push(' '); } return _results; @@ -1526,11 +1525,12 @@ function program12(depth0,data) { }; OperationView.prototype.showStatus = function(data) { - var code, pre, response_body; + var code, error, pre, response_body; try { code = $('').text(JSON.stringify(JSON.parse(data.responseText), null, 2)); pre = $('
').append(code);
-      } catch (error) {
+      } catch (_error) {
+        error = _error;
         code = $('').text(this.formatXml(data.responseText));
         pre = $('
').append(code);
       }
@@ -1559,11 +1559,11 @@ function program12(depth0,data) {
   })(Backbone.View);
 
   StatusCodeView = (function(_super) {
-
     __extends(StatusCodeView, _super);
 
     function StatusCodeView() {
-      return StatusCodeView.__super__.constructor.apply(this, arguments);
+      _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
+      return _ref5;
     }
 
     StatusCodeView.prototype.initialize = function() {};
@@ -1584,11 +1584,11 @@ function program12(depth0,data) {
   })(Backbone.View);
 
   ParameterView = (function(_super) {
-
     __extends(ParameterView, _super);
 
     function ParameterView() {
-      return ParameterView.__super__.constructor.apply(this, arguments);
+      _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
+      return _ref6;
     }
 
     ParameterView.prototype.initialize = function() {};
@@ -1658,11 +1658,11 @@ function program12(depth0,data) {
   })(Backbone.View);
 
   SignatureView = (function(_super) {
-
     __extends(SignatureView, _super);
 
     function SignatureView() {
-      return SignatureView.__super__.constructor.apply(this, arguments);
+      _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
+      return _ref7;
     }
 
     SignatureView.prototype.events = {
@@ -1727,11 +1727,11 @@ function program12(depth0,data) {
   })(Backbone.View);
 
   ContentTypeView = (function(_super) {
-
     __extends(ContentTypeView, _super);
 
     function ContentTypeView() {
-      return ContentTypeView.__super__.constructor.apply(this, arguments);
+      _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
+      return _ref8;
     }
 
     ContentTypeView.prototype.initialize = function() {};
diff --git a/html/admin/js/lib/swagger-ui.min.js b/html/admin/js/lib/swagger-ui.min.js
index 470da55a58..d1533a7e25 100644
--- a/html/admin/js/lib/swagger-ui.min.js
+++ b/html/admin/js/lib/swagger-ui.min.js
@@ -1 +1 @@
-$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}function log(){if(window.console){console.log.apply(console,arguments)}}if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;k=k||{};var i="",d,h="function",j=this.escapeExpression,n=this;function e(r,q){var o="",p;o+="\n        \n    ";return o}function c(r,q){var o="",p;o+="\n        ";if(p=f.defaultValue){p=p.call(r,{hash:{},data:q})}else{p=r.defaultValue;p=typeof p===h?p.apply(r):p}o+=j(p)+"\n    ";return o}i+="";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"\n\n    ";d=f["if"].call(m,m.isBody,{hash:{},inverse:n.program(3,c,k),fn:n.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n\n";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='\n\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[2,">= 1.0.0-rc.3"];o=o||f.helpers;u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n		";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n	";return w}function l(z,y){var w="",x;w+='\n			\n		";return w}function k(z,y){var w="",x;w+="\n			";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n		";return w}function i(z,y){var w="",x;w+="\n				\n			";return w}function h(z,y){var w="",x;w+="\n				\n				
\n
\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n \n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n \n ";return w}function r(z,y){var w="",x;w+="\n \n ";return w}p+="";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n\n\n ";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='\n\n\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(f,g,d,c,e){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||f.helpers;e=e||{};return"\n
\n
    \n
\n
\n"})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='
\n\n
\n\n
\n
\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n
\n\n
\n
';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'
\n \n
\n
\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"\n";if(c=d.reason){c=c.call(k,{hash:{},data:i})}else{c=k.reason;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="\n\n";return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;k=k||{};var i="",d,h="function",j=this.escapeExpression,n=this;function e(r,q){var o="",p;o+="\n \n ";return o}function c(r,q){var o="",p;o+="\n ";if(p=f.defaultValue){p=p.call(r,{hash:{},data:q})}else{p=r.defaultValue;p=typeof p===h?p.apply(r):p}o+=j(p)+"\n ";return o}i+="";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"\n\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:n.program(3,c,k),fn:n.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n\n";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='\n\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n \n ";return o}function n(p,o){return'\n \n'}i+='\n\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="\n\n";return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(h,n,g,m,l){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||h.helpers;l=l||{};var j="",d,i="function",k=this.escapeExpression,r=this;function f(w,v){var t="",u;t+="\n

Implementation Notes hide

\n
\n

";if(u=g.notes){u=u.call(w,{hash:{},data:v})}else{u=w.notes;u=typeof u===i?u.apply(w):u}if(u||u===0){t+=u}t+="

\n
\n ";return t}function c(w,v){var t="",u;t+="\n

Examples show

\n \n ";return t}function q(u,t){return'\n

Response Class

\n

\n
\n
\n '}function p(u,t){return'\n

Parameters

\n \n \n \n \n \n \n \n \n \n \n\n \n
ParameterValueDescriptionData Type
\n '}function o(u,t){return"\n
\n

Status Codes

\n \n \n \n \n \n \n \n \n \n \n
HTTP Status CodeReason
\n "}function e(u,t){return"\n "}function s(u,t){return"\n
\n \n \n \n
\n "}j+="\n \n";return j})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(g,r,p,k,t){this.compilerInfo=[2,">= 1.0.0-rc.3"];p=p||g.helpers;t=t||{};var q="",i,e,o=this,d="function",c=this.escapeExpression;function n(v,u){return"\n "}function m(x,w){var u="",v;u+="\n ";v=p["if"].call(x,x.defaultValue,{hash:{},inverse:o.program(6,j,w),fn:o.program(4,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(v,u){return"\n "}function j(v,u){return"\n \n "}function h(x,w){var u="",v;u+="\n ";v=p["if"].call(x,x.isDefault,{hash:{},inverse:o.program(11,s,w),fn:o.program(9,f,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function f(x,w){var u="",v;u+="\n \n ";return u}function s(x,w){var u="",v;u+="\n \n ";return u}q+="";if(i=p.name){i=i.call(r,{hash:{},data:t})}else{i=r.name;i=typeof i===d?i.apply(r):i}q+=c(i)+"\n\n \n\n";if(e=p.description){e=e.call(r,{hash:{},data:t})}else{e=r.description;e=typeof e===d?e.apply(r):e}if(e||e===0){q+=e}q+='\n\n';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,s){this.compilerInfo=[2,">= 1.0.0-rc.3"];o=o||f.helpers;s=s||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.isFile,{hash:{},inverse:n.program(4,k,w),fn:n.program(2,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(x,w){var u="",v;u+='\n \n ";return u}function k(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(7,h,w),fn:n.program(5,i,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function i(x,w){var u="",v;u+="\n \n ";return u}function h(x,w){var u="",v;u+="\n \n
\n
\n ';return u}function e(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(12,r,w),fn:n.program(10,t,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function t(x,w){var u="",v;u+="\n \n ";return u}function r(x,w){var u="",v;u+="\n \n ";return u}p+="";if(g=o.name){g=g.call(q,{hash:{},data:s})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"\n\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,s),fn:n.program(1,m,s),data:s});if(g||g===0){p+=g}p+="\n\n\n";if(g=o.description){g=g.call(q,{hash:{},data:s})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='\n\n \n\n\n';return p})})();(function(){var f,b,h,c,e,j,k,i,a,g={}.hasOwnProperty,d=function(o,m){for(var l in m){if(g.call(m,l)){o[l]=m[l]}}function n(){this.constructor=o}n.prototype=m.prototype;o.prototype=new n();o.__super__=m.prototype;return o};a=(function(m){d(l,m);function l(){return l.__super__.constructor.apply(this,arguments)}l.prototype.dom_id="swagger_ui";l.prototype.options=null;l.prototype.api=null;l.prototype.headerView=null;l.prototype.mainView=null;l.prototype.initialize=function(n){var o=this;if(n==null){n={}}if(n.dom_id!=null){this.dom_id=n.dom_id;delete n.dom_id}if($("#"+this.dom_id)==null){$("body").append('
')}this.options=n;this.options.success=function(){return o.render()};this.options.progress=function(p){return o.showMessage(p)};this.options.failure=function(p){return o.onLoadFailure(p)};this.headerView=new b({el:$("#header")});return this.headerView.on("update-swagger-ui",function(p){return o.updateSwaggerUi(p)})};l.prototype.updateSwaggerUi=function(n){this.options.discoveryUrl=n.discoveryUrl;this.options.apiKey=n.apiKey;return this.load()};l.prototype.load=function(){var n;if((n=this.mainView)!=null){n.clear()}this.headerView.update(this.options.discoveryUrl,this.options.apiKey);return this.api=new SwaggerApi(this.options)};l.prototype.render=function(){var n=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new h({model:this.api,el:$("#"+this.dom_id)}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};l.prototype.showMessage=function(n){if(n==null){n=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(n)};l.prototype.onLoadFailure=function(n){var o;if(n==null){n=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");o=$("#message-bar").html(n);if(this.options.onFailure!=null){this.options.onFailure(n)}return o};return l})(Backbone.Router);window.SwaggerUi=a;b=(function(m){d(l,m);function l(){return l.__super__.constructor.apply(this,arguments)}l.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};l.prototype.initialize=function(){};l.prototype.showPetStore=function(n){return this.trigger("update-swagger-ui",{discoveryUrl:"http://petstore.swagger.wordnik.com/api/api-docs.json",apiKey:"special-key"})};l.prototype.showWordnikDev=function(n){return this.trigger("update-swagger-ui",{discoveryUrl:"http://api.wordnik.com/v4/resources.json",apiKey:""})};l.prototype.showCustomOnKeyup=function(n){if(n.keyCode===13){return this.showCustom()}};l.prototype.showCustom=function(n){if(n!=null){n.preventDefault()}return this.trigger("update-swagger-ui",{discoveryUrl:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};l.prototype.update=function(o,p,n){if(n==null){n=false}$("#input_baseUrl").val(o);$("#input_apiKey").val(p);if(n){return this.trigger("update-swagger-ui",{discoveryUrl:o,apiKey:p})}};return l})(Backbone.View);h=(function(l){d(m,l);function m(){return m.__super__.constructor.apply(this,arguments)}m.prototype.initialize=function(){};m.prototype.render=function(){var q,p,n,o;$(this.el).html(Handlebars.templates.main(this.model));o=this.model.apisArray;for(p=0,n=o.length;p=0;if(!y){this.model.isReadOnly=true}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){z={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};u=new k({model:z,tagName:"div"});$(".model-signature",$(this.el)).append(u.render().el)}else{$(".model-signature",$(this.el)).html(this.model.responseClass)}n={isParam:false};if(this.model.supportedContentTypes){n.produces=this.model.supportedContentTypes}if(this.model.produces){n.produces=this.model.produces}x=new f({model:n});$(".content-type",$(this.el)).append(x.render().el);t=this.model.parameters;for(s=0,w=t.length;s0){Q[H.name]=H.value}}P=v.children().find('input[type~="file"]').size()!==0;J=false;L="application/json";if(this.model.consumes&&this.model.consumes.length>0){L=this.model.consumes[0]}else{z=this.model.parameters;for(u=0,S=z.length;u"+A+"
");$(".response_throbber",$(this.el)).show();D={type:this.model.httpMethod,url:A,headers:q,data:F,contentType:L,dataType:"json",processData:false,error:function(T,U,o){return I.showErrorStatus(T,U,o)},success:function(o){return I.showResponse(o)},complete:function(o){return I.showCompleteStatus(o)}};G=$("td select[name=contentType]",$(this.el)).val();if(G){D.contentType=G}s=$(".content > .content-type > div > select[name=contentType]",$(this.el)).val();if(s){D.headers=D.headers!=null?D.headers:{};D.headers.accept=s}jQuery.ajax(D);return false}};l.prototype.hideResponse=function(n){if(n!=null){n.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};l.prototype.toggleText=function(o){var n;if(o!=null){o.preventDefault()}n=this.$(o.target);if(n.html()==="show"){n.html("hide")}else{n.html("show")}return n.parent().next("div").slideToggle()};l.prototype.showResponse=function(n){var o;o=JSON.stringify(n,null,"\t").replace(/\n/g,"
");return $(".response_body",$(this.el)).html(escape(o))};l.prototype.showErrorStatus=function(n){return this.showStatus(n)};l.prototype.showCompleteStatus=function(n){return this.showStatus(n)};l.prototype.formatXml=function(u){var q,t,o,v,A,w,p,n,y,z,s,r,x;n=/(>)(<)(\/*)/g;z=/[ ]*(.*)[ ]+\n/g;q=/(<.+>)(.+\n)/g;u=u.replace(n,"$1\n$2$3").replace(z,"$1\n").replace(q,"$1\n$2");p=0;t="";A=u.split("\n");o=0;v="other";y={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};s=function(G){var C,B,E,I,F,D,H;D={single:Boolean(G.match(/<.+\/>/)),closing:Boolean(G.match(/<\/.+>/)),opening:Boolean(G.match(/<[^!?].*>/))};F=((function(){var J;J=[];for(E in D){H=D[E];if(H){J.push(E)}}return J})())[0];F=F===void 0?"other":F;C=v+"->"+F;v=F;I="";o+=y[C];I=((function(){var K,L,J;J=[];for(B=K=0,L=o;0<=L?KL;B=0<=L?++K:--K){J.push(" ")}return J})()).join("");if(C==="opening->closing"){return t=t.substr(0,t.length-1)+G+"\n"}else{return t+=I+G+"\n"}};for(r=0,x=A.length;r").text(JSON.stringify(JSON.parse(q.responseText),null,2));r=$('
').append(p)}catch(n){p=$("").text(this.formatXml(q.responseText));r=$('
').append(p)}o=r;$(".response_code",$(this.el)).html("
"+q.status+"
");$(".response_body",$(this.el)).html(o);$(".response_headers",$(this.el)).html("
"+q.getAllResponseHeaders()+"
");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};l.prototype.toggleOperationContent=function(){var n;n=$("#"+Docs.escapeResourceName(this.model.resourceName)+"_"+this.model.nickname+"_"+this.model.httpMethod+"_"+this.model.number+"_content");if(n.is(":visible")){return Docs.collapseOperation(n)}else{return Docs.expandOperation(n)}};return l})(Backbone.View);i=(function(m){d(l,m);function l(){return l.__super__.constructor.apply(this,arguments)}l.prototype.initialize=function(){};l.prototype.render=function(){var n;n=this.template();$(this.el).html(n(this.model));return this};l.prototype.template=function(){return Handlebars.templates.status_code};return l})(Backbone.View);e=(function(m){d(l,m);function l(){return l.__super__.constructor.apply(this,arguments)}l.prototype.initialize=function(){};l.prototype.render=function(){var q,o,n,r,p;if(this.model.paramType==="body"){this.model.isBody=true}if(this.model.dataType==="file"){this.model.isFile=true}p=this.template();$(this.el).html(p(this.model));n={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){r=new k({model:n,tagName:"div"});$(".model-signature",$(this.el)).append(r.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}q={isParam:false};if(this.model.supportedContentTypes){q.produces=this.model.supportedContentTypes}if(this.model.produces){q.produces=this.model.produces}o=new f({model:q});$(".content-type",$(this.el)).append(o.render().el);return this};l.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return l})(Backbone.View);k=(function(m){d(l,m);function l(){return l.__super__.constructor.apply(this,arguments)}l.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};l.prototype.initialize=function(){};l.prototype.render=function(){var n;n=this.template();$(this.el).html(n(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};l.prototype.template=function(){return Handlebars.templates.signature};l.prototype.switchToDescription=function(n){if(n!=null){n.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};l.prototype.switchToSnippet=function(n){if(n!=null){n.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};l.prototype.snippetToTextArea=function(n){var o;if(this.isParam){if(n!=null){n.preventDefault()}o=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(o.val())===""){return o.val(this.model.sampleJSON)}}};return l})(Backbone.View);f=(function(l){d(m,l);function m(){return m.__super__.constructor.apply(this,arguments)}m.prototype.initialize=function(){};m.prototype.render=function(){var n;n=this.template();$(this.el).html(n(this.model));this.isParam=this.model.isParam;if(this.isParam){$("label[for=contentType]",$(this.el)).text("Parameter content type:")}else{$("label[for=contentType]",$(this.el)).text("Response Content Type")}return this};m.prototype.template=function(){return Handlebars.templates.content_type};return m})(Backbone.View)}).call(this); \ No newline at end of file +$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}function log(){if(window.console){console.log.apply(console,arguments)}}if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;k=k||{};var i="",d,h="function",j=this.escapeExpression,n=this;function e(r,q){var o="",p;o+="\n \n ";return o}function c(r,q){var o="",p;o+="\n ";if(p=f.defaultValue){p=p.call(r,{hash:{},data:q})}else{p=r.defaultValue;p=typeof p===h?p.apply(r):p}o+=j(p)+"\n ";return o}i+="";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"\n\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:n.program(3,c,k),fn:n.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n\n";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='\n\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[2,">= 1.0.0-rc.3"];o=o||f.helpers;u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function l(z,y){var w="",x;w+='\n \n ";return w}function k(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function i(z,y){var w="",x;w+="\n \n ";return w}function h(z,y){var w="",x;w+="\n \n
\n
\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n \n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n \n ";return w}function r(z,y){var w="",x;w+="\n \n ";return w}p+="";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n\n\n ";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='\n\n\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(f,g,d,c,e){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||f.helpers;e=e||{};return"\n
\n
    \n
\n
\n"})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='
\n\n
\n\n
\n
\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n
\n\n
\n
';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'
\n \n
\n
\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"\n";if(c=d.reason){c=c.call(k,{hash:{},data:i})}else{c=k.reason;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="\n\n";return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;k=k||{};var i="",d,h="function",j=this.escapeExpression,n=this;function e(r,q){var o="",p;o+="\n \n ";return o}function c(r,q){var o="",p;o+="\n ";if(p=f.defaultValue){p=p.call(r,{hash:{},data:q})}else{p=r.defaultValue;p=typeof p===h?p.apply(r):p}o+=j(p)+"\n ";return o}i+="";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"\n\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:n.program(3,c,k),fn:n.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n\n";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='\n\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||g.helpers;j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n \n ";return o}function n(p,o){return'\n \n'}i+='\n\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(e,k,d,j,i){this.compilerInfo=[2,">= 1.0.0-rc.3"];d=d||e.helpers;i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="\n\n";return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(h,n,g,m,l){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||h.helpers;l=l||{};var j="",d,i="function",k=this.escapeExpression,r=this;function f(w,v){var t="",u;t+="\n

Implementation Notes hide

\n
\n

";if(u=g.notes){u=u.call(w,{hash:{},data:v})}else{u=w.notes;u=typeof u===i?u.apply(w):u}if(u||u===0){t+=u}t+="

\n
\n ";return t}function c(w,v){var t="",u;t+="\n

Examples show

\n \n ";return t}function q(u,t){return'\n

Response Class

\n

\n
\n
\n '}function p(u,t){return'\n

Parameters

\n \n \n \n \n \n \n \n \n \n \n\n \n
ParameterValueDescriptionData Type
\n '}function o(u,t){return"\n
\n

Status Codes

\n \n \n \n \n \n \n \n \n \n \n
HTTP Status CodeReason
\n "}function e(u,t){return"\n "}function s(u,t){return"\n
\n \n \n \n
\n "}j+="\n \n";return j})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(g,r,p,k,t){this.compilerInfo=[2,">= 1.0.0-rc.3"];p=p||g.helpers;t=t||{};var q="",i,e,o=this,d="function",c=this.escapeExpression;function n(v,u){return"\n "}function m(x,w){var u="",v;u+="\n ";v=p["if"].call(x,x.defaultValue,{hash:{},inverse:o.program(6,j,w),fn:o.program(4,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(v,u){return"\n "}function j(v,u){return"\n \n "}function h(x,w){var u="",v;u+="\n ";v=p["if"].call(x,x.isDefault,{hash:{},inverse:o.program(11,s,w),fn:o.program(9,f,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function f(x,w){var u="",v;u+="\n \n ";return u}function s(x,w){var u="",v;u+="\n \n ";return u}q+="";if(i=p.name){i=i.call(r,{hash:{},data:t})}else{i=r.name;i=typeof i===d?i.apply(r):i}q+=c(i)+"\n\n \n\n";if(e=p.description){e=e.call(r,{hash:{},data:t})}else{e=r.description;e=typeof e===d?e.apply(r):e}if(e||e===0){q+=e}q+='\n\n';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,s){this.compilerInfo=[2,">= 1.0.0-rc.3"];o=o||f.helpers;s=s||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.isFile,{hash:{},inverse:n.program(4,k,w),fn:n.program(2,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(x,w){var u="",v;u+='\n \n ";return u}function k(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(7,h,w),fn:n.program(5,i,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function i(x,w){var u="",v;u+="\n \n ";return u}function h(x,w){var u="",v;u+="\n \n
\n
\n ';return u}function e(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(12,r,w),fn:n.program(10,t,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function t(x,w){var u="",v;u+="\n \n ";return u}function r(x,w){var u="",v;u+="\n \n ";return u}p+="";if(g=o.name){g=g.call(q,{hash:{},data:s})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"\n\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,s),fn:n.program(1,m,s),data:s});if(g||g===0){p+=g}p+="\n\n\n";if(g=o.description){g=g.call(q,{hash:{},data:s})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='\n\n \n\n\n';return p})})();(function(){var i,o,r,l,j,k,h,m,p,n,g,f,e,d,c,b,a,t,q={}.hasOwnProperty,s=function(x,v){for(var u in v){if(q.call(v,u)){x[u]=v[u]}}function w(){this.constructor=x}w.prototype=v.prototype;x.prototype=new w();x.__super__=v.prototype;return x};p=(function(v){s(u,v);function u(){n=u.__super__.constructor.apply(this,arguments);return n}u.prototype.dom_id="swagger_ui";u.prototype.options=null;u.prototype.api=null;u.prototype.headerView=null;u.prototype.mainView=null;u.prototype.initialize=function(w){var x=this;if(w==null){w={}}if(w.dom_id!=null){this.dom_id=w.dom_id;delete w.dom_id}if($("#"+this.dom_id)==null){$("body").append('
')}this.options=w;this.options.success=function(){return x.render()};this.options.progress=function(y){return x.showMessage(y)};this.options.failure=function(y){return x.onLoadFailure(y)};this.headerView=new o({el:$("#header")});return this.headerView.on("update-swagger-ui",function(y){return x.updateSwaggerUi(y)})};u.prototype.updateSwaggerUi=function(w){this.options.discoveryUrl=w.discoveryUrl;this.options.apiKey=w.apiKey;return this.load()};u.prototype.load=function(){var w;if((w=this.mainView)!=null){w.clear()}this.headerView.update(this.options.discoveryUrl,this.options.apiKey);return this.api=new SwaggerApi(this.options)};u.prototype.render=function(){var w=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new r({model:this.api,el:$("#"+this.dom_id)}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};u.prototype.showMessage=function(w){if(w==null){w=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(w)};u.prototype.onLoadFailure=function(w){var x;if(w==null){w=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");x=$("#message-bar").html(w);if(this.options.onFailure!=null){this.options.onFailure(w)}return x};return u})(Backbone.Router);window.SwaggerUi=p;o=(function(v){s(u,v);function u(){g=u.__super__.constructor.apply(this,arguments);return g}u.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};u.prototype.initialize=function(){};u.prototype.showPetStore=function(w){return this.trigger("update-swagger-ui",{discoveryUrl:"http://petstore.swagger.wordnik.com/api/api-docs.json",apiKey:"special-key"})};u.prototype.showWordnikDev=function(w){return this.trigger("update-swagger-ui",{discoveryUrl:"http://api.wordnik.com/v4/resources.json",apiKey:""})};u.prototype.showCustomOnKeyup=function(w){if(w.keyCode===13){return this.showCustom()}};u.prototype.showCustom=function(w){if(w!=null){w.preventDefault()}return this.trigger("update-swagger-ui",{discoveryUrl:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};u.prototype.update=function(x,y,w){if(w==null){w=false}$("#input_baseUrl").val(x);$("#input_apiKey").val(y);if(w){return this.trigger("update-swagger-ui",{discoveryUrl:x,apiKey:y})}};return u})(Backbone.View);r=(function(u){s(v,u);function v(){f=v.__super__.constructor.apply(this,arguments);return f}v.prototype.initialize=function(){};v.prototype.render=function(){var y,x,w,z;$(this.el).html(Handlebars.templates.main(this.model));z=this.model.apisArray;for(x=0,w=z.length;x=0;if(!H){this.model.isReadOnly=true}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){I={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};D=new h({model:I,tagName:"div"});$(".model-signature",$(this.el)).append(D.render().el)}else{$(".model-signature",$(this.el)).html(this.model.responseClass)}w={isParam:false};if(this.model.supportedContentTypes){w.produces=this.model.supportedContentTypes}if(this.model.produces){w.produces=this.model.produces}G=new i({model:w});$(".content-type",$(this.el)).append(G.render().el);z=this.model.parameters;for(C=0,F=z.length;C0){W[N.name]=N.value}}V=F.children().find('input[type~="file"]').size()!==0;P=false;R="application/json";if(this.model.consumes&&this.model.consumes.length>0){R=this.model.consumes[0]}else{y=this.model.parameters;for(E=0,Z=y.length;E"+H+"
");$(".response_throbber",$(this.el)).show();J={type:this.model.httpMethod,url:H,headers:A,data:L,contentType:R,dataType:"json",processData:false,error:function(ac,ad,ab){return O.showErrorStatus(ac,ad,ab)},success:function(ab){return O.showResponse(ab)},complete:function(ab){return O.showCompleteStatus(ab)}};M=$("td select[name=contentType]",$(this.el)).val();if(M){J.contentType=M}D=$(".content > .content-type > div > select[name=contentType]",$(this.el)).val();if(D){J.headers=J.headers!=null?J.headers:{};J.headers.accept=D}jQuery.ajax(J);return false}};u.prototype.hideResponse=function(w){if(w!=null){w.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};u.prototype.toggleText=function(x){var w;if(x!=null){x.preventDefault()}w=this.$(x.target);if(w.html()==="show"){w.html("hide")}else{w.html("show")}return w.parent().next("div").slideToggle()};u.prototype.showResponse=function(w){var x;x=JSON.stringify(w,null,"\t").replace(/\n/g,"
");return $(".response_body",$(this.el)).html(escape(x))};u.prototype.showErrorStatus=function(w){return this.showStatus(w)};u.prototype.showCompleteStatus=function(w){return this.showStatus(w)};u.prototype.formatXml=function(D){var z,C,x,E,J,F,y,w,H,I,B,A,G;w=/(>)(<)(\/*)/g;I=/[ ]*(.*)[ ]+\n/g;z=/(<.+>)(.+\n)/g;D=D.replace(w,"$1\n$2$3").replace(I,"$1\n").replace(z,"$1\n$2");y=0;C="";J=D.split("\n");x=0;E="other";H={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};B=function(P){var L,K,N,R,O,M,Q;M={single:Boolean(P.match(/<.+\/>/)),closing:Boolean(P.match(/<\/.+>/)),opening:Boolean(P.match(/<[^!?].*>/))};O=((function(){var S;S=[];for(N in M){Q=M[N];if(Q){S.push(N)}}return S})())[0];O=O===void 0?"other":O;L=E+"->"+O;E=O;R="";x+=H[L];R=((function(){var T,U,S;S=[];for(K=T=0,U=x;0<=U?TU;K=0<=U?++T:--T){S.push(" ")}return S})()).join("");if(L==="opening->closing"){return C=C.substr(0,C.length-1)+P+"\n"}else{return C+=R+P+"\n"}};for(A=0,G=J.length;A").text(JSON.stringify(JSON.parse(z.responseText),null,2));A=$('
').append(y)}catch(B){x=B;y=$("").text(this.formatXml(z.responseText));A=$('
').append(y)}w=A;$(".response_code",$(this.el)).html("
"+z.status+"
");$(".response_body",$(this.el)).html(w);$(".response_headers",$(this.el)).html("
"+z.getAllResponseHeaders()+"
");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};u.prototype.toggleOperationContent=function(){var w;w=$("#"+Docs.escapeResourceName(this.model.resourceName)+"_"+this.model.nickname+"_"+this.model.httpMethod+"_"+this.model.number+"_content");if(w.is(":visible")){return Docs.collapseOperation(w)}else{return Docs.expandOperation(w)}};return u})(Backbone.View);m=(function(v){s(u,v);function u(){c=u.__super__.constructor.apply(this,arguments);return c}u.prototype.initialize=function(){};u.prototype.render=function(){var w;w=this.template();$(this.el).html(w(this.model));return this};u.prototype.template=function(){return Handlebars.templates.status_code};return u})(Backbone.View);j=(function(v){s(u,v);function u(){b=u.__super__.constructor.apply(this,arguments);return b}u.prototype.initialize=function(){};u.prototype.render=function(){var z,x,w,A,y;if(this.model.paramType==="body"){this.model.isBody=true}if(this.model.dataType==="file"){this.model.isFile=true}y=this.template();$(this.el).html(y(this.model));w={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){A=new h({model:w,tagName:"div"});$(".model-signature",$(this.el)).append(A.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}z={isParam:false};if(this.model.supportedContentTypes){z.produces=this.model.supportedContentTypes}if(this.model.produces){z.produces=this.model.produces}x=new i({model:z});$(".content-type",$(this.el)).append(x.render().el);return this};u.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return u})(Backbone.View);h=(function(v){s(u,v);function u(){a=u.__super__.constructor.apply(this,arguments);return a}u.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};u.prototype.initialize=function(){};u.prototype.render=function(){var w;w=this.template();$(this.el).html(w(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};u.prototype.template=function(){return Handlebars.templates.signature};u.prototype.switchToDescription=function(w){if(w!=null){w.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};u.prototype.switchToSnippet=function(w){if(w!=null){w.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};u.prototype.snippetToTextArea=function(w){var x;if(this.isParam){if(w!=null){w.preventDefault()}x=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(x.val())===""){return x.val(this.model.sampleJSON)}}};return u})(Backbone.View);i=(function(u){s(v,u);function v(){t=v.__super__.constructor.apply(this,arguments);return t}v.prototype.initialize=function(){};v.prototype.render=function(){var w;w=this.template();$(this.el).html(w(this.model));this.isParam=this.model.isParam;if(this.isParam){$("label[for=contentType]",$(this.el)).text("Parameter content type:")}else{$("label[for=contentType]",$(this.el)).text("Response Content Type")}return this};v.prototype.template=function(){return Handlebars.templates.content_type};return v})(Backbone.View)}).call(this); \ No newline at end of file