swagger-ui_rails 0.0.1

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