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

[Examples] Fix vue dependancy in xkcdsearch index html #418

Merged
merged 1 commit into from
Feb 8, 2022
Merged
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
77 changes: 41 additions & 36 deletions _examples/xkcdsearch/web/index.html
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<title>xkcdsearch</title>
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="style.css">
<title>xkcdsearch</title>
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII="
rel="icon" type="image/x-icon">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div v-bind:class="{loading:state.loading}" id="app" v-cloak>
<div id="app" v-bind:class="{loading:state.loading}" v-cloak>
<div id="search-form">
<form v-on:submit.prevent="">
<input v-model.lazy="query" type="text" size="50" placeholder="Search...">
</form>
<p class="total"><span class="label"># results/</span><span class="content">{{ total }}</span></p>
<form v-on:submit.prevent="">
<input placeholder="Search..." size="50" type="text" v-model.lazy="query">
</form>
<p class="total"><span class="label"># results/</span><span class="content">{{ total }}</span></p>
</div>

<div v-if="total < 1 && !state.loading" class="no-results">
<p>Sorry, no results for your query&hellip;</p>
<div class="no-results" v-if="total < 1 && !state.loading">
<p>Sorry, no results for your query&hellip;</p>
</div>

<div v-for="result in results" v-bind:id="result.id" :key="result.id" class="result">
<h2>
<span v-html="result.title" class="title"></span>
<span class="published">/{{ result.published }}/</span>
</h2>
<div class="highlights">
<p v-show="result.alt" class="alt">
<span class="label">Alt/</span>
<span v-html="result.alt" class="content"></span>
</p>
<p v-show="result.transcript" class="transcript">
<span class="label">Transcript/</span>
<span v-html="result.transcript" class="content"></span>
</p>
</div>
<a v-bind:href="result.url" v-bind:title="result.alt">
<img v-bind:src="result.image_url" v-bind:alt="result.alt" v-on:mouseover="toggle($event)" v-on:mouseout="toggle($event)">
</a>
<div :key="result.id" class="result" v-bind:id="result.id" v-for="result in results">
<h2>
<span class="title" v-html="result.title"></span>
<span class="published">/{{ result.published }}/</span>
</h2>
<div class="highlights">
<p class="alt" v-show="result.alt">
<span class="label">Alt/</span>
<span class="content" v-html="result.alt"></span>
</p>
<p class="transcript" v-show="result.transcript">
<span class="label">Transcript/</span>
<span class="content" v-html="result.transcript"></span>
</p>
</div>
<a v-bind:href="result.url" v-bind:title="result.alt">
<img v-bind:alt="result.alt" v-bind:src="result.image_url" v-on:mouseout="toggle($event)"
v-on:mouseover="toggle($event)">
</a>
</div>
<p v-show="state.fetching" id="loading-results">Loading results...</p>
<p id="loading-results" v-show="state.fetching">Loading results...</p>

<p v-show="state.loading" id="loading-app">Loading the application...</p>
<p v-if="state.error" id="app-error">[{{ state.error.status }}] {{ state.error.statusText }}</p>
</div>
<p id="loading-app" v-show="state.loading">Loading the application...</p>
<p id="app-error" v-if="state.error">[{{ state.error.status }}] {{ state.error.statusText }}</p>
</div>

<a href="https://github.com/elastic/go-elasticsearch/tree/master/_examples/xkcd" title="See the source code at GitHub" style="position: fixed; top: 0; right: 0; border: 0; display: inline-block;"><img src="/assets/images/github-ribbon.svg" width="50px" height="50px" alt=""></a>
<a href="https://github.com/elastic/go-elasticsearch/tree/master/_examples/xkcd"
style="position: fixed; top: 0; right: 0; border: 0; display: inline-block;"
title="See the source code at GitHub"><img alt="" height="50px" src="/assets/images/github-ribbon.svg" width="50px"></a>

<a href="https://xkcd.com/license.html" style="position: fixed; bottom: 0; right: 0; border: 0; display: inline-block;"><img src="https://mirrors.creativecommons.org/presskit/buttons/80x15/png/by-nc.png" height="15px"></img></a>
<a href="https://xkcd.com/license.html" style="position: fixed; bottom: 0; right: 0; border: 0; display: inline-block;"><img
height="15px" src="https://mirrors.creativecommons.org/presskit/buttons/80x15/png/by-nc.png"></img></a>

<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="/application.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<script src="/application.js"></script>
</body>
</html>