add simple translation support

This commit is contained in:
Константин Калинин
2015-02-11 18:45:58 +03:00
parent 61a87b8fd7
commit 483fff8f32
5 changed files with 353 additions and 215 deletions

4
dist/index.html vendored
View File

@@ -16,6 +16,8 @@
<script src='lib/underscore-min.js' type='text/javascript'></script> <script src='lib/underscore-min.js' type='text/javascript'></script>
<script src='lib/backbone-min.js' type='text/javascript'></script> <script src='lib/backbone-min.js' type='text/javascript'></script>
<script src='lib/swagger-client.js' type='text/javascript'></script> <script src='lib/swagger-client.js' type='text/javascript'></script>
<script src='lang/translator.js' type='text/javascript'></script>
<script src='lang/en.js' type='text/javascript'></script>
<script src='swagger-ui.js' type='text/javascript'></script> <script src='swagger-ui.js' type='text/javascript'></script>
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script> <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
<script src='lib/marked.js' type='text/javascript'></script> <script src='lib/marked.js' type='text/javascript'></script>
@@ -35,6 +37,8 @@
dom_id: "swagger-ui-container", dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
onComplete: function(swaggerApi, swaggerUi){ onComplete: function(swaggerApi, swaggerUi){
SwaggerTranslator.translate();
if(typeof initOAuth == "function") { if(typeof initOAuth == "function") {
/* /*
initOAuth({ initOAuth({

38
dist/lang/en.js vendored Normal file
View File

@@ -0,0 +1,38 @@
SwaggerTranslator.learn({this._swaggerLang = {
"Warning: Deprecated":"Warning: Deprecated",
"Implementation Notes":"Implementation Notes",
"Response Class":"Response Class",
"Status":"Status",
"Parameters":"Parameters",
"Parameter":"Parameter",
"Value":"Value",
"Description":"Description",
"Parameter Type":"Parameter Type",
"Data Type":"Data Type",
"Response Messages":"Response Messages",
"HTTP Status Code":"HTTP Status Code",
"Reason":"Reason",
"Response Model":"Response Model",
"Request URL":"Request URL",
"Response Body":"Response Body",
"Response Code":"Response Code",
"Response Headers":"Response Headers",
"Hide Response":"Hide Response",
"Response Messages":"Response Messages",
"Try it out!":"Try it out!",
"Show/Hide":"Show/Hide",
"List Operations":"List Operations",
"Expand Operations":"Expand Operations",
"Raw":"Raw",
"can't parse JSON. Raw result":"can't parse JSON. Raw result",
"Model Schema":"Model Schema",
"Model":"Model",
"apply":"apply",
"Username":"Username",
"Password":"Password",
"Terms of service":"Terms of service",
"Created by":"Created by",
"See more at":"See more at",
"Contact the developer":"Contact the developer",
"api version":"api version",
});

37
dist/lang/ru.js vendored Normal file
View File

@@ -0,0 +1,37 @@
SwaggerTranslator.learn({
"Warning: Deprecated":"Ворнинг: Депрекейтед",
"Implementation Notes":"Заметки",
"Response Class":"Пример ответа",
"Status":"Статус",
"Parameters":"Параметры",
"Parameter":"Параметр",
"Value":"Значение",
"Description":"Описание",
"Parameter Type":"Тип параметра",
"Data Type":"Тип данных",
"HTTP Status Code":"HTTP код",
"Reason":"Причина",
"Response Model":"Структура ответа",
"Request URL":"URL запроса",
"Response Body":"Тело ответа",
"Response Code":"HTTP код ответа",
"Response Headers":"Заголовки ответа",
"Hide Response":"Спрятать ответ",
"Response Messages":"Что может прийти в ответ",
"Try it out!":"Попробовать!",
"Show/Hide":"Показать/Скрыть",
"List Operations":"Операции кратко",
"Expand Operations":"Операции подробно",
"Raw":"В сыром виде",
"can't parse JSON. Raw result":"Не удается распарсить ответ:",
"Model Schema":"Структура",
"Model":"Описание",
"apply":"применить",
"Username":"Имя пользователя",
"Password":"Пароль",
"Terms of service":"Условия использования",
"Created by":"Разработано",
"See more at":"Еще тут",
"Contact the developer":"Связаться с разработчиком",
"api version":"Версия API"
});

50
dist/lang/translator.js vendored Normal file
View File

@@ -0,0 +1,50 @@
/**
* Translator for documentation pages.
*
* To enable translation you should include one of language-files in your index.html
* after <script src='lang/translator.js' type='text/javascript'></script>.
* For example - <script src='lang/ru.js' type='text/javascript'></script>
*
* Then you should create a SwaggerUI object this way:
* new SwaggerUi({
* ....
* onComplete: function(swaggerApi, swaggerUi){
* SwaggerTranslator.translate();
* ....
* }
* })
* in your index.html.
*
* If you wish to translate some new texsts you should do two things:
* 1. Add new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
* 2. Mark that text it templates this way <anyHtmlTag data-swTarnslate>New Phrase</anyHtmlTag> or <anyHtmlTag data-swTarnslate value='New Phrase'/>.
* The main thing here is attribute data-swTarnslate. Only inner html and value-attribute are going to translate.
*
*/
SwaggerTranslator = {
_words:[],
translate: function() {
var $this = this;
$("[data-swTarnslate]").each(
function() {
$(this).html(
$this._tryTranslate($(this).html())
);
$(this).val(
$this._tryTranslate($(this).val())
);
}
)
},
_tryTranslate: function(word) {
return this._words[word] != undefined ? this._words[word] : word;
},
learn: function(wordsMap) {
this._words = wordsMap;
}
}

439
dist/swagger-ui.js vendored
View File

@@ -4,200 +4,207 @@
* @link http://swagger.io * @link http://swagger.io
* @license Apache 2.0 * @license Apache 2.0
*/ */
$(function() {
// ругается
// Helper function for vertically aligning DOM elements if (typeof marked === 'undefined') {
// http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/ marked = function(text) {
$.fn.vAlign = function() { return text;
return this.each(function(i){ }
var ah = $(this).height(); }
var ph = $(this).parent().height();
var mh = (ph - ah) / 2; $(function() {
$(this).css('margin-top', mh); // Helper function for vertically aligning DOM elements
}); // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
}; $.fn.vAlign = function() {
return this.each(function(i){
$.fn.stretchFormtasticInputWidthToParent = function() { var ah = $(this).height();
return this.each(function(i){ var ph = $(this).parent().height();
var p_width = $(this).closest("form").innerWidth(); var mh = (ph - ah) / 2;
var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10); $(this).css('margin-top', mh);
var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10); });
$(this).css('width', p_width - p_padding - this_padding); };
});
}; $.fn.stretchFormtasticInputWidthToParent = function() {
return this.each(function(i){
$('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent(); var p_width = $(this).closest("form").innerWidth();
var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10);
// Vertically center these paragraphs var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
// Parent may need a min-height for this to work.. $(this).css('width', p_width - p_padding - this_padding);
$('ul.downplayed li div.content p').vAlign(); });
};
// When a sandbox form is submitted..
$("form.sandbox").submit(function(){ $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
var error_free = true; // Vertically center these paragraphs
// Parent may need a min-height for this to work..
// Cycle through the forms required inputs $('ul.downplayed li div.content p').vAlign();
$(this).find("input.required").each(function() {
// When a sandbox form is submitted..
// Remove any existing error styles from the input $("form.sandbox").submit(function(){
$(this).removeClass('error');
var error_free = true;
// Tack the error style on if the input is empty..
if ($(this).val() == '') { // Cycle through the forms required inputs
$(this).addClass('error'); $(this).find("input.required").each(function() {
$(this).wiggle();
error_free = false; // Remove any existing error styles from the input
} $(this).removeClass('error');
}); // Tack the error style on if the input is empty..
if ($(this).val() == '') {
return error_free; $(this).addClass('error');
}); $(this).wiggle();
error_free = false;
}); }
function clippyCopiedCallback(a) { });
$('#api_key_copied').fadeIn().delay(1000).fadeOut();
return error_free;
// var b = $("#clippy_tooltip_" + a); });
// b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
// b.attr("title", "copy to clipboard") });
// },
// 500)) function clippyCopiedCallback(a) {
} $('#api_key_copied').fadeIn().delay(1000).fadeOut();
// Logging function that accounts for browsers that don't have window.console // var b = $("#clippy_tooltip_" + a);
log = function(){ // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
log.history = log.history || []; // b.attr("title", "copy to clipboard")
log.history.push(arguments); // },
if(this.console){ // 500))
console.log( Array.prototype.slice.call(arguments)[0] ); }
}
}; // Logging function that accounts for browsers that don't have window.console
log = function(){
// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913) log.history = log.history || [];
if (Function.prototype.bind && console && typeof console.log == "object") { log.history.push(arguments);
[ if(this.console){
"log","info","warn","error","assert","dir","clear","profile","profileEnd" console.log( Array.prototype.slice.call(arguments)[0] );
].forEach(function (method) { }
console[method] = this.bind(console[method], console); };
}, Function.prototype.call);
} // Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
if (Function.prototype.bind && console && typeof console.log == "object") {
var Docs = { [
"log","info","warn","error","assert","dir","clear","profile","profileEnd"
shebang: function() { ].forEach(function (method) {
console[method] = this.bind(console[method], console);
// If shebang has an operation nickname in it.. }, Function.prototype.call);
// e.g. /docs/#!/words/get_search }
var fragments = $.param.fragment().split('/');
fragments.shift(); // get rid of the bang var Docs = {
switch (fragments.length) { shebang: function() {
case 1:
// Expand all operations for the resource and scroll to it // If shebang has an operation nickname in it..
var dom_id = 'resource_' + fragments[0]; // e.g. /docs/#!/words/get_search
var fragments = $.param.fragment().split('/');
Docs.expandEndpointListForResource(fragments[0]); fragments.shift(); // get rid of the bang
$("#"+dom_id).slideto({highlight: false});
break; switch (fragments.length) {
case 2: case 1:
// Refer to the endpoint DOM element, e.g. #words_get_search // Expand all operations for the resource and scroll to it
var dom_id = 'resource_' + fragments[0];
// Expand Resource
Docs.expandEndpointListForResource(fragments[0]); Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false}); $("#"+dom_id).slideto({highlight: false});
break;
// Expand operation case 2:
var li_dom_id = fragments.join('_'); // Refer to the endpoint DOM element, e.g. #words_get_search
var li_content_dom_id = li_dom_id + "_content";
// Expand Resource
Docs.expandEndpointListForResource(fragments[0]);
Docs.expandOperation($('#'+li_content_dom_id)); $("#"+dom_id).slideto({highlight: false});
$('#'+li_dom_id).slideto({highlight: false});
break; // Expand operation
} var li_dom_id = fragments.join('_');
var li_content_dom_id = li_dom_id + "_content";
},
toggleEndpointListForResource: function(resource) { Docs.expandOperation($('#'+li_content_dom_id));
var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints'); $('#'+li_dom_id).slideto({highlight: false});
if (elem.is(':visible')) { break;
Docs.collapseEndpointListForResource(resource); }
} else {
Docs.expandEndpointListForResource(resource); },
}
}, toggleEndpointListForResource: function(resource) {
var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
// Expand resource if (elem.is(':visible')) {
expandEndpointListForResource: function(resource) { Docs.collapseEndpointListForResource(resource);
var resource = Docs.escapeResourceName(resource); } else {
if (resource == '') { Docs.expandEndpointListForResource(resource);
$('.resource ul.endpoints').slideDown(); }
return; },
}
// Expand resource
$('li#resource_' + resource).addClass('active'); expandEndpointListForResource: function(resource) {
var resource = Docs.escapeResourceName(resource);
var elem = $('li#resource_' + resource + ' ul.endpoints'); if (resource == '') {
elem.slideDown(); $('.resource ul.endpoints').slideDown();
}, return;
}
// Collapse resource and mark as explicitly closed
collapseEndpointListForResource: function(resource) { $('li#resource_' + resource).addClass('active');
var resource = Docs.escapeResourceName(resource);
if (resource == '') { var elem = $('li#resource_' + resource + ' ul.endpoints');
$('.resource ul.endpoints').slideUp(); elem.slideDown();
return; },
}
// Collapse resource and mark as explicitly closed
$('li#resource_' + resource).removeClass('active'); collapseEndpointListForResource: function(resource) {
var resource = Docs.escapeResourceName(resource);
var elem = $('li#resource_' + resource + ' ul.endpoints'); if (resource == '') {
elem.slideUp(); $('.resource ul.endpoints').slideUp();
}, return;
}
expandOperationsForResource: function(resource) {
// Make sure the resource container is open.. $('li#resource_' + resource).removeClass('active');
Docs.expandEndpointListForResource(resource);
var elem = $('li#resource_' + resource + ' ul.endpoints');
if (resource == '') { elem.slideUp();
$('.resource ul.endpoints li.operation div.content').slideDown(); },
return;
} expandOperationsForResource: function(resource) {
// Make sure the resource container is open..
$('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() { Docs.expandEndpointListForResource(resource);
Docs.expandOperation($(this));
}); if (resource == '') {
}, $('.resource ul.endpoints li.operation div.content').slideDown();
return;
collapseOperationsForResource: function(resource) { }
// Make sure the resource container is open..
Docs.expandEndpointListForResource(resource); $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
Docs.expandOperation($(this));
if (resource == '') { });
$('.resource ul.endpoints li.operation div.content').slideUp(); },
return;
} collapseOperationsForResource: function(resource) {
// Make sure the resource container is open..
$('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() { Docs.expandEndpointListForResource(resource);
Docs.collapseOperation($(this));
}); if (resource == '') {
}, $('.resource ul.endpoints li.operation div.content').slideUp();
return;
escapeResourceName: function(resource) { }
return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
}, $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
Docs.collapseOperation($(this));
expandOperation: function(elem) { });
elem.slideDown(); },
},
escapeResourceName: function(resource) {
collapseOperation: function(elem) { return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
elem.slideUp(); },
}
}; expandOperation: function(elem) {
elem.slideDown();
},
collapseOperation: function(elem) {
elem.slideUp();
}
};
this["Handlebars"] = this["Handlebars"] || {}; this["Handlebars"] = this["Handlebars"] || {};
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {}; this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
@@ -205,7 +212,7 @@ this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"co
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>" return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>"
+ escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper)))
+ "</div>\n <input placeholder=\"api_key\" class=\"auth_input\" id=\"input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_api_key\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n"; + "</div>\n <input placeholder=\"api_key\" class=\"auth_input\" id=\"input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_api_key\" href=\"#\" data-swTarnslate>apply</a></div>\n </div>\n</div>\n\n";
},"useData":true}); },"useData":true});
var SwaggerUi, var SwaggerUi,
__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; }, __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; },
@@ -400,7 +407,7 @@ Handlebars.registerHelper('sanitize', function(html) {
}); });
this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\">Username</div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\">Password</div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n"; return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\" data-swTarnslate>Username</div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\" data-swTarnslate>Password</div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\" data-swTarnslate>apply</a></div>\n </div>\n</div>\n\n";
},"useData":true}); },"useData":true});
var ApiKeyButton, var ApiKeyButton,
__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; }, __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; },
@@ -531,6 +538,8 @@ BasicAuthButton = (function(_super) {
})(Backbone.View); })(Backbone.View);
this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">" var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">"
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
@@ -557,15 +566,15 @@ this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(dept
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return "<div class=\"info_tos\"><a href=\"" return "<div class=\"info_tos\"><a href=\""
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0)) + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0))
+ "\">Terms of service</a></div>"; + "\" data-swTarnslate>Terms of service</a></div>";
},"4":function(depth0,helpers,partials,data) { },"4":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return "<div class='info_name'>Created by " return "<div class='info_name'><span data-swTarnslate>Created by</span> "
+ escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0)) + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0))
+ "</div>"; + "</div>";
},"6":function(depth0,helpers,partials,data) { },"6":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return "<div class='info_url'>See more at <a href=\"" return "<div class='info_url'><span data-swTarnslate>See more at</span> <a href=\""
+ escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
+ "\">" + "\">"
+ escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
@@ -576,7 +585,7 @@ this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(dept
+ escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0)) + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0))
+ "?subject=" + "?subject="
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ "\">Contact the developer</a></div>"; + "\" data-swTarnslate>Contact the developer</a></div>";
},"10":function(depth0,helpers,partials,data) { },"10":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return "<div class='info_license'><a href='" return "<div class='info_license'><a href='"
@@ -586,7 +595,7 @@ this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(dept
+ "</a></div>"; + "</a></div>";
},"12":function(depth0,helpers,partials,data) { },"12":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return " , <span style=\"font-variant: small-caps\">api version</span>: " return " , <span style=\"font-variant: small-caps\" data-swTarnslate>api version</span>: "
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0)) + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0))
+ "\n "; + "\n ";
},"14":function(depth0,helpers,partials,data) { },"14":function(depth0,helpers,partials,data) {
@@ -604,7 +613,7 @@ this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(dept
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n"; var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: " buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\" data-swTarnslate>base url</span>: "
+ escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper)))
+ "\n"; + "\n";
stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data});
@@ -646,9 +655,9 @@ ContentTypeView = (function(_super) {
this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
return "deprecated"; return "deprecated";
},"3":function(depth0,helpers,partials,data) { },"3":function(depth0,helpers,partials,data) {
return " <h4>Warning: Deprecated</h4>\n"; return " <h4 data-swTarnslate>Warning: Deprecated</h4>\n";
},"5":function(depth0,helpers,partials,data) { },"5":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4>Implementation Notes</h4>\n <p class=\"markdown\">"; var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4 data-swTarnslate>Implementation Notes</h4>\n <p class=\"markdown\">";
stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</p>\n"; return buffer + "</p>\n";
@@ -672,17 +681,17 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n"; return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n";
},"16":function(depth0,helpers,partials,data) { },"16":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <h4>Response Class (Status " return " <h4><span data-swTarnslate>Response Class</span> (Status "
+ escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper)))
+ ")</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n"; + ")</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n";
},"18":function(depth0,helpers,partials,data) { },"18":function(depth0,helpers,partials,data) {
return " <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\">Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 100px; max-width: 100px\">Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n"; return " <h4 data-swTarnslate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-swTarnslate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-swTarnslate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-swTarnslate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-swTarnslate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-swTarnslate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
},"20":function(depth0,helpers,partials,data) { },"20":function(depth0,helpers,partials,data) {
return " <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n"; return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-swTarnslate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-swTarnslate>HTTP Status Code</th>\n <th data-swTarnslate>Reason</th>\n <th data-swTarnslate>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n";
},"22":function(depth0,helpers,partials,data) { },"22":function(depth0,helpers,partials,data) {
return ""; return "";
},"24":function(depth0,helpers,partials,data) { },"24":function(depth0,helpers,partials,data) {
return " <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"; return " <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' data-swTarnslate value='Try it out!' />\n <a href='#' class='response_hider' style='display:none' data-swTarnslate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='" var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='"
+ escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper)))
@@ -744,7 +753,7 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + " </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"; return buffer + " </form>\n <div class='response' style='display:none'>\n <h4 data-swTarnslate>Request URL</h4>\n <div class='block request_url'></div>\n <h4 data-swTarnslate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-swTarnslate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-swTarnslate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
},"useData":true}); },"useData":true});
var HeaderView, var HeaderView,
__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; }, __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; },
@@ -1552,7 +1561,7 @@ OperationView = (function(_super) {
json = JSON.stringify(JSON.parse(content), null, " "); json = JSON.stringify(JSON.parse(content), null, " ");
} catch (_error) { } catch (_error) {
e = _error; e = _error;
json = "can't parse JSON. Raw result:\n\n" + content; json = "<span data-swTarnslate>can't parse JSON. Raw result</span>:\n\n" + content;
} }
code = $('<code />').text(json); code = $('<code />').text(json);
pre = $('<pre class="json" />').append(code); pre = $('<pre class="json" />').append(code);
@@ -2055,7 +2064,7 @@ this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<li>\n <a href='" return "<li>\n <a href='"
+ escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ "'>Raw</a>\n </li>"; + "' data-swTarnslate>Raw</a>\n </li>";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/" var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/"
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
@@ -2075,11 +2084,11 @@ this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "' class=\"toggleEndpointList\" data-id=\"" + "' class=\"toggleEndpointList\" data-id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\">Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\"" + "\" data-swTarnslate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\"" + "\">\n <span data-swTarnslate>List Operations</span>\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\">\n Expand Operations\n </a>\n </li>\n "; + "\">\n <span data-swTarnslate>Expand Operations</span>\n </a>\n </li>\n ";
stack1 = ((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(options={"name":"url","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); stack1 = ((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(options={"name":"url","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.url) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if (!helpers.url) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
@@ -2223,7 +2232,7 @@ StatusCodeView = (function(_super) {
})(Backbone.View); })(Backbone.View);
this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\">Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\">Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n "; var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-swTarnslate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-swTarnslate>Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n ";
stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper)); stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "\n </div>\n\n <div class=\"snippet\">\n <pre><code>" return buffer + "\n </div>\n\n <div class=\"snippet\">\n <pre><code>"