Commit 0c5cdd97 authored by Curtis Adam's avatar Curtis Adam

Add a translate button to the editor navigation

parent 6f333d67
......@@ -651,9 +651,6 @@ $themes: (
color: $markdeep_help_text !important;
background-color: $markdeep_help_background !important;
border-color: $markdeep_help_border !important;
font-size: $font_size_markdeep_help;
font-weight: $font_weight_markdeep_help;
line-height: 16pt;
}
#markdeepNavigation .fa:hover, #markdeepNavigation .markdeep-center:hover, #markdeepNavigation .markdeep-fullscreen:hover, .card-button:hover {
......
......@@ -1233,6 +1233,7 @@
},
"markdeepEditor": {
"help": "Zeige alle Formatierungsoptionen von Markdeep",
"translate": "Eingabe Übersetzen",
"center": "Zentriere den Karteninhalt vertikal",
"alignLeft": "Text linksbündig ausrichten",
"mobilePreview": "Zeige die Karte in der Smartphone-Ansicht (iPhone 6/7/8)",
......@@ -1735,7 +1736,8 @@
},
"markdeep": {
"editor": {
"help": "Formatiere deinen Text mit Markdeep…"
"help": "Formatiere deinen Text mit Markdeep…",
"translate": "Eingabe Übersetzen"
}
},
"access-level": {
......
......@@ -4,6 +4,7 @@ import {CardVisuals} from "../../../../api/cardVisuals";
import {PomodoroTimer} from "../../../../api/pomodoroTimer";
import {Route} from "../../../../api/route";
import {Template} from "meteor/templating";
import {Dictionary} from "../../../../api/dictionary";
/*
* ############################################################################
......@@ -24,6 +25,9 @@ Template.cardSidebarItemToggleFullscreen.events({
Session.set("workloadFullscreenMode", false);
}
CardVisuals.toggleFullscreen();
if (Route.isEditMode()) {
Dictionary.setMode(0);
}
if (Route.isDemo() && CardVisuals.isFullscreen()) {
PomodoroTimer.start();
} else if (PomodoroTimer.isPomodoroRunning()) {
......
......@@ -130,10 +130,7 @@ $font_size_card_list_cardset_owner: 14px;
$margin_top_cardset_category: 25px;
//markdeep editor
$font_family_markdeep_help: $default_font;
$font_family_markdeep_editor_content: 'Roboto Mono', monospace;
$font_size_markdeep_help: 12pt;
$font_weight_markdeep_help: normal;
//search
$font_size_search_results_subject: 16px;
......@@ -227,7 +224,7 @@ body {
text-transform: unset !important;
}
.btn-success, .btn-danger, .btn-warning, .btn-info, .label-bonus, .learnBtn, .bonusBtn, .presentationBtn, .label-private, .label-edu, .label-free, .label-pro, #filter-nav-wrapper .navbar-text, #filter-nav-wrapper .dropdown-toggle, .panel-heading.info-tab, #collapseLearningPhaseInfoButton, .deleteAllCardsBtn, .newCardBtn, .markdeep-help, .pomodoroTimer h2, #searchResults h4 {
.btn-success, .btn-danger, .btn-warning, .btn-info, .label-bonus, .learnBtn, .bonusBtn, .presentationBtn, .label-private, .label-edu, .label-free, .label-pro, #filter-nav-wrapper .navbar-text, #filter-nav-wrapper .dropdown-toggle, .panel-heading.info-tab, #collapseLearningPhaseInfoButton, .deleteAllCardsBtn, .newCardBtn, .markdeep-help, .markdeep-translate.pressed, .pomodoroTimer h2, #searchResults h4 {
text-shadow: $default_text_shadow;
}
......@@ -568,12 +565,6 @@ button {
-webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
.markdeep-help-text {
font-family: $font_family_markdeep_help !important;
font-size: $font_size_markdeep_help !important;
font-weight: $font_weight_markdeep_help !important;
}
.md-editor > textarea {
border: none;
}
......
<template name="markdeepNavigation">
<div id="markdeepNavigation">
<div class="btn-group">
<i class="btn fa fa-lightbulb-o card-button markdeep-help" title="{{_ "card.tooltip.markdeepEditor.help"}}">&nbsp;{{_
"markdeep.editor.help"}}</i>
<span class="btn fa fa-lightbulb-o card-button markdeep-help" title="{{_ "card.tooltip.markdeepEditor.help"}}">&nbsp;{{_
"markdeep.editor.help"}}</span>
</div>
<div class="btn-group">
{{#if isActiveRoute regex="editCard|newCard"}}
......@@ -27,5 +27,12 @@
isFullscreenActive}}pressed{{/if}}" title="{{_ "card.tooltip.markdeepEditor.fullscreen"}}"></i>
{{/if}}
</div>
{{#if gotDictionary}}
<div class="btn-group">
<span class="btn card-button markdeep-translate {{#if isTranslationActive}}pressed{{/if}}"
title="{{_ "card.tooltip.markdeepEditor.translate"}}">&nbsp;{{_
"markdeep.editor.translate"}}</span>
</div>
{{/if}}
</div>
</template>
import {Session} from "meteor/session";
import {Template} from "meteor/templating";
import {MarkdeepEditor} from "../../../../api/markdeepEditor.js";
import "./navigation.html";
import {CardVisuals} from "../../../../api/cardVisuals";
import {Dictionary} from "../../../../api/dictionary";
import {CardType} from "../../../../api/cardTypes";
import "./navigation.html";
/*
* ############################################################################
......@@ -30,6 +32,9 @@ Template.markdeepNavigation.events({
},
'click .markdeep-fullscreen': function () {
MarkdeepEditor.toggleFullscreen();
},
'click .markdeep-translate': function () {
Dictionary.setMode(2);
}
});
......@@ -51,5 +56,11 @@ Template.markdeepNavigation.helpers({
},
isFullscreenActive: function () {
return Session.get('fullscreen');
},
isTranslationActive: function () {
return Dictionary.checkMode(2);
},
gotDictionary: function () {
return CardType.gotDictionary(Session.get('cardType'));
}
});
......@@ -7,10 +7,29 @@
text-align: center;
vertical-align: top;
margin-right: 5px;
font-size: 16px !important;
padding: 6px !important;
}
.btn-group .card-button:last-child {
margin-right: 0;
}
.markdeep-mobile-preview {
font-size: 26px !important;
font-size: 28px !important;
padding: 0 10px !important;
}
.markdeep-rotate-mobile-preview {
padding: 6px 10px !important;
}
.markdeep-help, .markdeep-translate {
font-size: 16px;
height: 30px;
}
.markdeep-translate {
font-size: 14px !important;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment