This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: ` | |
<div class="uk-clearfix"> | |
<input class="uk-hidden" type="file" multiple="multiple" @change="changeFiles($event)" /> | |
<div class="uk-flex uk-margin-small-bottom" v-for="(key, item) in model.files"> | |
<img class="image" :src="item.url.replace('a.storyblok.com', 'img2.storyblok.com/160x90/filters:fill(auto,0)')"> | |
<input type="text" class="uk-form-small uk-flex-item-auto" v-model=item.url> | |
<button @click.prevent="removeFile(key)" class="uk-button uk-button-small uk-margin-small-left"><i class="uk-icon-close"></i></button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div><select class="uk-width-1-1" v-model="model.value"> | |
<option :key="option.value" v-for="option in options">{{ option.name }}</option> | |
</select></div>`, | |
data() { | |
return { | |
options: [] | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Sortable = require('sortablejs') | |
module.exports = { | |
update: function (val) { | |
var self = this | |
this.sortable = Sortable.create(this.el, { | |
animation: 150, | |
handle: '.sortable__handle', | |
onStart: function (e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: ` | |
<div>Google snippet preview: | |
<div style="margin:5px 0 15px;padding:10px;color:#000;background:#fff"> | |
<div style="color:blue;text-decoration:underline">{{ model.title }}</div> | |
<div style="color:green">yoursite.com/example</div> | |
<div>{{ model.description }}</div> | |
</div> | |
<div class=uk-form-row> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async asyncData({app, store}) { | |
let [article, authors] = await Promise.all([ | |
app.$storyapi.get('cdn/stories/article', { | |
cv: store.state.cacheVersion | |
}), | |
app.$storyapi.get('cdn/stories', { | |
starts_with: 'authors/', | |
cv: store.state.cacheVersion | |
}) | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.$storyapi.get('cdn/stories/article', { | |
cv: store.state.cacheVersion, | |
resolve_links: '1' | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<div class="uk-margin-bottom uk-text-center" v-if="model.icon"> | |
Current icon: <i :class="model.type + ' ' + model.icon"></i> | |
<small style="cursor:pointer;" @click="removeIcon">(remove)</small> | |
</div> | |
<input class="uk-width-1-1 uk-margin-bottom" v-model="search" placeholder="Search icons" /> | |
<span class="icon-link" @click="setIcon(icon)" :key="icon.icon" v-for="icon in filteredIcons" style="margin: 5px; display: inline-block;"> | |
<i style="cursor:pointer;" :class="icon.type + ' ' + icon.icon"></i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<div class="uk-margin-bottom uk-text-center" v-if="model.icon"> | |
Current icon: <i :class="model.type + ' ' + model.icon"></i> | |
<small style="cursor:pointer;" @click="removeIcon">(remove)</small> | |
</div> | |
<input class="uk-width-1-1 uk-margin-bottom" v-model="search" placeholder="Search icons" /> | |
<span class="icon-link" @click="setIcon(icon)" :key="icon.icon" v-for="icon in filteredIcons" style="margin: 5px; display: inline-block;"> | |
<i style="cursor:pointer;" :class="icon.type + ' ' + icon.icon"></i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch( | |
`https://mapi.storyblok.com/v1/spaces/${SPACE_ID}/stories`, | |
{ | |
method: "POST", | |
mode: "cors", | |
headers: { | |
"Content-Type": "application/json", | |
"Authorization": POWER_TOKEN | |
}, | |
body: JSON.stringify({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<sb-asset-selector :uid="uid" field="image"></sb-asset-selector> | |
<input type="text" class="uk-margin-top uk-width-1-1" v-model="model.image" /> | |
</div>`, | |
methods: { | |
initWith() { | |
return { | |
plugin: 'example_plugin', |