1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-25 00:02:28 +02:00

2.18.0 Add ai icon to content pages

This commit is contained in:
trendschau
2025-06-17 21:45:32 +02:00
parent 437b9caced
commit f3fc6b3e3c
5 changed files with 43 additions and 8 deletions

2
cache/timer.yaml vendored
View File

@@ -1 +1 @@
licenseupdate: 1748718958
licenseupdate: 1750186868

View File

@@ -1,6 +1,12 @@
const bloxeditor = Vue.createApp({
template: `<div v-if="editorVisible" class="px-2 lg:px-12 py-8 bg-stone-50 dark:bg-stone-700 dark:text-stone-200 shadow-md mb-16">
<div class="absolute top-0 right-0">
<button
@click.prevent="openkixoteai()"
class="mr-1 px-2 py-2 bg-stone-50 border-b-2 border-stone-50 hover:bg-stone-200 dark:text-stone-200 dark:bg-stone-700 dark:border-stone-600 hover:dark:bg-stone-200 hover:dark:text-stone-900 transition duration-100"
>
<svg class="icon icon-magic-wand"><use xlink:href="#icon-magic-wand"></use></svg>
</button>
<button
@click.prevent="openmedialib()"
class="px-2 py-2 bg-stone-50 border-b-2 border-stone-50 hover:bg-stone-200 dark:text-stone-200 dark:bg-stone-700 dark:border-stone-600 hover:dark:bg-stone-200 hover:dark:text-stone-900 transition duration-100"
@@ -69,6 +75,10 @@ const bloxeditor = Vue.createApp({
});
},
methods: {
openkixoteai()
{
eventBus.$emit('startAi');
},
openmedialib()
{
this.showmedialib = true;

View File

@@ -150,6 +150,7 @@ const kixote = Vue.createApp({
loading: false,
item: data.item,
content: data.content,
switchToGenerateTab: false,
navigation: data.navigation,
urlinfo: data.urlinfo,
labels: data.labels,
@@ -161,6 +162,8 @@ const kixote = Vue.createApp({
},
mounted() {
eventBus.$on('startAi', this.startAi);
eventBus.$on('kiExit', this.stopKixote);
eventBus.$on('kiScrollBottom', this.scrollToBottom);
@@ -278,6 +281,7 @@ const kixote = Vue.createApp({
self.aiservice = response.data.aiservice;
self.tokenstats = response.data.tokenstats;
self.useragreement = response.data.useragreement;
self.afterContentLoaded();
}
})
.catch(function (error)
@@ -292,6 +296,19 @@ const kixote = Vue.createApp({
{
this.showKixote = true;
},
startAi()
{
this.showKixote = true;
this.switchToGenerateTab = true;
},
afterContentLoaded()
{
if(this.switchToGenerateTab)
{
this.currentTab = "Generate";
this.switchToGenerateTab = false;
}
},
stopKixote()
{
this.showKixote = false;
@@ -321,12 +338,6 @@ const kixote = Vue.createApp({
{
this.settingsSaved = false;
this.kixoteSettings = newSettings;
/*
this.kixoteSettings = { ...this.kixoteSettings, ...newSettings };
console.info("this.settings after merge");
console.info(this.kixoteSettings);
*/
},
storeKixoteSettings()
{

View File

@@ -1,6 +1,12 @@
const raweditor = Vue.createApp({
template: `<fieldset v-if="showraw" class="lg:px-12 py-8 bg-stone-50 dark:bg-stone-700 dark:text-stone-200 shadow-md mb-16">
<div class="absolute top-0 right-0">
<button
@click.prevent="openkixoteai()"
class="mr-1 px-2 py-2 bg-stone-50 border-b-2 border-stone-50 hover:bg-stone-200 dark:text-stone-200 dark:bg-stone-700 dark:border-stone-600 hover:dark:bg-stone-200 hover:dark:text-stone-900 transition duration-100"
>
<svg class="icon icon-magic-wand"><use xlink:href="#icon-magic-wand"></use></svg>
</button>
<button
@click.prevent="openmedialib()"
class="px-2 py-2 bg-stone-50 border-b-2 border-stone-50 hover:bg-stone-200 dark:text-stone-200 dark:bg-stone-700 dark:border-stone-600 hover:dark:bg-stone-200 hover:dark:text-stone-900 transition duration-100"
@@ -74,6 +80,10 @@ const raweditor = Vue.createApp({
},
methods: {
openkixoteai()
{
eventBus.$emit('startAi');
},
openmedialib()
{
this.showmedialib = true;

View File

@@ -1,4 +1,4 @@
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg style="display:none; position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-pencil" viewBox="0 0 32 32">
@@ -166,6 +166,10 @@
<title>{{ translate('CLOSE') }}</title>
<path d="M10.707 7.050l-0.707-0.707-5.657 5.657 1.414 1.414 4.243-4.242 4.243 4.242 1.414-1.414z"></path>
</symbol>
<symbol id="icon-magic-wand" viewBox="0 0 32 32">
<title>{{ translate('AI') }}</title>
<path d="M8 6l-4-4h-2v2l4 4zM10 0h2v4h-2zM18 10h4v2h-4zM20 4v-2h-2l-4 4 2 2zM0 10h4v2h-4zM10 18h2v4h-2zM2 18v2h2l4-4-2-2zM31.563 27.563l-19.879-19.879c-0.583-0.583-1.538-0.583-2.121 0l-1.879 1.879c-0.583 0.583-0.583 1.538 0 2.121l19.879 19.879c0.583 0.583 1.538 0.583 2.121 0l1.879-1.879c0.583-0.583 0.583-1.538 0-2.121zM15 17l-6-6 2-2 6 6-2 2z"></path>
</symbol>
{{ assets.renderSvg() }}
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB