Updated the build
This commit is contained in:
@@ -14,9 +14,9 @@
|
||||
</head>
|
||||
<body>
|
||||
<form id='api_selector'>
|
||||
<li><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text" /></li>
|
||||
<li><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text" /></li>
|
||||
<li><a id="explore" href="#">Explore</a></li>
|
||||
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text" /></div>
|
||||
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text" /></div>
|
||||
<div class='input'><a id="explore" href="#">Explore</a></div>
|
||||
</form>
|
||||
<div class='container' id='resources_container'>
|
||||
<ul id='resources'></ul>
|
||||
@@ -136,5 +136,9 @@
|
||||
<td width='500'>${description}</td>
|
||||
</tr>
|
||||
</script>
|
||||
<p id='colophon'>
|
||||
Sexy API documentation from
|
||||
<a href="http://swagger.wordnik.com">Swagger</a>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -24,6 +24,22 @@ jQuery(function($) {
|
||||
}
|
||||
|
||||
$("a#explore").click(this.showApi);
|
||||
|
||||
this.adaptToScale();
|
||||
$(window).resize(function() {
|
||||
apiSelectionController.adaptToScale();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
adaptToScale: function() {
|
||||
var form_width = $('form#api_selector').width();
|
||||
var inputs_width = 0;
|
||||
$('form#api_selector div.input').each( function(){ inputs_width += $(this).outerWidth(); });
|
||||
|
||||
// Update with of baseUrl input
|
||||
var free_width = form_width - inputs_width;
|
||||
$('#input_baseUrl').width($('#input_baseUrl').width() + free_width - 50);
|
||||
},
|
||||
|
||||
slapOn: function() {
|
||||
@@ -315,8 +331,9 @@ jQuery(function($) {
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Attach controller to window
|
||||
window.apiSelectionController = ApiSelectionController.init();
|
||||
|
||||
if (this.baseUrl) {
|
||||
window.resourceListController = ResourceListController.init({
|
||||
baseUrl: this.baseUrl,
|
||||
|
||||
@@ -278,46 +278,59 @@ form.fullwidth ol li.string input, form.fullwidth ol li.url input, form.fullwidt
|
||||
width: 500px !important; }
|
||||
|
||||
body {
|
||||
font-family: "Droid Sans", sans-serif;
|
||||
margin: 20px; }
|
||||
font-family: "Droid Sans", sans-serif; }
|
||||
body #content_message {
|
||||
margin: 10px 0;
|
||||
margin: 10px 15px;
|
||||
font-style: italic;
|
||||
color: #999999; }
|
||||
body form#api_selector {
|
||||
background-color: #89bf04;
|
||||
padding: 15px;
|
||||
float: none;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
display: block; }
|
||||
body form#api_selector li {
|
||||
body form#api_selector .input {
|
||||
display: block;
|
||||
clear: none;
|
||||
float: left;
|
||||
margin: 0 10px 0 0; }
|
||||
body form#api_selector li input {
|
||||
body form#api_selector .input input {
|
||||
font-size: 1em;
|
||||
padding: 3px; }
|
||||
body form#api_selector li input#input_baseUrl {
|
||||
body form#api_selector .input input#input_baseUrl {
|
||||
width: 500px; }
|
||||
body form#api_selector li input#input_apiKey {
|
||||
width: 150px; }
|
||||
body form#api_selector li a#explore {
|
||||
body form#api_selector .input input#input_apiKey {
|
||||
width: 250px; }
|
||||
body form#api_selector .input a#explore {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
padding: 8px 8px;
|
||||
font-size: 0.9em;
|
||||
color: white;
|
||||
background-color: #89bf04;
|
||||
background-color: #547f00;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
border-radius: 4px; }
|
||||
body form#api_selector li a#explore:hover {
|
||||
body form#api_selector .input a#explore:hover {
|
||||
background-color: #547f00; }
|
||||
body p#colophon {
|
||||
margin: 0 15px 40px 15px;
|
||||
padding: 10px 0;
|
||||
font-size: 0.8em;
|
||||
border-top: 1px solid #dddddd;
|
||||
font-family: "Droid Sans", sans-serif;
|
||||
color: #999999;
|
||||
font-style: italic; }
|
||||
body p#colophon a {
|
||||
text-decoration: none;
|
||||
color: #547f00; }
|
||||
body ul#resources {
|
||||
padding: 0 15px;
|
||||
font-family: "Droid Sans", sans-serif;
|
||||
font-size: 0.9em; }
|
||||
body ul#resources li.resource {
|
||||
|
||||
Reference in New Issue
Block a user