moved css scoping to less templates per owners request, converted highlight.default.css to less, and made reset css its only include as it is difficult to scope due to html and body tag css overrides

This commit is contained in:
Kyle J. Ginavan
2014-04-11 09:59:19 -05:00
parent 84f4e670fc
commit 34ab47e9e7
16 changed files with 914 additions and 780 deletions

View File

@@ -81,6 +81,9 @@ task 'dist', 'Build a distribution', ->
less.render fs.readFileSync("src/main/less/screen.less", 'utf8'), (err, css) -> less.render fs.readFileSync("src/main/less/screen.less", 'utf8'), (err, css) ->
console.log err console.log err
fs.writeFileSync("src/main/html/css/screen.css", css) fs.writeFileSync("src/main/html/css/screen.css", css)
less.render fs.readFileSync("src/main/less/reset.less", 'utf8'), (err, css) ->
console.log err
fs.writeFileSync("src/main/html/css/reset.css", css)
pack() pack()
pack = -> pack = ->

View File

@@ -1,130 +0,0 @@
/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
.swagger-section pre code {
display: block; padding: 0.5em;
background: #F0F0F0;
}
.swagger-section pre code,
.swagger-section pre .subst,
.swagger-section pre .tag .title,
.swagger-section pre .lisp .title,
.swagger-section pre .clojure .built_in,
.swagger-section pre .nginx .title {
color: black;
}
.swagger-section pre .string,
.swagger-section pre .title,
.swagger-section pre .constant,
.swagger-section pre .parent,
.swagger-section pre .tag .value,
.swagger-section pre .rules .value,
.swagger-section pre .rules .value .number,
.swagger-section pre .preprocessor,
.swagger-section pre .ruby .symbol,
.swagger-section pre .ruby .symbol .string,
.swagger-section pre .aggregate,
.swagger-section pre .template_tag,
.swagger-section pre .django .variable,
.swagger-section pre .smalltalk .class,
.swagger-section pre .addition,
.swagger-section pre .flow,
.swagger-section pre .stream,
.swagger-section pre .bash .variable,
.swagger-section pre .apache .tag,
.swagger-section pre .apache .cbracket,
.swagger-section pre .tex .command,
.swagger-section pre .tex .special,
.swagger-section pre .erlang_repl .function_or_atom,
.swagger-section pre .markdown .header {
color: #800;
}
.swagger-section pre .comment,
.swagger-section pre .annotation,
.swagger-section pre .template_comment,
.swagger-section pre .diff .header,
.swagger-section pre .chunk,
.swagger-section pre .markdown .blockquote {
color: #888;
}
.swagger-section pre .number,
.swagger-section pre .date,
.swagger-section pre .regexp,
.swagger-section pre .literal,
.swagger-section pre .smalltalk .symbol,
.swagger-section pre .smalltalk .char,
.swagger-section pre .go .constant,
.swagger-section pre .change,
.swagger-section pre .markdown .bullet,
.swagger-section pre .markdown .link_url {
color: #080;
}
.swagger-section pre .label,
.swagger-section pre .javadoc,
.swagger-section pre .ruby .string,
.swagger-section pre .decorator,
.swagger-section pre .filter .argument,
.swagger-section pre .localvars,
.swagger-section pre .array,
.swagger-section pre .attr_selector,
.swagger-section pre .important,
.swagger-section pre .pseudo,
.swagger-section pre .pi,
.swagger-section pre .doctype,
.swagger-section pre .deletion,
.swagger-section pre .envvar,
.swagger-section pre .shebang,
.swagger-section pre .apache .sqbracket,
.swagger-section pre .nginx .built_in,
.swagger-section pre .tex .formula,
.swagger-section pre .erlang_repl .reserved,
.swagger-section pre .prompt,
.swagger-section pre .markdown .link_label,
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #88F
}
.swagger-section pre .keyword,
.swagger-section pre .id,
.swagger-section pre .phpdoc,
.swagger-section pre .title,
.swagger-section pre .built_in,
.swagger-section pre .aggregate,
.swagger-section pre .css .tag,
.swagger-section pre .javadoctag,
.swagger-section pre .phpdoc,
.swagger-section pre .yardoctag,
.swagger-section pre .smalltalk .class,
.swagger-section pre .winutils,
.swagger-section pre .bash .variable,
.swagger-section pre .apache .tag,
.swagger-section pre .go .typename,
.swagger-section pre .tex .command,
.swagger-section pre .markdown .strong,
.swagger-section pre .request,
.swagger-section pre .status {
font-weight: bold;
}
.swagger-section pre .markdown .emphasis {
font-style: italic;
}
.swagger-section pre .nginx .built_in {
font-weight: normal;
}
.swagger-section pre .coffeescript .javascript,
.swagger-section pre .javascript .xml,
.swagger-section pre .tex .formula,
.swagger-section pre .xml .javascript,
.swagger-section pre .xml .vbscript,
.swagger-section pre .xml .css,
.swagger-section pre .xml .cdata {
opacity: 0.5;
}

125
dist/css/reset.css vendored Normal file
View File

@@ -0,0 +1,125 @@
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

265
dist/css/screen.css vendored
View File

@@ -1,133 +1,125 @@
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ /* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
.swagger-section html, .swagger-section pre code {
body.swagger-section,
.swagger-section div,
.swagger-section span,
.swagger-section applet,
.swagger-section object,
.swagger-section iframe,
.swagger-section h1,
.swagger-section h2,
.swagger-section h3,
.swagger-section h4,
.swagger-section h5,
.swagger-section h6,
.swagger-section p,
.swagger-section blockquote,
.swagger-section pre,
.swagger-section a,
.swagger-section abbr,
.swagger-section acronym,
.swagger-section address,
.swagger-section big,
.swagger-section cite,
.swagger-section code,
.swagger-section del,
.swagger-section dfn,
.swagger-section em,
.swagger-section img,
.swagger-section ins,
.swagger-section kbd,
.swagger-section q,
.swagger-section s,
.swagger-section samp,
.swagger-section small,
.swagger-section strike,
.swagger-section strong,
.swagger-section sub,
.swagger-section sup,
.swagger-section tt,
.swagger-section var,
.swagger-section b,
.swagger-section u,
.swagger-section i,
.swagger-section center,
.swagger-section dl,
.swagger-section dt,
.swagger-section dd,
.swagger-section ol,
.swagger-section ul,
.swagger-section li,
.swagger-section fieldset,
.swagger-section form,
.swagger-section label,
.swagger-section legend,
.swagger-section table,
.swagger-section caption,
.swagger-section tbody,
.swagger-section tfoot,
.swagger-section thead,
.swagger-section tr,
.swagger-section th,
.swagger-section td,
.swagger-section article,
.swagger-section aside,
.swagger-section canvas,
.swagger-section details,
.swagger-section embed,
.swagger-section figure,
.swagger-section figcaption,
.swagger-section footer,
.swagger-section header,
.swagger-section hgroup,
.swagger-section menu,
.swagger-section nav,
.swagger-section output,
.swagger-section ruby,
.swagger-section section,
.swagger-section summary,
.swagger-section time,
.swagger-section mark,
.swagger-section audio,
.swagger-section video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
.swagger-section article,
.swagger-section aside,
.swagger-section details,
.swagger-section figcaption,
.swagger-section figure,
.swagger-section footer,
.swagger-section header,
.swagger-section hgroup,
.swagger-section menu,
.swagger-section nav,
.swagger-section section {
display: block; display: block;
padding: 0.5em;
background: #F0F0F0;
} }
.swagger-section body { .swagger-section pre code,
line-height: 1; .swagger-section pre .subst,
.swagger-section pre .tag .title,
.swagger-section pre .lisp .title,
.swagger-section pre .clojure .built_in,
.swagger-section pre .nginx .title {
color: black;
} }
.swagger-section ol, .swagger-section pre .string,
.swagger-section ul { .swagger-section pre .title,
list-style: none; .swagger-section pre .constant,
.swagger-section pre .parent,
.swagger-section pre .tag .value,
.swagger-section pre .rules .value,
.swagger-section pre .rules .value .number,
.swagger-section pre .preprocessor,
.swagger-section pre .ruby .symbol,
.swagger-section pre .ruby .symbol .string,
.swagger-section pre .aggregate,
.swagger-section pre .template_tag,
.swagger-section pre .django .variable,
.swagger-section pre .smalltalk .class,
.swagger-section pre .addition,
.swagger-section pre .flow,
.swagger-section pre .stream,
.swagger-section pre .bash .variable,
.swagger-section pre .apache .tag,
.swagger-section pre .apache .cbracket,
.swagger-section pre .tex .command,
.swagger-section pre .tex .special,
.swagger-section pre .erlang_repl .function_or_atom,
.swagger-section pre .markdown .header {
color: #800;
} }
.swagger-section blockquote, .swagger-section pre .comment,
.swagger-section q { .swagger-section pre .annotation,
quotes: none; .swagger-section pre .template_comment,
.swagger-section pre .diff .header,
.swagger-section pre .chunk,
.swagger-section pre .markdown .blockquote {
color: #888;
} }
.swagger-section blockquote:before, .swagger-section pre .number,
.swagger-section blockquote:after, .swagger-section pre .date,
.swagger-section q:before, .swagger-section pre .regexp,
.swagger-section q:after { .swagger-section pre .literal,
content: ''; .swagger-section pre .smalltalk .symbol,
content: none; .swagger-section pre .smalltalk .char,
.swagger-section pre .go .constant,
.swagger-section pre .change,
.swagger-section pre .markdown .bullet,
.swagger-section pre .markdown .link_url {
color: #080;
} }
.swagger-section table { .swagger-section pre .label,
border-collapse: collapse; .swagger-section pre .javadoc,
border-spacing: 0; .swagger-section pre .ruby .string,
.swagger-section pre .decorator,
.swagger-section pre .filter .argument,
.swagger-section pre .localvars,
.swagger-section pre .array,
.swagger-section pre .attr_selector,
.swagger-section pre .important,
.swagger-section pre .pseudo,
.swagger-section pre .pi,
.swagger-section pre .doctype,
.swagger-section pre .deletion,
.swagger-section pre .envvar,
.swagger-section pre .shebang,
.swagger-section pre .apache .sqbracket,
.swagger-section pre .nginx .built_in,
.swagger-section pre .tex .formula,
.swagger-section pre .erlang_repl .reserved,
.swagger-section pre .prompt,
.swagger-section pre .markdown .link_label,
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #8888ff;
}
.swagger-section pre .keyword,
.swagger-section pre .id,
.swagger-section pre .phpdoc,
.swagger-section pre .title,
.swagger-section pre .built_in,
.swagger-section pre .aggregate,
.swagger-section pre .css .tag,
.swagger-section pre .javadoctag,
.swagger-section pre .phpdoc,
.swagger-section pre .yardoctag,
.swagger-section pre .smalltalk .class,
.swagger-section pre .winutils,
.swagger-section pre .bash .variable,
.swagger-section pre .apache .tag,
.swagger-section pre .go .typename,
.swagger-section pre .tex .command,
.swagger-section pre .markdown .strong,
.swagger-section pre .request,
.swagger-section pre .status {
font-weight: bold;
}
.swagger-section pre .markdown .emphasis {
font-style: italic;
}
.swagger-section pre .nginx .built_in {
font-weight: normal;
}
.swagger-section pre .coffeescript .javascript,
.swagger-section pre .javascript .xml,
.swagger-section pre .tex .formula,
.swagger-section pre .xml .javascript,
.swagger-section pre .xml .vbscript,
.swagger-section pre .xml .css,
.swagger-section pre .xml .cdata {
opacity: 0.5;
} }
/* Browser Override Ends Here */
.swagger-section .swagger-ui-wrap { .swagger-section .swagger-ui-wrap {
line-height: 1; line-height: 1;
font-family: "Droid Sans", sans-serif; font-family: "Droid Sans", sans-serif;
@@ -927,6 +919,31 @@ body.swagger-section,
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
color: #6fa5d2; color: #6fa5d2;
} }
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
background-color: #e7f0f7;
border: 1px solid #c3d9ec;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
background-color: #0f6ab4;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
border-right: 1px solid #dddddd;
border-right-color: #c3d9ec;
color: #0f6ab4;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
color: #0f6ab4;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
background-color: #ebf3f9;
border: 1px solid #c3d9ec;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
color: #0f6ab4;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
color: #6fa5d2;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
@@ -1201,4 +1218,4 @@ body.swagger-section,
min-height: 30px; min-height: 30px;
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
} }

4
dist/index.html vendored
View File

@@ -3,7 +3,7 @@
<head> <head>
<title>Swagger UI</title> <title>Swagger UI</title>
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/> <link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link href='css/highlight.default.css' media='screen' rel='stylesheet' type='text/css'/> <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/> <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<script type="text/javascript" src="lib/shred.bundle.js"></script> <script type="text/javascript" src="lib/shred.bundle.js"></script>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script> <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
@@ -61,7 +61,7 @@
</script> </script>
</head> </head>
<body class='swagger-section'> <body class="swagger-section">
<div id='header'> <div id='header'>
<div class="swagger-ui-wrap"> <div class="swagger-ui-wrap">
<a id="logo" href="http://swagger.wordnik.com">swagger</a> <a id="logo" href="http://swagger.wordnik.com">swagger</a>

19
dist/lib/swagger.js vendored
View File

@@ -1,5 +1,5 @@
// swagger.js // swagger.js
// version 2.0.27 // version 2.0.26
var __bind = function(fn, me){ var __bind = function(fn, me){
return function(){ return function(){
@@ -882,21 +882,6 @@ SwaggerOperation.prototype.pathXml = function() {
return this.path.replace("{format}", "xml"); return this.path.replace("{format}", "xml");
}; };
SwaggerOperation.prototype.encodePathParam = function(pathParam) {
var encParts, part, parts, _i, _len;
if (pathParam.indexOf("/") === -1) {
return encodeURIComponent(pathParam);
} else {
parts = pathParam.split("/");
encParts = [];
for (_i = 0, _len = parts.length; _i < _len; _i++) {
part = parts[_i];
encParts.push(encodeURIComponent(part));
}
return encParts.join("/");
}
};
SwaggerOperation.prototype.urlify = function(args) { SwaggerOperation.prototype.urlify = function(args) {
var url = this.resource.basePath + this.pathJson(); var url = this.resource.basePath + this.pathJson();
var params = this.parameters; var params = this.parameters;
@@ -906,7 +891,7 @@ SwaggerOperation.prototype.urlify = function(args) {
if(args[param.name]) { if(args[param.name]) {
// apply path params and remove from args // apply path params and remove from args
var reg = new RegExp('\{' + param.name + '[^\}]*\}', 'gi'); var reg = new RegExp('\{' + param.name + '[^\}]*\}', 'gi');
url = url.replace(reg, this.encodePathParam(args[param.name])); url = url.replace(reg, encodeURIComponent(args[param.name]));
delete args[param.name]; delete args[param.name];
} }
else else

154
dist/swagger-ui.js vendored
View File

@@ -1207,18 +1207,18 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.5.0
(function() { (function() {
var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi,
__hasProp = {}.hasOwnProperty, __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
SwaggerUi = (function(_super) { SwaggerUi = (function(_super) {
__extends(SwaggerUi, _super); __extends(SwaggerUi, _super);
function SwaggerUi() { function SwaggerUi() {
_ref = SwaggerUi.__super__.constructor.apply(this, arguments); SwaggerUi.__super__.constructor.apply(this, arguments);
return _ref;
} }
SwaggerUi.prototype.dom_id = "swagger_ui"; SwaggerUi.prototype.dom_id = "swagger_ui";
@@ -1267,9 +1267,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
SwaggerUi.prototype.load = function() { SwaggerUi.prototype.load = function() {
var url, _ref1; var url, _ref;
if ((_ref1 = this.mainView) != null) { if ((_ref = this.mainView) != null) {
_ref1.clear(); _ref.clear();
} }
url = this.options.url; url = this.options.url;
if (url.indexOf("http") !== 0) { if (url.indexOf("http") !== 0) {
@@ -1358,11 +1358,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
window.SwaggerUi = SwaggerUi; window.SwaggerUi = SwaggerUi;
HeaderView = (function(_super) { HeaderView = (function(_super) {
__extends(HeaderView, _super); __extends(HeaderView, _super);
function HeaderView() { function HeaderView() {
_ref1 = HeaderView.__super__.constructor.apply(this, arguments); HeaderView.__super__.constructor.apply(this, arguments);
return _ref1;
} }
HeaderView.prototype.events = { HeaderView.prototype.events = {
@@ -1420,23 +1420,23 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
MainView = (function(_super) { MainView = (function(_super) {
__extends(MainView, _super); __extends(MainView, _super);
function MainView() { function MainView() {
_ref2 = MainView.__super__.constructor.apply(this, arguments); MainView.__super__.constructor.apply(this, arguments);
return _ref2;
} }
MainView.prototype.initialize = function() {}; MainView.prototype.initialize = function() {};
MainView.prototype.render = function() { MainView.prototype.render = function() {
var counter, id, resource, resources, _i, _len, _ref3; var counter, id, resource, resources, _i, _len, _ref;
$(this.el).html(Handlebars.templates.main(this.model)); $(this.el).html(Handlebars.templates.main(this.model));
resources = {}; resources = {};
counter = 0; counter = 0;
_ref3 = this.model.apisArray; _ref = this.model.apisArray;
for (_i = 0, _len = _ref3.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
resource = _ref3[_i]; resource = _ref[_i];
id = resource.name; id = resource.name;
while (typeof resources[id] !== 'undefined') { while (typeof resources[id] !== 'undefined') {
id = id + "_" + counter; id = id + "_" + counter;
@@ -1469,22 +1469,22 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ResourceView = (function(_super) { ResourceView = (function(_super) {
__extends(ResourceView, _super); __extends(ResourceView, _super);
function ResourceView() { function ResourceView() {
_ref3 = ResourceView.__super__.constructor.apply(this, arguments); ResourceView.__super__.constructor.apply(this, arguments);
return _ref3;
} }
ResourceView.prototype.initialize = function() {}; ResourceView.prototype.initialize = function() {};
ResourceView.prototype.render = function() { ResourceView.prototype.render = function() {
var counter, id, methods, operation, _i, _len, _ref4; var counter, id, methods, operation, _i, _len, _ref;
$(this.el).html(Handlebars.templates.resource(this.model)); $(this.el).html(Handlebars.templates.resource(this.model));
methods = {}; methods = {};
_ref4 = this.model.operationsArray; _ref = this.model.operationsArray;
for (_i = 0, _len = _ref4.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
operation = _ref4[_i]; operation = _ref[_i];
counter = 0; counter = 0;
id = operation.nickname; id = operation.nickname;
while (typeof methods[id] !== 'undefined') { while (typeof methods[id] !== 'undefined') {
@@ -1516,11 +1516,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
OperationView = (function(_super) { OperationView = (function(_super) {
__extends(OperationView, _super); __extends(OperationView, _super);
function OperationView() { function OperationView() {
_ref4 = OperationView.__super__.constructor.apply(this, arguments); OperationView.__super__.constructor.apply(this, arguments);
return _ref4;
} }
OperationView.prototype.invocationUrl = null; OperationView.prototype.invocationUrl = null;
@@ -1571,16 +1571,16 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.render = function() { OperationView.prototype.render = function() {
var contentTypeModel, isMethodSubmissionSupported, k, o, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, v, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref5, _ref6, _ref7, _ref8; var contentTypeModel, isMethodSubmissionSupported, k, o, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, v, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3;
isMethodSubmissionSupported = true; isMethodSubmissionSupported = true;
if (!isMethodSubmissionSupported) { if (!isMethodSubmissionSupported) {
this.model.isReadOnly = true; this.model.isReadOnly = true;
} }
this.model.oauth = null; this.model.oauth = null;
if (this.model.authorizations) { if (this.model.authorizations) {
_ref5 = this.model.authorizations; _ref = this.model.authorizations;
for (k in _ref5) { for (k in _ref) {
v = _ref5[k]; v = _ref[k];
if (k === "oauth2") { if (k === "oauth2") {
if (this.model.oauth === null) { if (this.model.oauth === null) {
this.model.oauth = {}; this.model.oauth = {};
@@ -1615,9 +1615,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
contentTypeModel.consumes = this.model.consumes; contentTypeModel.consumes = this.model.consumes;
contentTypeModel.produces = this.model.produces; contentTypeModel.produces = this.model.produces;
_ref6 = this.model.parameters; _ref1 = this.model.parameters;
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
param = _ref6[_j]; param = _ref1[_j];
type = param.type || param.dataType; type = param.type || param.dataType;
if (type.toLowerCase() === 'file') { if (type.toLowerCase() === 'file') {
if (!contentTypeModel.consumes) { if (!contentTypeModel.consumes) {
@@ -1630,14 +1630,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
model: contentTypeModel model: contentTypeModel
}); });
$('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
_ref7 = this.model.parameters; _ref2 = this.model.parameters;
for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
param = _ref7[_k]; param = _ref2[_k];
this.addParameter(param, contentTypeModel.consumes); this.addParameter(param, contentTypeModel.consumes);
} }
_ref8 = this.model.responseMessages; _ref3 = this.model.responseMessages;
for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) { for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
statusCode = _ref8[_l]; statusCode = _ref3[_l];
this.addStatusCode(statusCode); this.addStatusCode(statusCode);
} }
return this; return this;
@@ -1664,7 +1664,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.submitOperation = function(e) { OperationView.prototype.submitOperation = function(e) {
var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7; var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@@ -1689,9 +1689,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
parent: this parent: this
}; };
isFileUpload = false; isFileUpload = false;
_ref5 = form.find("input"); _ref = form.find("input");
for (_i = 0, _len = _ref5.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
o = _ref5[_i]; o = _ref[_i];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value; map[o.name] = o.value;
} }
@@ -1699,16 +1699,16 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
isFileUpload = true; isFileUpload = true;
} }
} }
_ref6 = form.find("textarea"); _ref1 = form.find("textarea");
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
o = _ref6[_j]; o = _ref1[_j];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map["body"] = o.value; map["body"] = o.value;
} }
} }
_ref7 = form.find("select"); _ref2 = form.find("select");
for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
o = _ref7[_k]; o = _ref2[_k];
val = this.getSelectedValue(o); val = this.getSelectedValue(o);
if ((val != null) && jQuery.trim(val).length > 0) { if ((val != null) && jQuery.trim(val).length > 0) {
map[o.name] = val; map[o.name] = val;
@@ -1730,20 +1730,20 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.handleFileUpload = function(map, form) { OperationView.prototype.handleFileUpload = function(map, form) {
var bodyParam, el, headerParams, o, obj, param, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref5, _ref6, _ref7, _ref8, var bodyParam, el, headerParams, o, obj, param, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3,
_this = this; _this = this;
log("it's a file upload"); log("it's a file upload");
_ref5 = form.serializeArray(); _ref = form.serializeArray();
for (_i = 0, _len = _ref5.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
o = _ref5[_i]; o = _ref[_i];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value; map[o.name] = o.value;
} }
} }
bodyParam = new FormData(); bodyParam = new FormData();
_ref6 = this.model.parameters; _ref1 = this.model.parameters;
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
param = _ref6[_j]; param = _ref1[_j];
if (param.paramType === 'form') { if (param.paramType === 'form') {
if (map[param.name] !== void 0) { if (map[param.name] !== void 0) {
bodyParam.append(param.name, map[param.name]); bodyParam.append(param.name, map[param.name]);
@@ -1751,17 +1751,17 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
} }
} }
headerParams = {}; headerParams = {};
_ref7 = this.model.parameters; _ref2 = this.model.parameters;
for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
param = _ref7[_k]; param = _ref2[_k];
if (param.paramType === 'header') { if (param.paramType === 'header') {
headerParams[param.name] = map[param.name]; headerParams[param.name] = map[param.name];
} }
} }
log(headerParams); log(headerParams);
_ref8 = form.find('input[type~="file"]'); _ref3 = form.find('input[type~="file"]');
for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) { for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
el = _ref8[_l]; el = _ref3[_l];
bodyParam.append($(el).attr('name'), el.files[0]); bodyParam.append($(el).attr('name'), el.files[0]);
} }
log(bodyParam); log(bodyParam);
@@ -1814,14 +1814,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
}; };
OperationView.prototype.getSelectedValue = function(select) { OperationView.prototype.getSelectedValue = function(select) {
var opt, options, _i, _len, _ref5; var opt, options, _i, _len, _ref;
if (!select.multiple) { if (!select.multiple) {
return select.value; return select.value;
} else { } else {
options = []; options = [];
_ref5 = select.options; _ref = select.options;
for (_i = 0, _len = _ref5.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
opt = _ref5[_i]; opt = _ref[_i];
if (opt.selected) { if (opt.selected) {
options.push(opt.value); options.push(opt.value);
} }
@@ -1909,9 +1909,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
padding = ''; padding = '';
indent += transitions[fromTo]; indent += transitions[fromTo];
padding = ((function() { padding = ((function() {
var _j, _ref5, _results; var _j, _ref, _results;
_results = []; _results = [];
for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) { for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) {
_results.push(' '); _results.push(' ');
} }
return _results; return _results;
@@ -1984,11 +1984,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
StatusCodeView = (function(_super) { StatusCodeView = (function(_super) {
__extends(StatusCodeView, _super); __extends(StatusCodeView, _super);
function StatusCodeView() { function StatusCodeView() {
_ref5 = StatusCodeView.__super__.constructor.apply(this, arguments); StatusCodeView.__super__.constructor.apply(this, arguments);
return _ref5;
} }
StatusCodeView.prototype.initialize = function() {}; StatusCodeView.prototype.initialize = function() {};
@@ -2009,11 +2009,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ParameterView = (function(_super) { ParameterView = (function(_super) {
__extends(ParameterView, _super); __extends(ParameterView, _super);
function ParameterView() { function ParameterView() {
_ref6 = ParameterView.__super__.constructor.apply(this, arguments); ParameterView.__super__.constructor.apply(this, arguments);
return _ref6;
} }
ParameterView.prototype.initialize = function() { ParameterView.prototype.initialize = function() {
@@ -2098,11 +2098,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
SignatureView = (function(_super) { SignatureView = (function(_super) {
__extends(SignatureView, _super); __extends(SignatureView, _super);
function SignatureView() { function SignatureView() {
_ref7 = SignatureView.__super__.constructor.apply(this, arguments); SignatureView.__super__.constructor.apply(this, arguments);
return _ref7;
} }
SignatureView.prototype.events = { SignatureView.prototype.events = {
@@ -2167,11 +2167,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ContentTypeView = (function(_super) { ContentTypeView = (function(_super) {
__extends(ContentTypeView, _super); __extends(ContentTypeView, _super);
function ContentTypeView() { function ContentTypeView() {
_ref8 = ContentTypeView.__super__.constructor.apply(this, arguments); ContentTypeView.__super__.constructor.apply(this, arguments);
return _ref8;
} }
ContentTypeView.prototype.initialize = function() {}; ContentTypeView.prototype.initialize = function() {};
@@ -2193,11 +2193,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ResponseContentTypeView = (function(_super) { ResponseContentTypeView = (function(_super) {
__extends(ResponseContentTypeView, _super); __extends(ResponseContentTypeView, _super);
function ResponseContentTypeView() { function ResponseContentTypeView() {
_ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments); ResponseContentTypeView.__super__.constructor.apply(this, arguments);
return _ref9;
} }
ResponseContentTypeView.prototype.initialize = function() {}; ResponseContentTypeView.prototype.initialize = function() {};
@@ -2219,11 +2219,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
})(Backbone.View); })(Backbone.View);
ParameterContentTypeView = (function(_super) { ParameterContentTypeView = (function(_super) {
__extends(ParameterContentTypeView, _super); __extends(ParameterContentTypeView, _super);
function ParameterContentTypeView() { function ParameterContentTypeView() {
_ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments); ParameterContentTypeView.__super__.constructor.apply(this, arguments);
return _ref10;
} }
ParameterContentTypeView.prototype.initialize = function() {}; ParameterContentTypeView.prototype.initialize = function() {};

File diff suppressed because one or more lines are too long

125
src/main/html/css/reset.css Normal file
View File

@@ -0,0 +1,125 @@
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
<head> <head>
<title>Swagger UI</title> <title>Swagger UI</title>
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/> <link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link href='css/highlight.default.css' media='screen' rel='stylesheet' type='text/css'/> <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/> <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<script type="text/javascript" src="lib/shred.bundle.js"></script> <script type="text/javascript" src="lib/shred.bundle.js"></script>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script> <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
@@ -61,7 +61,7 @@
</script> </script>
</head> </head>
<body> <body class="swagger-section">
<div id='header'> <div id='header'>
<div class="swagger-ui-wrap"> <div class="swagger-ui-wrap">
<a id="logo" href="http://swagger.wordnik.com">swagger</a> <a id="logo" href="http://swagger.wordnik.com">swagger</a>

View File

@@ -1,3 +1,5 @@
.swagger-section {
.title { .title {
font-style: bold; font-style: bold;
} }
@@ -76,4 +78,6 @@
} }
.api-popup-actions { .api-popup-actions {
padding-top: 10px; padding-top: 10px;
}
} }

View File

@@ -1,8 +1,6 @@
/* /* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> .swagger-section {
*/
pre code { pre code {
display: block; padding: 0.5em; display: block; padding: 0.5em;
@@ -133,3 +131,5 @@ pre .xml .css,
pre .xml .cdata { pre .xml .cdata {
opacity: 0.5; opacity: 0.5;
} }
}

View File

@@ -1,4 +1,5 @@
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
html, body, div, span, applet, object, iframe, html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, a, abbr, acronym, address, big, cite, code,

View File

@@ -1,7 +1,9 @@
@import 'src/main/less/reset.less'; @import 'src/main/less/highlight_default.less';
@import 'src/main/less/specs.less'; @import 'src/main/less/specs.less';
@import 'src/main/less/auth.less'; @import 'src/main/less/auth.less';
.swagger-section {
.access { .access {
float: right; float: right;
} }
@@ -132,4 +134,6 @@
min-height: 30px; min-height: 30px;
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
}
} }

View File

@@ -1,3 +1,5 @@
.swagger-section {
.swagger-ui-wrap { .swagger-ui-wrap {
line-height: 1; line-height: 1;
@@ -1040,5 +1042,6 @@
} }
} }
} }
}
} }