insta_swag 0.1.1

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