Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/click on return type in dynamic html #716

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
function main() {}

window.onhashchange = function() {
choose(window.location.href.toString());
}

var url = 'http://motyar.blogspot.com/search?q={term}', selectionImage;

function showModel(e, model) {
}
var selectionImage;

function choose(url) {
var f = url.split("/").slice(-1)[0].split("?")[0];
Expand All @@ -20,8 +15,8 @@ function choose(url) {
// rebind the models
$(".model a").on("click", function(e){
e.preventDefault();
var model = $(this).parent().attr("id")
var parentOffset = $(this).parent().offset();
var model = $(this).parent().attr("data-model")
var parentOffset = $(this).parent().offset();
var encodedWord = encodeURI(model);

if(!selectionImage) {
Expand All @@ -33,7 +28,7 @@ function choose(url) {
$('div.model-container').append(selectionImage);
}

selectionImage.load("/models/" + encodedWord + ".html")
selectionImage.load("models/" + encodedWord + ".html")
selectionImage.attr('href',url.replace('{term}',encodeURI(model))).css({
left: e.pageX + 20,
top: e.pageY - 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h3 class="section">HTTP Method</h3>
<code>{{httpMethod}}</code>
<h3 class="section">Response Type</h3>
<div class="model" id="{{returnBaseType}}"><a href="#">{{returnType}}</a></div>
<div class="model" data-model="{{returnBaseType}}"><a href="">{{returnType}}</a></div>
<h3 class="section">Parameters</h3>
<ul>
{{#allParams}}
Expand Down
13 changes: 4 additions & 9 deletions samples/dynamic-html/docs/assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
function main() {}

window.onhashchange = function() {
choose(window.location.href.toString());
}

var url = 'http://motyar.blogspot.com/search?q={term}', selectionImage;

function showModel(e, model) {
}
var selectionImage;

function choose(url) {
var f = url.split("/").slice(-1)[0].split("?")[0];
Expand All @@ -20,8 +15,8 @@ function choose(url) {
// rebind the models
$(".model a").on("click", function(e){
e.preventDefault();
var model = $(this).parent().attr("id")
var parentOffset = $(this).parent().offset();
var model = $(this).parent().attr("data-model")
var parentOffset = $(this).parent().offset();
var encodedWord = encodeURI(model);

if(!selectionImage) {
Expand All @@ -33,7 +28,7 @@ function choose(url) {
$('div.model-container').append(selectionImage);
}

selectionImage.load("/models/" + encodedWord + ".html")
selectionImage.load("models/" + encodedWord + ".html")
selectionImage.attr('href',url.replace('{term}',encodeURI(model))).css({
left: e.pageX + 20,
top: e.pageY - 10,
Expand Down
16 changes: 8 additions & 8 deletions samples/dynamic-html/docs/operations/PetApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -36,7 +36,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -59,7 +59,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="Pet"><a href="#">List</a></div>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -82,7 +82,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="Pet"><a href="#">List</a></div>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -105,7 +105,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="Pet"><a href="#">Pet</a></div>
<div class="model" data-model="Pet"><a href="">Pet</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -128,7 +128,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down Expand Up @@ -167,7 +167,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>DELETE</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down Expand Up @@ -198,7 +198,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down
8 changes: 4 additions & 4 deletions samples/dynamic-html/docs/operations/StoreApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="integer"><a href="#">Map</a></div>
<div class="model" data-model="integer"><a href="">Map</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -28,7 +28,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id="Order"><a href="#">Order</a></div>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -51,7 +51,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="Order"><a href="#">Order</a></div>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -74,7 +74,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>DELETE</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down
16 changes: 8 additions & 8 deletions samples/dynamic-html/docs/operations/UserApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -36,7 +36,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -62,7 +62,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -88,7 +88,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="string"><a href="#">String</a></div>
<div class="model" data-model="string"><a href="">String</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down Expand Up @@ -119,7 +119,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -134,7 +134,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" id="User"><a href="#">User</a></div>
<div class="model" data-model="User"><a href="">User</a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand All @@ -157,7 +157,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down Expand Up @@ -188,7 +188,7 @@ <h3 class="section">URL</h3>
<h3 class="section">HTTP Method</h3>
<code>DELETE</code>
<h3 class="section">Response Type</h3>
<div class="model" id=""><a href="#"></a></div>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>

Expand Down