Skip to content

Commit

Permalink
URL will get updated on navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen1 committed May 9, 2014
1 parent e21f30c commit da30d1e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 33 deletions.
4 changes: 4 additions & 0 deletions app/libs/swagger-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ function clippyCopiedCallback(a) {

// Logging function that accounts for browsers that don't have window.console
log = function(){

// Don't log in production
if(!SwaggerUi) return

log.history = log.history || [];
log.history.push(arguments);
if(this.console){
Expand Down
28 changes: 6 additions & 22 deletions app/libs/swagger-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function program14(depth0,data) {
function program16(depth0,data) {


return "\n <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 "\n <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 ";
}

function program18(depth0,data) {
Expand All @@ -217,7 +217,7 @@ function program20(depth0,data) {
if (helper = helpers.nickname) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.nickname); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";
+ "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#/";
if (helper = helpers.parentId) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.parentId); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
Expand All @@ -229,7 +229,7 @@ function program20(depth0,data) {
if (helper = helpers.method) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.method); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "</a>\n </span>\n <span class='path'>\n <a href='#!/";
+ "</a>\n </span>\n <span class='path'>\n <a href='#/";
if (helper = helpers.parentId) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.parentId); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
Expand All @@ -241,7 +241,7 @@ function program20(depth0,data) {
if (helper = helpers.path) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.path); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";
+ "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#/";
if (helper = helpers.parentId) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.parentId); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
Expand Down Expand Up @@ -872,31 +872,15 @@ function program1(depth0,data) {
if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "' id='endpointListTogger_";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "'\n onclick=\"Docs.toggleEndpointListForResource('";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "');\">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";
buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "'); return false;\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.expandOperationsForResource('";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "'); return false;\">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='";
if (helper = helpers.url) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.url); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
+ "'>Raw</a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";
+ "'); return false;\">\n Expand Operations\n </a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
buffer += escapeExpression(stack1)
Expand Down
4 changes: 4 additions & 0 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ PhonicsApp.config(['$routeProvider', function ($routeProvider) {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/:resource/:id', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
Expand Down
8 changes: 4 additions & 4 deletions app/swagger-ui/main/template/operation.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<div class='heading'>
<h3>
<span class='http_method'>
<a href='#!/{{parentId}}/{{nickname}}' class="toggleOperation">{{method}}</a>
<a href='#/{{parentId}}/{{nickname}}' class="toggleOperation">{{method}}</a>
</span>
<span class='path'>
<a href='#!/{{parentId}}/{{nickname}}' class="toggleOperation">{{path}}</a>
<a href='#/{{parentId}}/{{nickname}}' class="toggleOperation">{{path}}</a>
</span>
</h3>
<ul class='options'>
<li>
<a href='#!/{{parentId}}/{{nickname}}' class="toggleOperation">{{{summary}}}</a>
<a href='#/{{parentId}}/{{nickname}}' class="toggleOperation">{{{summary}}}</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -74,7 +74,7 @@
</tr>
</thead>
<tbody class="operation-status">

</tbody>
</table>
{{/if}}
Expand Down
7 changes: 0 additions & 7 deletions app/swagger-ui/main/template/resource.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<a href='#!/{{id}}' onclick="Docs.toggleEndpointListForResource('{{id}}');">{{name}}</a> {{#description}} : {{/description}}{{{description}}}
</h2>
<ul class='options'>
<li>
<a href='#!/{{id}}' id='endpointListTogger_{{id}}'
onclick="Docs.toggleEndpointListForResource('{{id}}');">Show/Hide</a>
</li>
<li>
<a href='#' onclick="Docs.collapseOperationsForResource('{{id}}'); return false;">
List Operations
Expand All @@ -17,9 +13,6 @@
Expand Operations
</a>
</li>
<li>
<a href='{{url}}'>Raw</a>
</li>
</ul>
</div>
<ul class='endpoints' id='{{id}}_endpoint_list' style='display:none'>
Expand Down

0 comments on commit da30d1e

Please sign in to comment.