Skip to content

Commit

Permalink
update: rework export window
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Nov 9, 2024
1 parent fccdd28 commit 7859df4
Show file tree
Hide file tree
Showing 31 changed files with 568 additions and 336 deletions.
102 changes: 102 additions & 0 deletions addon/chrome/content/exportNotes.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://zotero-platform/content/zotero.css" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://__addonRef__/content/styles/exportNotes.css" type="text/css"?>
<!-- prettier-ignore -->
<!DOCTYPE window>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="bn-export-notes"
data-l10n-id="title"
windowtype="__addonRef__-export-notes"
persist="screenX screenY width height sizemode"
style="min-width: 10em"
drawintitlebar-platforms="mac"
>
<xul:linkset>
<html:link rel="localization" href="browser/menubar.ftl" />
<html:link rel="localization" href="browser/browserSets.ftl" />
<html:link rel="localization" href="toolkit/global/textActions.ftl" />
<html:link rel="localization" href="zotero.ftl" />
<html:link rel="localization" href="__addonRef__-exportNotes.ftl" />
</xul:linkset>

<xul:commandset id="mainCommandSet">
<xul:command id="cmd_close" oncommand="window.close();" />
</xul:commandset>
<xul:keyset id="mainKeyset">
<xul:key
id="key_close"
data-l10n-id="close-shortcut"
command="cmd_close"
modifiers="accel"
reserved="true"
/>
</xul:keyset>

<script src="chrome://zotero/content/include.js"></script>
<script src="chrome://zotero/content/titlebar.js"></script>
<script src="chrome://zotero/content/customElements.js"></script>
<script src="chrome://__addonRef__/content/scripts/exportNotes.js"></script>

<dialog
buttons="accept, cancel, extra1"
buttonlabelextra1="Use System Export..."
>
<vbox>
<hbox>
<label id="target" data-l10n-id="target"></label>
</hbox>
<hbox align="center">
<label data-l10n-id="format" for="format"></label>
<menulist id="format" native="true">
<menupopup>
<menuitem
value="markdown"
data-l10n-id="format-markdown"
></menuitem>
<menuitem value="msword" data-l10n-id="format-msword"></menuitem>
<menuitem value="pdf" data-l10n-id="format-pdf"></menuitem>
<menuitem
value="freemind"
data-l10n-id="format-freemind"
></menuitem>
<menuitem value="note" data-l10n-id="format-note"></menuitem>
</menupopup>
</menulist>
</hbox>
<vbox>
<radiogroup id="linkMode" orient="vertical">
<radio value="keep" data-l10n-id="links-keep"></radio>
<radio value="embed" data-l10n-id="links-embed"></radio>
<radio value="standalone" data-l10n-id="links-standalone"></radio>
<!-- <radio value="remove" data-l10n-id="links-remove"></radio> -->
</radiogroup>
</vbox>
<vbox id="markdown-options">
<checkbox
id="markdown-autoSync"
data-l10n-id="markdown-autoSync"
native="true"
></checkbox>
<checkbox
id="markdown-withYAMLHeader"
data-l10n-id="markdown-withYAMLHeader"
native="true"
></checkbox>
<checkbox
id="markdown-autoFilename"
data-l10n-id="markdown-autoFilename"
native="true"
></checkbox>
</vbox>
</vbox>
</dialog>
</window>
5 changes: 5 additions & 0 deletions addon/chrome/content/preferences.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
native="true"
preference="__prefsPrefix__.openNote.defaultAsWindow"
/>
<checkbox
data-l10n-id="basic-exportNotes-takeover"
native="true"
preference="__prefsPrefix__.exportNotes.takeover"
/>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="editor-title"></html:h2></label>
Expand Down
8 changes: 8 additions & 0 deletions addon/chrome/content/styles/exportNotes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dialog {
-moz-window-dragging: drag;
}

#markdown-autoSync {
margin-inline-start: 18px;
margin-block-end: 24px;
}
2 changes: 0 additions & 2 deletions addon/locale/en-US/addon.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pref-title = Better Notes
menuItem-exportNote = Export Note
menuEdit-exportTemplate = Export Template to File...
menuEdit-templateEditor = Template Editor
menuEdit-importTemplate = New Template from Clipboard
Expand Down
25 changes: 0 additions & 25 deletions addon/locale/en-US/export.ftl

This file was deleted.

37 changes: 37 additions & 0 deletions addon/locale/en-US/exportNotes.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title =
.title = Export Notes with Better Notes
target =
.value = Target: {$title}{ $left ->
[0]{ "" }
*[other] { " " }and {$left} more.
}
format =
.value = Format:
format-markdown =
.label = MarkDown(.md)
format-msword =
.label = MS Word(.docx)
format-pdf =
.label = PDF(.pdf)
format-freemind =
.label = Mind Map
format-note =
.label = Zotero Note
links-keep =
.label = Keep note links(zotero://note/)
links-embed =
.label = Embed linked notes in the content
links-standalone =
.label = Convert linked notes to standalone exports
links-remove =
.label = Remove note links
markdown-autoSync =
.label = Set auto-sync for each note
.title = Auto-sync is available for "Convert linked notes to standalone exports" mode.
markdown-withYAMLHeader =
.label = With YAML header
markdown-autoFilename =
.label = Auto generate file name
2 changes: 2 additions & 0 deletions addon/locale/en-US/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ basic-openNote-takeover =
.label = Take over opening note
basic-openNote-defaultAsWindow =
.label = Open note as window by default
basic-exportNotes-takeover =
.label = Take over exporting notes
editor-title = Note Editor
editor-expandLevel-label = Outline expand to heading level
Expand Down
2 changes: 0 additions & 2 deletions addon/locale/it-IT/addon.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pref-title = Better Notes
menuItem-exportNote = Esporta nota
menuEdit-exportTemplate = Esporta il template su file...
menuEdit-templateEditor = Editor dei template
menuEdit-importTemplate = Nuovo template dagli appunti
Expand Down
25 changes: 0 additions & 25 deletions addon/locale/it-IT/export.ftl

This file was deleted.

37 changes: 37 additions & 0 deletions addon/locale/it-IT/exportNotes.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title =
.title = Esporta Note con Better Notes
target =
.value = Destinazione: {$title}{ $left ->
[0]{ "" }
*[other] { " " }e {$left} in più.
}
format =
.value = Formato:
format-markdown =
.label = MarkDown(.md)
format-msword =
.label = MS Word(.docx)
format-pdf =
.label = PDF(.pdf)
format-freemind =
.label = Mappa Mentale
format-note =
.label = Nota Zotero
links-keep =
.label = Mantieni collegamenti alle note(zotero://note/)
links-embed =
.label = Incorpora note collegate nel contenuto
links-standalone =
.label = Converti note collegate in esportazioni autonome
links-remove =
.label = Rimuovi collegamenti alle note
markdown-autoSync =
.label = Imposta sincronizzazione automatica per ogni nota
.title = La sincronizzazione automatica è disponibile per la modalità "Converti note collegate in esportazioni autonome".
markdown-withYAMLHeader =
.label = Con intestazione YAML
markdown-autoFilename =
.label = Genera automaticamente il nome del file
2 changes: 2 additions & 0 deletions addon/locale/it-IT/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ basic-openNote-takeover =
.label = Gestisci l'apertura delle note
basic-openNote-defaultAsWindow =
.label = Apri note come finestra per impostazione predefinita
basic-exportNotes-takeover =
.label = Take over exporting notes
editor-title = Editor delle note
editor-expandLevel-label = Espansione dello schema al livello delle intestazioni
Expand Down
2 changes: 0 additions & 2 deletions addon/locale/ru-RU/addon.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pref-title=Better Notes
menuItem-exportNote=Экспорт заметки
menuEdit-exportTemplate=Экспорт шаблона в файл...
menuEdit-templateEditor=Редактор шаблонов
menuEdit-importTemplate=Новый шаблон из буфера обмена
Expand Down
37 changes: 37 additions & 0 deletions addon/locale/ru-RU/exportNotes.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title =
.title = Экспорт заметок с Better Notes
target =
.value = Цель: {$title}{ $left ->
[0]{ "" }
*[other] { " " }и еще {$left}.
}
format =
.value = Формат:
format-markdown =
.label = MarkDown(.md)
format-msword =
.label = MS Word(.docx)
format-pdf =
.label = PDF(.pdf)
format-freemind =
.label = Карта разума
format-note =
.label = Заметка Zotero
links-keep =
.label = Сохранить ссылки на заметки(zotero://note/)
links-embed =
.label = Встроить связанные заметки в содержимое
links-standalone =
.label = Преобразовать связанные заметки в автономные экспорты
links-remove =
.label = Удалить ссылки на заметки
markdown-autoSync =
.label = Установить авто-синхронизацию для каждой заметки
.title = Авто-синхронизация доступна в режиме "Преобразовать связанные заметки в автономные экспорты".
markdown-withYAMLHeader =
.label = С YAML заголовком
markdown-autoFilename =
.label = Автоматически генерировать имя файла
2 changes: 2 additions & 0 deletions addon/locale/ru-RU/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ basic-openNote-takeover =
.label = Take over opening note
basic-openNote-defaultAsWindow =
.label = Open note as window by default
basic-exportNotes-takeover =
.label = Take over exporting notes
editor-title = Note Editor
editor-expandLevel-label = Outline расширить до уровня заголовка
Expand Down
2 changes: 0 additions & 2 deletions addon/locale/tr-TR/addon.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pref-title = Better Notes
menuItem-exportNote = Notu Dışa Aktar
menuEdit-exportTemplate = Şablonu Dosya Olarak Dışa Aktar...
menuEdit-templateEditor = Şablon Düzenleyici
menuEdit-importTemplate = Panodan Yeni Şablon Al
Expand Down
25 changes: 0 additions & 25 deletions addon/locale/tr-TR/export.ftl

This file was deleted.

Loading

0 comments on commit 7859df4

Please sign in to comment.