swagger ui styling

This commit is contained in:
Athou
2013-04-19 16:52:16 +02:00
parent 873aef829f
commit a61ac4b0fb
3 changed files with 36 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
.signature-container .description span {
margin-left: 5px;
}
.signature-container .description .model-desc {
font-weight: bold;
color: #000;
font-size: 1.1em;
}
.signature-container .description .class-desc {
font-weight: bold;
color: #000;
font-size: 1.0em;
margin-left: 0px;
}
.signature-container .description ul {
margin-left: 20px;
list-style: disc;
}

View File

@@ -5,6 +5,7 @@
<link href='//fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link href='css/hightlight.default.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/custom.css' media='screen' rel='stylesheet' type='text/css'/>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>

View File

@@ -332,15 +332,15 @@
prop = _ref[_i];
propertiesStr.push(prop.toString());
}
strong = '<span style="font-weight: bold; color: #000; font-size: 1.0em">';
stronger = '<span style="font-weight: bold; color: #000; font-size: 1.1em">';
strongClose = '</span>';
classOpen = strong + 'class ' + this.name + '(' + strongClose;
classClose = strong + ')' + strongClose;
returnVal = classOpen + '<span>' + propertiesStr.join('</span>, <span>') + '</span>' + classClose;
if (prefix != null) {
returnVal = stronger + prefix + strongClose + '<br/>' + returnVal;
}
strong = '<div class="class-desc">';
stronger = '<div class="model-desc">';
strongClose = '</div>';
classOpen = strong + 'class ' + this.name + strongClose;
classClose = '';
returnVal = classOpen + '<ul><li class="prop-desc">' + propertiesStr.join('</li><li class="prop-desc">') + '</li></ul>' + classClose;
// if (prefix != null) {
// returnVal = stronger + prefix + strongClose + returnVal;
// }
if (!modelsToIgnore) {
modelsToIgnore = [];
}
@@ -415,12 +415,14 @@
SwaggerModelProperty.prototype.toString = function() {
var str;
str = this.name + ': ' + this.dataTypeWithRef;
str = this.name;
if (this.values != null) {
str += " = ['" + this.values.join("' or '") + "']";
str += " ('" + this.values.join("' or '") + "')";
} else {
str += ' (' + this.dataTypeWithRef + ')';
}
if (this.descr != null) {
str += ' {' + this.descr + '}';
str += ' - ' + this.descr;
}
return str;
};