Compare commits
4 Commits
2b25c13095
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2111cfa1d1 | |||
| c8d1639afa | |||
| 43e11178db | |||
| 4828a68bcd |
@ -6,6 +6,8 @@ let TranslationFormHook = {
|
|||||||
this.tunit_editor = this.el.querySelector("#tunit-editor-content")
|
this.tunit_editor = this.el.querySelector("#tunit-editor-content")
|
||||||
this.save_edit_button = this.el.querySelector("#save-edit-button")
|
this.save_edit_button = this.el.querySelector("#save-edit-button")
|
||||||
this.save_publish_button = this.el.querySelector("#save-publish-button")
|
this.save_publish_button = this.el.querySelector("#save-publish-button")
|
||||||
|
let article_preview_links = document.querySelectorAll(".article-preview a")
|
||||||
|
article_preview_links.forEach(el => el.addEventListener('click', e => e.preventDefault()))
|
||||||
},
|
},
|
||||||
keyupHandler(e) {
|
keyupHandler(e) {
|
||||||
var push_event = true
|
var push_event = true
|
||||||
|
|||||||
@ -10,7 +10,7 @@ defmodule Outlook.InternalTree.RawInternalBasic do
|
|||||||
|
|
||||||
@splitmarker "@@translationunit@@"
|
@splitmarker "@@translationunit@@"
|
||||||
@nonperiodmarker "@@nonperiod@@"
|
@nonperiodmarker "@@nonperiod@@"
|
||||||
@void_elements ~w(img br hr)
|
@void_elements ~w(img br hr iframe)
|
||||||
|
|
||||||
def set_split_markers([ %InternalNode{type: :text} = textnode | rest ]) do
|
def set_split_markers([ %InternalNode{type: :text} = textnode | rest ]) do
|
||||||
[ %InternalNode{textnode |
|
[ %InternalNode{textnode |
|
||||||
|
|||||||
@ -52,7 +52,7 @@ defmodule Outlook.InternalTree.TunitModifications do
|
|||||||
end
|
end
|
||||||
[%InternalNode{node| content: content} | apply_modifier(rest, modifier, tu_ids)]
|
[%InternalNode{node| content: content} | apply_modifier(rest, modifier, tu_ids)]
|
||||||
end
|
end
|
||||||
def apply_modifier([node, rest], modifier, tu_ids), do: [node | apply_modifier(rest, modifier, tu_ids)]
|
def apply_modifier([node | rest], modifier, tu_ids), do: [node | apply_modifier(rest, modifier, tu_ids)]
|
||||||
def apply_modifier([],_, _), do: []
|
def apply_modifier([],_, _), do: []
|
||||||
|
|
||||||
def process_tunit_list(tunits, modifier, tu_ids) do
|
def process_tunit_list(tunits, modifier, tu_ids) do
|
||||||
|
|||||||
@ -9,7 +9,7 @@ defmodule OutlookWeb.DarkModeComponent do
|
|||||||
|
|
||||||
def dark_mode_widget(assigns) do
|
def dark_mode_widget(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<div id="dark-mode-widget" class="absolute flex w-full justify-between p-0" phx-hook="dark_mode_widget">
|
<div id="dark-mode-widget" class="relative flex w-full justify-between p-0" phx-hook="dark_mode_widget">
|
||||||
<div class="flex"></div>
|
<div class="flex"></div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<button class="p-2" type="button">
|
<button class="p-2" type="button">
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<.dark_mode_widget />
|
<.dark_mode_widget />
|
||||||
</header>
|
</header>
|
||||||
<main class="px-2 py-4 sm:px-6 lg:px-8">
|
<main class="px-2 sm:px-6 lg:px-8">
|
||||||
<div class="mx-auto max-w-xl">
|
<div class="mx-auto max-w-xl">
|
||||||
<.flash kind={:info} title="Success!" flash={@flash} />
|
<.flash kind={:info} title="Success!" flash={@flash} />
|
||||||
<.flash kind={:error} title="Error!" flash={@flash} />
|
<.flash kind={:error} title="Error!" flash={@flash} />
|
||||||
|
|||||||
@ -51,7 +51,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
|||||||
</.simple_form>
|
</.simple_form>
|
||||||
<.tunit_editor current_tunit={@current_tunit} target={@myself} />
|
<.tunit_editor current_tunit={@current_tunit} target={@myself} />
|
||||||
</div>
|
</div>
|
||||||
<div class="article basis-1/2 max-h-screen overflow-auto">
|
<div class="article article-preview basis-1/2 max-h-screen overflow-auto">
|
||||||
<.button phx-disable-with="Translating..." phx-click="translate-deepl" phx-target={@myself}
|
<.button phx-disable-with="Translating..." phx-click="translate-deepl" phx-target={@myself}
|
||||||
data-confirm-not="Are you sure? All previously translated text will be lost.">Translate with Deepl</.button>
|
data-confirm-not="Are you sure? All previously translated text will be lost.">Translate with Deepl</.button>
|
||||||
<progress :if={@deepl_progress} max="100" value={@deepl_progress} />
|
<progress :if={@deepl_progress} max="100" value={@deepl_progress} />
|
||||||
|
|||||||
Reference in New Issue
Block a user