Browse Source

rebuilt

bubble
Tony Tam 10 years ago
parent
commit
c17cc1010f
2 changed files with 69 additions and 14 deletions
  1. +68
    -13
      dist/swagger-ui.js
  2. +1
    -1
      dist/swagger-ui.min.js

+ 68
- 13
dist/swagger-ui.js View File

@@ -1,4 +1,5 @@
// swagger-ui.js
// version 2.0.18
$(function() {
// Helper function for vertically aligning DOM elements
@@ -67,7 +68,7 @@ log = function(){
log.history = log.history || [];
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
console.log( Array.prototype.slice.call(arguments)[0] );
}
};
@@ -311,6 +312,23 @@ function program8(depth0,data) {
});
})();

(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['oauth_view'] = template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;


buffer += "<div class='auth_button' id='oauth_button'><img class='auth_icon' alt='apply api key' src='images/oauth.jpeg'></div>\n<div class='auth_container' id='oauth_container'>\n <div class='key_input_container'>\n <div class='auth_label'>";
if (stack1 = helpers.keyName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.keyName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</div>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n";
return buffer;
});
})();

(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['operation'] = template(function (Handlebars,depth0,helpers,partials,data) {
@@ -561,7 +579,7 @@ function program9(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(10, program10, data),fn:self.program(2, program2, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -569,7 +587,16 @@ function program9(depth0,data) {
function program10(depth0,data) {
var buffer = "", stack1;
buffer += "\n <input class='parameter' minlength='0' name='";
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(13, program13, data),fn:self.program(11, program11, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
}
function program11(depth0,data) {
var buffer = "", stack1;
buffer += "\n <input class='parameter' minlength='0' name='";
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
@@ -577,18 +604,18 @@ function program10(depth0,data) {
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "'/>\n ";
+ "'/>\n ";
return buffer;
}

function program12(depth0,data) {
function program13(depth0,data) {
var buffer = "", stack1;
buffer += "\n <input class='parameter' minlength='0' name='";
buffer += "\n <input class='parameter' minlength='0' name='";
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "' placeholder='' type='text' value=''/>\n ";
+ "' placeholder='' type='text' value=''/>\n ";
return buffer;
}

@@ -1288,7 +1315,8 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
this.mainView = new MainView({
model: this.api,
el: $('#' + this.dom_id)
el: $('#' + this.dom_id),
swaggerOptions: this.options
}).render();
this.showMessage();
switch (this.options.docExpansion) {
@@ -1421,6 +1449,8 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View);

MainView = (function(_super) {
var sorters;

__extends(MainView, _super);

function MainView() {
@@ -1428,7 +1458,33 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
return _ref2;
}

MainView.prototype.initialize = function() {};
sorters = {
'alpha': function(a, b) {
return a.path.localeCompare(b.path);
},
'method': function(a, b) {
return a.method.localeCompare(b.method);
}
};

MainView.prototype.initialize = function(opts) {
var route, sorter, sorterName, _i, _len, _ref3;
if (opts == null) {
opts = {};
}
if (opts.swaggerOptions.sorter) {
sorterName = opts.swaggerOptions.sorter;
sorter = sorters[sorterName];
_ref3 = this.model.apisArray;
for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
route = _ref3[_i];
route.operationsArray.sort(sorter);
}
if (sorterName === "alpha") {
return this.model.apisArray.sort(sorter);
}
}
};

MainView.prototype.render = function() {
var counter, id, resource, resources, _i, _len, _ref3;
@@ -1540,8 +1596,8 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
OperationView.prototype.mouseEnter = function(e) {
var elem, hgh, pos, scMaxX, scMaxY, scX, scY, wd, x, y;
elem = $(e.currentTarget.parentNode).find('#api_information_panel');
x = event.pageX;
y = event.pageY;
x = e.pageX;
y = e.pageY;
scX = $(window).scrollLeft();
scY = $(window).scrollTop();
scMaxX = scX + $(window).width();
@@ -1746,7 +1802,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
param = _ref6[_j];
if (param.paramType === 'form') {
if (map[param.name] !== void 0) {
if (param.type.toLowerCase() !== 'file' && map[param.name] !== void 0) {
bodyParam.append(param.name, map[param.name]);
}
}
@@ -1768,7 +1824,6 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
params += 1;
}
}
log(bodyParam);
this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true);
$(".request_url", $(this.el)).html("<pre>" + this.invocationUrl + "</pre>");
obj = {


+ 1
- 1
dist/swagger-ui.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save