Commit e8dfa639 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel 🏀

Merge branch '30-remove-google-translate' into 'staging'

Resolve "Remove google translate and linguee"

Closes #30

See merge request !15
parents aae865bd 0898629b
......@@ -5,9 +5,7 @@ import {CardVisuals} from "./cardVisuals";
/*
Modes:
1 = Beolingus
2 = Linguee
3 = Google
4 = DeepL
2 = DeepL
*/
Session.setDefault('wordCount', 0);
......@@ -73,13 +71,11 @@ export let Dictionary = class Dictionary {
let query = "";
switch (mode) {
case 1:
case 2:
if (this.getWordCount() === 1) {
return queryStart + CardVisuals.removeMarkdeepTags(searchText);
}
return;
case 3:
case 4:
case 2:
queryStart = "";
for (let i = 0; i < this.getWordCount(); i++) {
if (i !== 0) {
......
......@@ -26,10 +26,6 @@
{{#if isActiveCard false}}
{{#if isBeolingusDictionary}}
{{> cardDictionaryContentBeolingus this}}
{{else if isLingueeDictionary}}
{{> cardDictionaryContentLinguee this}}
{{else if isGoogleDictionary}}
{{> cardDictionaryContentGoogle this}}
{{else if isDeepLDictionary}}
{{> cardDictionaryContentDeepL this}}
{{else}}
......
......@@ -137,19 +137,9 @@ Template.flashcards.helpers({
return Session.get('dictionaryMode') === 1;
}
},
isLingueeDictionary: function () {
if (CardType.gotDictionary(this.cardType)) {
return Session.get('dictionaryMode') === 2;
}
},
isGoogleDictionary: function () {
if (CardType.gotDictionary(this.cardType)) {
return Session.get('dictionaryMode') === 3;
}
},
isDeepLDictionary: function () {
if (CardType.gotDictionary(this.cardType)) {
return Session.get('dictionaryMode') === 4;
return Session.get('dictionaryMode') === 2;
}
},
getCardSideColorActive: function () {
......
......@@ -24,26 +24,6 @@
</iframe>
</template>
<template name="cardDictionaryContentLinguee">
<iframe class="dictionaryFrame"
src="https://www.linguee.de/deutsch-englisch/search?source=auto{{getDictionaryQuery}}"
frameborder="0"
data-type="cardNavigation">
</iframe>
</template>
<template name="cardDictionaryContentGoogle">
<span>
<a href="https://translate.google.com/#de/en/{{getDictionaryQuery}}" target="_blank"
title="{{_ "card.tooltip.markdeepEditor.dictionaryGoogle"}}">
<button type="button" class="btn btn-raised btn-lg btn-block centered btnCardGoogleTranslate">
<i class="fa fa-globe"></i>
{{_ "card.tooltip.markdeepEditor.dictionaryGoogle"}}
</button>
</a>
</span>
</template>
<template name="cardDictionaryContentDeepL">
<iframe class="dictionaryFrame"
src="https://www.deepl.com/translator#en/de/{{getDictionaryQuery}}"
......
......@@ -58,33 +58,6 @@ Template.cardDictionaryContentBeolingus.helpers({
}
});
/*
* ############################################################################
* cardDictionaryContentLinguee
* ############################################################################
*/
Template.cardDictionaryContentLinguee.onRendered(function () {
Dictionary.setBlur();
});
Template.cardDictionaryContentLinguee.helpers({
getDictionaryQuery: function () {
return Dictionary.getQuery(this, 2);
}
});
/*
* ############################################################################
* cardDictionaryContentGoogle
* ############################################################################
*/
Template.cardDictionaryContentGoogle.helpers({
getDictionaryQuery: function () {
return Dictionary.getQuery(this, 3);
}
});
/*
* ############################################################################
* cardDictionaryContentDeepL
......@@ -98,7 +71,7 @@ Template.cardDictionaryContentDeepL.onRendered(function () {
Template.cardDictionaryContentDeepL.helpers({
getDictionaryQuery: function () {
return Dictionary.getQuery(this, 4);
return Dictionary.getQuery(this, 2);
}
});
......
......@@ -18,46 +18,6 @@
{{/if}}
</template>
<template name="cardSidebarItemDictionaryLinguee">
{{#if gotDictionary}}
{{#if gotRequiredWordCount this}}
{{#unless isMobilePreview}}
<img class="hidden-xs showLingueeTranslation card-button cardHeaderItem {{#if
isLingueeActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/linguee_appLogoSmall.png" title="{{_ "card.tooltip.dictionaryLinguee"}}">
{{/unless}}
<span class="{{#unless
isMobilePreview}}visible-xs-inline-block{{/unless}} card-button cardHeaderItem fa showLingueeTranslation {{#if
isLingueeActive}}pressed{{/if}}" data-id="{{this._id}}"
title="{{_ "card.tooltip.dictionaryLinguee"}}"><strong>L</strong>
</span>
{{/if}}
{{/if}}
</template>
<template name="cardSidebarItemDictionaryGoogle">
{{#if gotDictionary}}
{{#if gotRequiredWordCount this}}
{{#unless isMobilePreview}}
<img class="hidden-xs showGoogleTranslation card-button cardHeaderItem {{#if
isGoogleActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/google_translate.png" title="{{_ "card.tooltip.dictionaryGoogle"}}">
{{/unless}}
<span class="{{#unless
isMobilePreview}}visible-xs-inline-block{{/unless}} card-button cardHeaderItem fa showGoogleTranslation {{#if
isGoogleActive}}pressed{{/if}}" data-id="{{this._id}}"
title="{{_ "card.tooltip.dictionaryGoogle"}}"><strong>G</strong>
</span>
{{/if}}
{{/if}}
</template>
<template name="cardSidebarItemDictionaryDeepL">
{{#if gotDictionary}}
{{#if gotRequiredWordCount this}}
......
......@@ -39,76 +39,6 @@ Template.cardSidebarItemDictionaryBeolingus.events({
}
});
/*
* ############################################################################
* cardSidebarItemDictionaryLinguee
* ############################################################################
*/
Template.cardSidebarItemDictionaryLinguee.helpers({
gotDictionary: function () {
return CardType.gotDictionary(Session.get('cardType'));
},
isLingueeActive: function () {
if (CardType.gotDictionary(Session.get('cardType'))) {
return Dictionary.checkMode(2);
}
},
isMobilePreview: function () {
return MarkdeepEditor.getMobilePreview();
},
gotRequiredWordCount: function () {
if (Dictionary.getWordCount() === 1) {
return true;
} else {
if (Dictionary.checkMode(2)) {
Dictionary.setMode(0);
}
}
}
});
Template.cardSidebarItemDictionaryLinguee.events({
"click .showLingueeTranslation": function () {
Dictionary.setMode(2);
}
});
/*
* ############################################################################
* cardSidebarItemDictionaryGoogle
* ############################################################################
*/
Template.cardSidebarItemDictionaryGoogle.helpers({
gotDictionary: function () {
return CardType.gotDictionary(Session.get('cardType'));
},
isGoogleActive: function () {
if (CardType.gotDictionary(Session.get('cardType'))) {
return Dictionary.checkMode(3);
}
},
isMobilePreview: function () {
return MarkdeepEditor.getMobilePreview();
},
gotRequiredWordCount: function () {
if (Dictionary.getWordCount() > 1) {
return true;
} else {
if (Dictionary.checkMode(3)) {
Dictionary.setMode(0);
}
}
}
});
Template.cardSidebarItemDictionaryGoogle.events({
"click .showGoogleTranslation": function () {
Dictionary.setMode(3);
}
});
/*
* ############################################################################
* cardSidebarItemDictionaryDeepL
......@@ -121,7 +51,7 @@ Template.cardSidebarItemDictionaryDeepL.helpers({
},
isDeepLActive: function () {
if (CardType.gotDictionary(Session.get('cardType'))) {
return Dictionary.checkMode(4);
return Dictionary.checkMode(2);
}
},
isMobilePreview: function () {
......@@ -131,7 +61,7 @@ Template.cardSidebarItemDictionaryDeepL.helpers({
if (Dictionary.getWordCount() > 1) {
return true;
} else {
if (Dictionary.checkMode(4)) {
if (Dictionary.checkMode(2)) {
Dictionary.setMode(0);
}
}
......@@ -140,6 +70,6 @@ Template.cardSidebarItemDictionaryDeepL.helpers({
Template.cardSidebarItemDictionaryDeepL.events({
"click .showDeepLTranslation": function () {
Dictionary.setMode(4);
Dictionary.setMode(2);
}
});
......@@ -49,9 +49,7 @@
<template name="flashcardSidebarDictionary">
{{> cardSidebarItemDictionaryDeepL}}
{{> cardSidebarItemDictionaryLinguee}}
{{> cardSidebarItemDictionaryBeolingus}}
{{> cardSidebarItemDictionaryGoogle}}
</template>
<template name="flashcardSidebarDefaultLeft">
......
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