4896,6,161,32,138,26,574,32,329,6,1184,36,169,38,1092,55,247,61,298,56,391,55,98,60,334,65,572,83,640,78,438,59,297,55,448,54,353,33,552,58,463,66,504,49,2232,62,415,62,425,65,550,71,441,80,668,90,311,102,344,107,1195,113,533,101,322,104,69,45,1787,54,463,62,504,45,2326,23,596,32,280,49,425,31,811,42,643,53,184,65,522,66,968,49,240,60,1635,49,386,37,392,36,112,38,1776,40,2893,45,144,44,401,55,192,60,484,51,356,54,127,58,340,58,230,61,79,47,120,53,270,53,270,42,161,52,361,56,343,51,146,55,117,52,682,34,1109,51,303,51,281,67,839,53,589,54,465,68,327,73,959,95,373,88,134,56,567,57,453,71,1098,59,523,42,578,33,3260,31,222,39,145,48,598,67,325,61,156,51,286,57,102,46,259,61,270,63,315,55,273,49,289,57,805,55,102,45,233,48,363,35,88,33,1716,46,633,66,922,87,345,47,1074,38,119,41,2107,48,673,31,187,32,443,31,166,32,439,36,459,43,258,44,661,47,172,35,1212,63,160,52,591,42,268,41,258,53,1095,36,284,37,967,48,328,57,316,44,677,49,419,35,235,44,120,31,482,39,311,12,2005,40,296,52,168,56,564,47,644,50,235,62,167,65,144,60,144,62,117,61,143,54,427,60,72,42,497,37,144,37,186,37,730,49,300,39,704,49,261,48,1128,29,268,41,1152,41,194,58,240,58,260,50,451,44,350,70,562,74,185,99,452,88,312,90,98,72,762,61,440,81,284,77,183,73,236,79,279,67,108,49,114,53,455,54,1369,65,249,73,217,65,604,69,340,56,407,60,373,83,332,68,379,82,978,85,535,93,1077,84,390,87,130,67,203,70,393,88,334,84,1675,85,733,71,440,85,418,88,133,59,1686,44,823,51,620,51,497,52,1142,64,362,52,579,63,222,67,639,74,838,63,134,75,322,93,368,80,645,48,618,29,150,52,768,52,516,46,911,48,987,58,236,41,406,44,507,54,242,54,137,67,431,77,181,71,301,59,399,64,372,73,674,68,537,60,307,67,271,62,398,65,954,74,344,58,305,80,722,79,365,73,1297,52,566,51,220,65,660,36,1388,57,328,32,456,52,571,56,150,61,529,60,308,58,423,53,324,71,426,47,385,46,595,53,594,45,563,50,173,54,146,52,805,51,167,68,802,36,1221,57,158,55,865,49,576,40,359,35,782,45,76,45,197,47,580,63,284,58,940,59,248,63,154,58,182,53,379,51,632,43,389,38,291,36,627,41,219,55,492,30,726,39,214,46,226,36,452,46,258,49,505,40,297,58,430,61,190,60,136,63,94,67,379,70,267,78,761,61,322,64,191,63,127,66,94,76,387,79,273,87,793,41,689,52,152,53,208,37,207,41,374,42,262,45,597,47,475,47,570,53,263,49,780,47,342,46,428,53,348,80,753,66,627,73,281,77,302,74,130,59,179,56,369,44,840,54,461,57,123,39,291,36,273,43,177,37,656,45,317,66,496,47,405,42,159,36,518,41,324,30,1336,39,155,41,300,45,200,43,159,45,172,37,377,45,560,31,548,39,266,43,227,44,103,49,417,61,123,51,641,60,849,45,534,40,252,38,631,47,728,39,310,49,590,48,327,65,411,72,471,81,105,75,341,60,169,55,117,59,111,56,241,61,423,57,311,50,743,59,928,44,411,46,384,41,971,53,123,43,800,52,829,37,273,33,610,37,462,42,355,55,699,62,619,71,536,72,441,59,608,67,617,54,359,72,452,68,237,70,134,64,784,67,88,66,403,67,224,57,350,75,454,75,169,73,160,67,774,49,354,58,1445,61,235,55,509,58,120,43,670,51,334,25,329,31,136,42,403,54,459,44,204,54,526,54,313,51,119,52,1330,76,471,60,413,62,386,48,581,35,492,49,104,54,340,63,123,75,223,73,222,56,165,64,356,78,215,73,455,74,192,76,156,63,335,73,228,76,352,37,201,45,188,49,550,44,602,54,72,59,143,47,435,57,387,48,1212,39,1073,48,602,58,72,51,319,64,173,64,172,56,519,64,90,61,475,52,989,43,674,31,755,42,357,45,190,38,647,50,767,70,216,79,302,77,304,63,216,51,285,57,159,48,72,48,227,64,147,66,534,60,400,70,225,64,211,61,233,41,403,42,1065,38,1275,58,265,51,159,61,300,59,302,42,207,47,95,47,95,46,212,58,161,58,718,33,1121,48,463,43,986,52,124,48,1068,60,522,50,255,56,100,45,1005,64,525,69,112,52,525,70,449,55,452,48,632,54,131,54,254,48,416,54,166,49,232,62,291,65,256,60,1640,54,351,52,641,58,108,57,644,47,433,31,2003,33,260,70,143,47,221,59,452,66,557,51,312,44,590,62,166,66,442,57,106,61,150,64,229,52,412,48,148,41,774,44,294,46,218,38,179,30,479,44,305,49,172,44,251,48,562,38,384,44,589,36,271,29,541,41,227,46,251,50,867,62,167,44,322,42,278,37,126,42,498,31,119,26,1098,32,121,37,200,43,167,30,506,39,185,33,489,41,346,33,136,42,214,44,286,44,256,39,432,33,196,47,552,51,487,61,172,61,348,75,200,78,322,80,258,84,241,82,450,77,1203,70,225,71,1225,43,608,46,502,37,144,58,721,52,376,32,2822,44,409,52,273,59,860,45,436,61,96,47,828,62,396,47,296,57,305,59,313,56,1433,51,283,60,461,62,186,55,396,60,153,52,506,66,233,64,347,65,361,43,791,34,458,40,199,40,257,30,687,42,386,41,270,56,570,55,112,54,338,61,529,52,1436,58,114,55,236,50,568,48,1710,45,1081,39,331,32,595,31,238,54,144,43,381,47,377,33,646,45,157,47,296,46,1106,35,175,42,620,42,429,65,423,54,134,66,326,84,200,71,645,39,294,39,927,42,611,55,1494,69,1363,82,292,82,292,97,361,92,730,72,570,88,806,91,308,90,79,82,570,74,540,84,346,78,399,88,212,52,343,36,515,34,560,36,1428,44,77,44,593,37,322,53,370,59,201,66,446,76,702,66,186,71,482,59,629,53,194,49,288,56,271,51,402,47,331,68,365,62,1593,41,1562,46,641,44,220,58,660,44,601,44,1368,50,281,53,633,29,1262,50,260,41,131,43,660,15,698
_info
{"project":"app01-learn-list","branch":"master","version":305,"versionDate":"2024-05-15T08:16:45.000Z","fromVersion":0,"reset":true,"checksumDocs":"692-360306"}
_shared/calcNavCategory/calc.ls
(function(){
return function(){
if (deviceLog['var']("enableLearnBetaTab")) {
return "learnBeta";
} else {
return "learnList";
}
};
})();
_shared/logNewList/log.ls
(function(){
return function(e){
var events, ref$, scanId;
events = inc("/../app01/lib/util/cache/get/get")("logNewListEvents");
if (!events || e.event === "start") {
events = [];
inc("/../app01/lib/util/cache/set/set")("logNewListEvents", events);
}
e.created = new Date();
events.push(e);
if ((ref$ = e.event) === "abort" || ref$ === "finish") {
scanId = (ref$ = _.findLast(events, {
event: "ocrItems"
})) != null ? ref$.scanId : void 8;
return log.log({
event: "debugNewListFunnel",
events: events,
isDebug: engine.isDebug,
scanId: scanId,
status: e.event
});
}
};
})();
_shared/removeBracket/remove.ls
(function(){
return function(s){
var a, s2, i$, len$, p;
if (!s) {
return;
}
s = s.split("(").join("|||(");
s = s.split(")").join(")|||");
a = s.split("|||");
s2 = "";
for (i$ = 0, len$ = a.length; i$ < len$; ++i$) {
p = a[i$];
if (p[0] !== "(") {
s2 += p;
}
}
s2 = s2.trim();
s2 = s2.replace(/\s\s+/g, " ");
return s2;
};
})();
_t.ls
(function(){
return {
no: {
de: "Nein",
en: "No",
fr: "Non",
es: "No",
pt: "Não"
},
yes: {
de: "Ja",
en: "Yes",
fr: "Oui",
es: "Sí",
pt: "Sim"
},
saveButton: {
de: "Speichern",
en: "Save",
fr: "Enregistrer",
es: "Guardar",
pt: "Salvar"
},
done: {
de: "Fertig",
en: "Done",
fr: "Terminé",
es: "Listo",
pt: "Pronto"
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
},
backButton: {
de: "Zurück",
en: "Back",
fr: "Retour",
es: "Volver",
pt: "Voltar"
},
addButton: {
de: "Hinzufügen",
en: "Add",
fr: "Ajouter",
es: "Agregar",
pt: "Adicionar"
},
removeButton: {
de: "Entfernen",
en: "Remove",
fr: "Retirer",
es: "Eliminar",
pt: "Remover"
},
discardButton: {
de: "Verwerfen",
en: "Discard"
},
ok: {
de: "Ok",
en: "Ok",
fr: "OK",
es: "Ok",
pt: "Ok"
},
continueButton: {
de: "Weiter",
en: "Continue",
fr: "Continuer",
es: "Continuar",
pt: "Continuar"
},
closeButton: {
de: "Schließen",
en: "Close",
fr: "Fermer",
es: "Cerrar",
pt: "Fechar"
},
errorOops: {
de: "Ups, etwas ist schief gegangen.",
en: "Oops, something went wrong here.",
fr: "Oups… une erreur s'est produite.",
es: "¡Ups! Ocurrió un error.",
pt: "Ops! Ocorreu um erro."
}
};
})();
data/calcLearnListDescription/_t.ls
(function(){
return {
deletedUser: {
de: "Gelöschter Nutzer",
en: "Deleted user account",
fr: "Compte supprimé",
es: "Cuenta eliminada",
pt: "Conta excluída"
}
};
})();
data/calcLearnListDescription/calc.ls
(function(){
return function(listCode){
var d, description, ref$;
d = inc("getLearnListDescription/get")(listCode);
if (!d) {
return;
}
return description = {
listCode: d.listCode,
name: (ref$ = d.name) != null ? ref$ : "learnListDescription missing",
type: d.type,
etag: d.etag,
totalItems: d.totalItems,
visibility: d.visibility,
coverImageId: d.coverImageId,
description: d.description,
creatorPublicId: d.creatorPublicId,
creatorDisplayName: d.creatorDisplayName || T("deletedUser"),
created: d.created,
updated: d.lastEventAt,
sublevels: (ref$ = d.sublevels) != null
? ref$
: [],
totalSublevels: (ref$ = d.totalSublevels) != null ? ref$ : 0,
forkParentListCode: d.forkParentListCode,
forkedAt: d.forkedAt,
preview: d.preview,
previewSearch: d.previewSearch,
levels: [
{
trainer: "dragCard"
}, {
trainer: _.startsWith(d.type, "spell") ? "wordBuilder" : "memory"
}, {
trainer: "gapMultiWriteTrain"
}, {
trainer: "gapMulti"
}
],
isCreator: d.creatorPublicId === ((ref$ = log.findLast("setPublicId")) != null ? ref$.value : void 8),
isBookmarked: inc("calcIsBookmarked/calc")(d)
};
};
})();
data/calcLearnListDescription/calcIsBookmarked/calc.ls
(function(){
return function(d){
var e;
e = log.findLast({
event: "bookmarkLearnList",
listCode: d.listCode
});
if (e) {
return true;
}
e = log.findLast({
event: "bookmarkLearnList",
masterListCode: d.listCode
});
if (e) {
return true;
}
};
})();
data/calcLearnListDescription/getLearnListDescription/get.ls
(function(){
return function(listCode){
var e;
if (_.isObject(listCode)) {
return listCode;
}
e = log.findLast({
event: "learnListDescription",
listCode: listCode
});
return (e != null ? e.description : void 8) || inc("/../app01/lib/util/cache/get/get")("learnListDescription", listCode);
};
})();
data/loadLevel/calcLevel/_shared/addCustomSounds/add.ls
(function(){
return function(atom, a, b){
var aNoBracket, bNoBracket;
aNoBracket = inc("/_shared/removeBracket/remove")(a);
bNoBracket = inc("/_shared/removeBracket/remove")(b);
if (aNoBracket !== a && (a === b || b == null)) {
return atom.sound = aNoBracket;
} else {
if (aNoBracket !== a) {
atom.soundA = aNoBracket;
}
if (bNoBracket !== b) {
return atom.soundB = bNoBracket;
}
}
};
})();
data/loadLevel/calcLevel/_shared/calcGapString/calc.ls
(function(){
return function(s){
s = s.split(" ").join("_");
return s = "((" + s + "))";
};
})();
data/loadLevel/calcLevel/_shared/calcKeyboardLayout/calc.ls
(function(){
return function(type, switchAB){
if (type === "vocabRuDe" && !switchAB) {
return "standardSlimRU";
} else if (type === "vocabUaDe" && !switchAB) {
return "standardSlimUA";
} else {
return twitch({
de: "standardSlimDE",
en: "standardSlimEN",
fr: "standardSlimFR",
es: "standardSlimES",
pt: "standardSlimPT"
});
}
};
})();
data/loadLevel/calcLevel/_shared/calcKeyboardSpecialKeys/calc.ls
(function(){
return function(level){
var templates, template, availableKeys, usedKeys, specialKeys, res$, k;
templates = inc("/../app01/lib/gui/screenKeyboard/_templates/templates");
template = templates[level.keyboardLayout];
availableKeys = inc("calcAvailableKeys/calc")(template);
usedKeys = inc("calcUsedKeys/calc")(level);
if (availableKeys["'"]) {
delete usedKeys["´"];
delete usedKeys["`"];
}
res$ = [];
for (k in usedKeys) {
if (availableKeys[k] != null) {
continue;
}
res$.push(k);
}
specialKeys = res$;
specialKeys.sort();
return specialKeys.join(" ");
};
})();
data/loadLevel/calcLevel/_shared/calcKeyboardSpecialKeys/calcAvailableKeys/calc.ls
(function(){
return function(template){
var keys, i$, ref$, len$, row, j$, ref1$, len1$, v, k$, len2$, i, c, c2;
keys = {};
for (i$ = 0, len$ = (ref$ = template.main).length; i$ < len$; ++i$) {
row = ref$[i$];
for (j$ = 0, len1$ = (ref1$ = row.split("|")).length; j$ < len1$; ++j$) {
v = ref1$[j$];
if (_.endsWith(v, "]")) {
continue;
}
for (k$ = 0, len2$ = v.length; k$ < len2$; ++k$) {
i = k$;
c = v[k$];
if (i > 0) {
break;
}
keys[c] = true;
c2 = c.toUpperCase();
if (c2 !== c) {
keys[c2] = true;
}
}
}
}
for (i$ = 0, len$ = ("0123456789 ()").length; i$ < len$; ++i$) {
c = ("0123456789 ()")[i$];
keys[c] = true;
}
return keys;
};
})();
data/loadLevel/calcLevel/_shared/calcKeyboardSpecialKeys/calcUsedKeys/calc.ls
(function(){
return function(level){
var atoms, keys, i$, len$, atom, b, j$, ref$, len1$, c;
atoms = level.trainers.atoms;
keys = {};
for (i$ = 0, len$ = atoms.length; i$ < len$; ++i$) {
atom = atoms[i$];
b = atom.b;
b = _.replaceAll(b, "((", "");
b = _.replaceAll(b, "))", "");
b = _.replaceAll(b, "_", " ");
for (j$ = 0, len1$ = (ref$ = Array.from(b)).length; j$ < len1$; ++j$) {
c = ref$[j$];
keys[c] = true;
}
}
return keys;
};
})();
data/loadLevel/calcLevel/_shared/calcSubLevelItems/calc.ls
(function(){
return function(fileData, levelPath){
var sublevelId, sublevel, items;
sublevelId = +levelPath.split("/sublevel-")[1];
sublevel = fileData.sublevels[sublevelId - 1];
items = fileData.items;
if (sublevel) {
items = items.slice(sublevel.from - 1, sublevel.to);
}
return items;
};
})();
data/loadLevel/calcLevel/_shared/calcWideCards/calc.ls
(function(){
return function(items){
var limit, i$, len$, item, j$, ref$, len1$, type, ref1$, ref2$;
limit = body.width() < 400 ? 15 : 20;
for (i$ = 0, len$ = items.length; i$ < len$; ++i$) {
item = items[i$];
for (j$ = 0, len1$ = (ref$ = ["a", "b"]).length; j$ < len1$; ++j$) {
type = ref$[j$];
if (((ref1$ = item[type]) != null ? (ref2$ = ref1$.text) != null ? ref2$.length : void 8 : void 8) > limit) {
return true;
}
}
}
return false;
};
})();
data/loadLevel/calcLevel/_shared/setProperties/set.ls
(function(){
return function(level, listType){
var i$, ref$, len$, trainer;
level.trainers = _.ensureArray(level.trainers);
for (i$ = 0, len$ = (ref$ = level.trainers).length; i$ < len$; ++i$) {
trainer = ref$[i$];
trainer.learnListMode = true;
}
level.contentLanguagePrimary = listType.l1;
return level.contentLanguageSecondary = listType.l2;
};
})();
data/loadLevel/calcLevel/calc.ls
(function(){
return function(p){
var type, listType, level;
type = p.fileData.type;
listType = _.find(inc("/pages/_shared/listTypes/types")(), {
type: type
});
app.currentPage.currentListLanguage = listType.l1.slice(0, 2);
level = _.startsWith(type, "spell")
? inc("spellLevel/level")(p)
: _.startsWith(type, "vocab")
? inc("vocabLevel/level")(p)
: _.startsWith(type, "questions") ? inc("questionsLevel/level")(p) : void 8;
inc("_shared/setProperties/set")(level, listType);
delete app.currentPage.currentListLanguage;
return p.onDone(level);
};
})();
data/loadLevel/calcLevel/questionsLevel/calcAtoms/calc.ls
(function(){
return function(items, switchAB){
var atoms, item, a, b, atom;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
if (switchAB) {
a = item.b.text;
b = item.a.text;
} else {
a = item.a.text;
b = item.b.text;
}
atom = {
a: a,
b: b
};
inc("../../_shared/addCustomSounds/add")(atom, a, b);
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/questionsLevel/calcAtomsGapMulti/calc.ls
(function(){
return function(items, switchAB){
var atoms, item, a, b, atom;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
if (switchAB) {
a = item.b.text;
b = item.a.text;
} else {
a = item.a.text;
b = item.b.text;
}
atom = {
a: a,
b: inc("../../_shared/calcGapString/calc")(b)
};
inc("../../_shared/addCustomSounds/add")(atom, a, b);
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/questionsLevel/level.ls
(function(){
return function(p){
var levelPath, fileData, listCode, type, items, shuffleAtoms, ref$, switchAB, ref1$, soundMode, ref2$, that, voiceA, voiceB, level;
levelPath = p.levelPath;
fileData = p.fileData;
listCode = fileData.listCode;
type = fileData.type;
items = inc("../_shared/calcSubLevelItems/calc")(fileData, levelPath);
shuffleAtoms = (ref$ = p.startConfig) != null ? ref$.shuffleAtoms : void 8;
switchAB = (ref1$ = p.startConfig) != null ? ref1$.switchAB : void 8;
soundMode = switchAB
? (ref2$ = p.startConfig) != null ? ref2$.soundMode : void 8
: (function(){
var ref$;
switch (that = (ref$ = p.startConfig) != null ? ref$.soundMode : void 8) {
case "a":
return "b";
case "b":
return "a";
default:
return that;
}
}());
voiceA = inc("/pages/_shared/calcVoiceSettings/calc")(type, "a");
voiceB = inc("/pages/_shared/calcVoiceSettings/calc")(type, "b");
level = {
puid: levelPath,
path: levelPath,
type: "level",
items: items,
voiceLang: voiceA.lang,
voice: voiceA.voice,
voiceLangA: voiceA.lang,
voiceA: voiceA.voice,
voiceLangB: voiceB.lang,
voiceB: voiceB.voice,
trainers: _.includes(levelPath, "dragCard")
? {
trainer: "dragCard",
shuffleAtoms: shuffleAtoms,
switchAB: switchAB,
soundMode: soundMode,
atoms: inc("calcAtoms/calc")(items, switchAB)
}
: _.includes(levelPath, "memory")
? {
trainer: "memory",
chooseMode: "text",
wideCards: inc("../_shared/calcWideCards/calc")(items),
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
atoms: inc("calcAtoms/calc")(items, switchAB)
}
: _.includes(levelPath, "gapMultiWriteTrain")
? {
trainer: "gapMultiLearnList",
trainAttempts: 1,
trainMode: true,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items, switchAB)
}
: _.includes(levelPath, "gapMulti") ? {
trainer: "gapMultiLearnList",
trainAttempts: 0,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items, switchAB)
} : void 8
};
if (_.includes(levelPath, "gapMulti")) {
level.keyboardLayout = inc("../_shared/calcKeyboardLayout/calc")(type, switchAB);
level.keyboardSpecialKeys = inc("../_shared/calcKeyboardSpecialKeys/calc")(level);
}
return level;
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsDragCard/calc.ls
(function(){
return function(items){
var atoms, item, a, atom, that;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
a = item.a.text;
atom = {
a: a
};
inc("../../_shared/addCustomSounds/add")(atom, a);
if (that = item.image) {
atom.image = that;
}
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsGapMulti/calc.ls
(function(){
return function(items){
var i$, len$, item, a, atom, that, results$ = [];
for (i$ = 0, len$ = items.length; i$ < len$; ++i$) {
item = items[i$];
a = item.a.text;
atom = {
a: a,
b: inc("../../_shared/calcGapString/calc")(a)
};
inc("../../_shared/addCustomSounds/add")(atom, a);
if (that = item.image) {
atom.image = that;
atom.soundMode = "b";
}
item.atom = atom;
results$.push(atom);
}
return results$;
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calc.ls
(function(){
return function(items){
var atoms, item, a, hyphens, b, hasHyphens, atom, that;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
a = item.a.text;
hyphens = item.a.hyphens;
b = hyphens || a;
hasHyphens = hyphens != null;
atom = {
a: a,
b: inc("calcB/calc")(b, hasHyphens)
};
inc("../../_shared/addCustomSounds/add")(atom, a);
if (that = item.image) {
atom.image = that;
}
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calc.ls
(function(){
return function(s, hasHyphens){
var seed, words, results, res$, i$, len$, word;
seed = (s.charCodeAt(0) || 1) + (s.charCodeAt(1) || 1);
_.setRandomSeed(seed);
s = inc("/_shared/removeBracket/remove")(s);
words = s.split(/\s+/);
res$ = [];
for (i$ = 0, len$ = words.length; i$ < len$; ++i$) {
word = words[i$];
res$.push(inc("calcWord/calc")(word, words.length, hasHyphens));
}
results = res$;
return results.join(" ");
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calc.ls
(function(){
return function(word, totalWords, hasHyphens){
var lang, articles, parts;
lang = app.currentPage.currentListLanguage;
articles = {
de: ["der", "die", "das", "ein", "eine"],
en: ["the", "a", "an"],
fr: ["le", "la", "les", "un", "une", "des"],
es: ["el", "la", "lo", "los", "las", "un", "una", "unos", "unas"],
pt: ["o", "os", "a", "as", "um", "uns", "uma", "umas"]
};
if (totalWords !== 1 && (in$(word, articles[lang]) || word.length === 1)) {
return word;
}
parts = inc("calcParts/calc")(word, hasHyphens);
return parts.join("");
};
})();
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/calc.ls
(function(){
return function(word, hasHyphens){
var parts, i$, len$, p, results$ = [];
parts = hasHyphens
? inc("partsHyphens/parts")(word)
: inc("partsAuto/parts")(word);
for (i$ = 0, len$ = parts.length; i$ < len$; ++i$) {
p = parts[i$];
results$.push(inc("calcChoices/calc")(p));
}
return results$;
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/calcChoices/calc.ls
(function(){
var r;
r = inc("replace/replace");
return function(p){
var a, ref$;
a = ["++" + p];
if (p.length === 1) {
a.push(r(p, 0, 0));
a.push(r(p, 0, 1));
} else if ((ref$ = p.length) === 2 || ref$ === 3) {
a.push(r(p, 0));
a.push(r(p, p.length - 1));
} else {
a.push(r(p, 1));
a.push(r(p, 3));
}
return "((" + a.join(" ") + "))";
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/calcChoices/dict/dict.ls
(function(){
return function(){
var langs, dict, lang, map, i$, ref$, len$, p, c;
langs = {
de: "aeä,bpd,ckg,dtp,eaä,fvh,gkh,hnt,ije,jiy,kcp,lih,mnw,nwh,oae,pdb,qpb,rfp,sch,tdp,uoa,vfw,wfh,xci,yui,zck,üyi,äae,öoe,ßb",
en: "aeu,bpd,ckg,dtp,eiy,fvh,gkh,hgf,iey,jyi,kcp,lih,mwb,nwh,oua,pdb,qpb,rpf,sca,tdf,uov,vwp,wmh,xci,yje,zek",
fr: "aáà,àáa,áaà,âaà,æaœ,bpd,ckç,dtp,eéè,èée,éeè,ëeê,êëe,fvh,gkh,hnt,iîy,ïiî,îïi,îyi,jiy,kcg,lji,mnw,nwh,ouû,œoæ,ôoœ,pdb,qpb,rfp,sçc,tdp,uûo,ûou,üûù,ùüû,vfw,wmn,xck,yiî,ÿyï,zck",
es: "aue,áae,bpd,czt,dtp,eai,éei,fvh,ghj,hcj,iíe,íie,jhy,kch,lji,mnw,nñm,ñnj,oóo,óou,pdb,qkc,rfp,sct,tdf,uoú,úou,vbw,wei,xsh,yje,zsk",
pt: "aáá,àáa,áàa,âua,ãau,bpd,csk,çsc,dgt,eié,éêe,êei,fvh,gjh,hoj,ieí,íei,jgs,kch,lji,mnw,nmw,ouõ,óuõ,ôõo,õôó,pqb,qkh,rht,scz,tdf,uúü,úüu,üúu,vbw,wei,xzs,yje,zst"
};
dict = {};
for (lang in langs) {
map = langs[lang];
dict[lang] = {};
for (i$ = 0, len$ = (ref$ = map.split(",")).length; i$ < len$; ++i$) {
p = ref$[i$];
c = p[0].trim();
dict[lang][c] = p.substr(1);
}
for (i$ = 0, len$ = (ref$ = map.split(",")).length; i$ < len$; ++i$) {
p = ref$[i$];
c = p[0].trim();
dict[lang][c.toUpperCase()] = p.substr(1).toUpperCase();
}
}
return dict;
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/calcChoices/replace/replace.ls
(function(){
var dict;
dict = inc("../dict/dict")();
return function(s, pos, pos2){
var char, lang, fallBackDict, alternatives, ref$, targetPos, that, char2, a;
char = Array.from(s)[pos];
lang = app.currentPage.currentListLanguage;
fallBackDict = "12345?!";
alternatives = (ref$ = dict[lang][char]) != null
? ref$
: fallBackDict.replace(s, "");
targetPos = (that = pos2) != null
? that
: _.randomWithSeed(0, alternatives.length);
char2 = alternatives.charAt(targetPos);
a = Array.from(s);
a[pos] = char2;
return a.join("");
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/partsAuto/parts.ls
(function(){
return function(word){
var parts, i, l, size, s;
parts = [];
i = 0;
l = word.length;
size = l <= 6
? 2
: l <= 12
? 3
: _.round(l / 3);
for (;;) {
s = word.substr(i * size, size);
if (s.length >= size) {
parts[i] = s;
} else {
parts[i - 1] += s;
}
i += 1;
if (i * size > l) {
break;
}
}
return parts;
};
})();
data/loadLevel/calcLevel/spellLevel/calcAtomsWordBuilder/calcB/calcWord/calcParts/partsHyphens/parts.ls
(function(){
return function(word){
return word.split("•");
};
})();
data/loadLevel/calcLevel/spellLevel/level.ls
(function(){
return function(p){
var levelPath, fileData, listCode, type, items, shuffleAtoms, ref$, soundMode, ref1$, voiceA, level;
levelPath = p.levelPath;
fileData = p.fileData;
listCode = fileData.listCode;
type = fileData.type;
items = inc("../_shared/calcSubLevelItems/calc")(fileData, levelPath);
shuffleAtoms = (ref$ = p.startConfig) != null ? ref$.shuffleAtoms : void 8;
soundMode = (ref1$ = p.startConfig) != null ? ref1$.soundMode : void 8;
voiceA = inc("/pages/_shared/calcVoiceSettings/calc")(type, "a");
level = {
puid: levelPath,
path: levelPath,
type: "level",
items: items,
voiceLang: voiceA.lang,
voice: voiceA.voice,
voiceLangA: voiceA.lang,
voiceA: voiceA.voice,
voiceLangB: voiceA.lang,
voiceB: voiceA.voice,
trainers: _.includes(levelPath, "dragCard")
? {
trainer: "dragCard",
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
atoms: inc("calcAtomsDragCard/calc")(items)
}
: _.includes(levelPath, "wordBuilder")
? {
trainer: "wordBuilder",
shuffleAtoms: shuffleAtoms,
shuffleButtons: false,
soundMode: soundMode,
atoms: inc("calcAtomsWordBuilder/calc")(items)
}
: _.includes(levelPath, "gapMultiWriteTrain")
? {
trainer: "gapMultiLearnList",
trainAttempts: 1,
trainMode: true,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items)
}
: _.includes(levelPath, "gapMulti") ? {
trainer: "gapMultiLearnList",
trainAttempts: 0,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items)
} : void 8
};
if (_.includes(levelPath, "gapMulti")) {
level.keyboardLayout = inc("../_shared/calcKeyboardLayout/calc")(type);
level.keyboardSpecialKeys = inc("../_shared/calcKeyboardSpecialKeys/calc")(level);
}
return level;
};
})();
data/loadLevel/calcLevel/vocabLevel/calcAtoms/calc.ls
(function(){
return function(items, switchAB){
var atoms, item, a, b, atom;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
if (switchAB) {
a = item.a.text;
b = item.b.text;
} else {
a = item.b.text;
b = item.a.text;
}
atom = {
a: a,
b: b
};
inc("../../_shared/addCustomSounds/add")(atom, a, b);
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/vocabLevel/calcAtomsGapMulti/calc.ls
(function(){
return function(items, switchAB){
var atoms, item, a, b, atom;
return atoms = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = items).length; i$ < len$; ++i$) {
item = ref$[i$];
if (switchAB) {
a = item.a.text;
b = item.b.text;
} else {
a = item.b.text;
b = item.a.text;
}
atom = {
a: a,
b: inc("../../_shared/calcGapString/calc")(b)
};
inc("../../_shared/addCustomSounds/add")(atom, a, b);
item.atom = atom;
results$.push(atom);
}
return results$;
}());
};
})();
data/loadLevel/calcLevel/vocabLevel/level.ls
(function(){
return function(p){
var levelPath, fileData, listCode, type, items, shuffleAtoms, ref$, switchAB, ref1$, soundMode, that, ref2$, voiceA, voiceB, level;
levelPath = p.levelPath;
fileData = p.fileData;
listCode = fileData.listCode;
type = fileData.type;
items = inc("../_shared/calcSubLevelItems/calc")(fileData, levelPath);
shuffleAtoms = (ref$ = p.startConfig) != null ? ref$.shuffleAtoms : void 8;
switchAB = (ref1$ = p.startConfig) != null ? ref1$.switchAB : void 8;
soundMode = switchAB
? (function(){
var ref$;
switch (that = (ref$ = p.startConfig) != null ? ref$.soundMode : void 8) {
case "a":
return "b";
case "b":
return "a";
default:
return that;
}
}())
: (ref2$ = p.startConfig) != null ? ref2$.soundMode : void 8;
voiceA = inc("/pages/_shared/calcVoiceSettings/calc")(type, switchAB ? "a" : "b");
voiceB = inc("/pages/_shared/calcVoiceSettings/calc")(type, switchAB ? "b" : "a");
level = {
puid: levelPath,
path: levelPath,
type: "level",
items: items,
voiceLang: voiceA.lang,
voice: voiceA.voice,
voiceLangA: voiceA.lang,
voiceA: voiceA.voice,
voiceLangB: voiceB.lang,
voiceB: voiceB.voice,
trainers: _.includes(levelPath, "dragCard")
? {
trainer: "dragCard",
shuffleAtoms: shuffleAtoms,
switchAB: switchAB,
soundMode: soundMode,
atoms: inc("calcAtoms/calc")(items, switchAB)
}
: _.includes(levelPath, "memory")
? {
trainer: "memory",
chooseMode: "text",
wideCards: inc("../_shared/calcWideCards/calc")(items),
shuffleAtoms: shuffleAtoms,
switchAB: switchAB,
soundMode: soundMode,
atoms: inc("calcAtoms/calc")(items, switchAB)
}
: _.includes(levelPath, "gapMultiWriteTrain")
? {
trainer: "gapMultiLearnList",
trainAttempts: 1,
trainMode: true,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
switchAB: switchAB,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items, switchAB)
}
: _.includes(levelPath, "gapMulti") ? {
trainer: "gapMultiLearnList",
trainAttempts: 0,
gapMode: "write",
shuffleAtoms: shuffleAtoms,
switchAB: switchAB,
soundMode: soundMode,
ignoreCase: false,
atoms: inc("calcAtomsGapMulti/calc")(items, switchAB)
} : void 8
};
if (_.includes(levelPath, "gapMulti")) {
level.keyboardLayout = inc("../_shared/calcKeyboardLayout/calc")(type, switchAB);
level.keyboardSpecialKeys = inc("../_shared/calcKeyboardSpecialKeys/calc")(level);
}
return level;
};
})();
data/loadLevel/load.ls
(function(){
return function(p){
var listCode, etag, loadFile, calcLevel, finish;
listCode = p.levelPath.split("/")[2];
etag = p.etag || "latest";
loadFile = function(){
return inc("loadFile/load")({
listCode: listCode,
etag: etag,
onError: p.onError,
onLoaded: calcLevel
});
};
calcLevel = function(fileData){
return inc("calcLevel/calc")({
levelPath: p.levelPath,
listCode: listCode,
startConfig: p.startConfig,
fileData: fileData,
onError: p.onErorr,
onDone: finish
});
};
finish = function(level, fileData){
level.fileData = fileData;
return p.onLoaded(level);
};
return loadFile();
};
})();
data/loadLevel/loadFile/load.ls
(function(){
return function(p){
return inc("/../app01/lib/util/downloadContentFile/download")({
fileId: "learnList/" + p.listCode,
fileFolder: "learnLists/" + p.listCode + "/learnList",
etag: p.etag,
returnFileContent: true,
onLoaded: p.onLoaded,
onError: p.onError
});
};
})();
data/loadLevelsReport2/calcGroupedEvents/calc.ls
(function(){
return function(report){
var groupedEvents, i$, ref$, len$, m, j$, ref1$, len1$, e, key$;
groupedEvents = {};
for (i$ = 0, len$ = (ref$ = report.members).length; i$ < len$; ++i$) {
m = ref$[i$];
for (j$ = 0, len1$ = (ref1$ = m.events).length; j$ < len1$; ++j$) {
e = ref1$[j$];
groupedEvents[key$ = e.puid] == null && (groupedEvents[key$] = []);
groupedEvents[e.puid].push(e);
}
}
return groupedEvents;
};
})();
data/loadLevelsReport2/load.ls
(function(){
return function(p){
var cacheId, c;
cacheId = p.listCode + p.groupCode;
c = inc("/../app01/lib/util/cache/get/get")("levelReports2", cacheId);
if (c) {
p.onCachedReport(c);
}
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/group/members/getLevelsReport2/learnList/get"),
params: {
groupCode: p.groupCode,
listCode: p.listCode
},
onError: p.onError,
onOffline: p.onOffline,
onCompleted: function(report){
if (report.status === "ok") {
report.groupedEvents = inc("calcGroupedEvents/calc")(report);
inc("/../app01/lib/util/cache/set/set")("levelReports2", cacheId, report);
if (JSON.stringify(c != null ? c.groupedEvents : void 8) !== JSON.stringify(report.groupedEvents)) {
return p.onUpdatedReport(report);
} else {
return debug("noChange");
}
}
}
});
};
})();
pages/_shared/calcLearnListCover/cover.ls
(function(){
var listTypes;
listTypes = inc("../listTypes/types")();
return function(ld){
var listType, div;
listType = _.find(listTypes, {
type: ld.type
});
div = Div({
display: "inline-flex",
flexDirection: "column",
border: "1px solid " + Color.grey[200],
background: Color.grey[50],
height: "4.1em",
width: "4.1em",
overflow: "hidden",
fontSize: "1em"
}).html(ld.coverImageId
? [
inc("coverImage/image")(ld), inc("titleDiv/div")(listType).css({
position: "absolute",
top: 0,
width: "100%",
height: "2.7em",
background: "rgba(255, 255, 255, 0.7)"
})
]
: [inc("titleDiv/div")(listType), inc("linesSvg/svg")(listType)]);
return div;
};
})();
pages/_shared/calcLearnListCover/coverImage/image.ls
(function(){
return function(ld){
return inc("/../app01/lib/gui/image/image")({
id: ld.coverImageId,
fileFolder: "NIX",
etag: "any"
}).css({
width: "100%",
height: "100%"
});
};
})();
pages/_shared/calcLearnListCover/linesSvg/lsg/linesOneColumn.lsg
(function(){
return {
version: 2,
width: 300,
height: 125,
objects: [
{
type: 'line',
'class': 'line1',
x1: 65,
y1: 25,
x2: 230,
y2: 25,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 65,
y1: 50,
x2: 230,
y2: 50,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 65,
y1: 74,
x2: 230,
y2: 74,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 65,
y1: 100,
x2: 230,
y2: 100,
lineColor: Color.grey[400],
lineSize: 5
}
]
};
})();
pages/_shared/calcLearnListCover/linesSvg/lsg/linesTwoColumns.lsg
(function(){
return {
version: 2,
width: 300,
height: 125,
objects: [
{
type: 'line',
'class': 'line1',
x1: 35,
y1: 25,
x2: 133,
y2: 25,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 166,
y1: 25,
x2: 266,
y2: 25,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 35,
y1: 50,
x2: 133,
y2: 50,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 166,
y1: 50,
x2: 266,
y2: 50,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 35,
y1: 74,
x2: 133,
y2: 74,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 166,
y1: 74,
x2: 266,
y2: 74,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 35,
y1: 100,
x2: 133,
y2: 100,
lineColor: Color.grey[400],
lineSize: 5
}, {
type: 'line',
'class': 'line1',
x1: 166,
y1: 100,
x2: 266,
y2: 100,
lineColor: Color.grey[400],
lineSize: 5
}
]
};
})();
pages/_shared/calcLearnListCover/linesSvg/svg.ls
(function(){
return function(listType){
var lsg;
lsg = _.startsWith(listType.type, "spell")
? inc("lsg/linesOneColumn.lsg")
: inc("lsg/linesTwoColumns.lsg");
return SvgIcon({
svg: LSG2.toSVG(lsg),
width: "4em",
height: "1.7em"
});
};
})();
pages/_shared/calcLearnListCover/titleDiv/calcTitle/calc.ls
(function(){
return function(type){
var title;
return title = (function(){
switch (type) {
case "vocabFrDe":
return "Französisch";
case "vocabEnDe":
return "Englisch";
case "vocabEsDe":
return "Spanisch";
case "vocabRuDe":
return twitch({
'default': "Russisch",
en: "Russian"
});
case "vocabUaDe":
return twitch({
'default': "Ukrainisch",
en: "Ukrainian"
});
case "spellDe":
return "Wörter";
case "questionsDe":
return "Fragen und Antworten";
case "vocabDeEnGb":
return "German";
case "vocabFrEnGb":
return "French";
case "vocabEsEnGb":
return "Spanish";
case "vocabPtEnGb":
return "Portuguese";
case "spellEnGb":
return "Words";
case "questionsEnGb":
return "Questions and Answers";
case "vocabDeEnUs":
return "German";
case "vocabFrEnUs":
return "French";
case "vocabEsEnUs":
return "Spanish";
case "vocabPtEnUs":
return "Portuguese";
case "spellEnUs":
return "Words";
case "questionsEnUs":
return "Questions and Answers";
case "vocabDeFr":
return "Allemand";
case "vocabEnFr":
return "Anglais";
case "vocabEsFr":
return "Espagnol";
case "vocabPtFr":
return "Portugais";
case "spellFr":
return "Mots";
case "questionsFr":
return "Questions et réponses";
case "vocabDeEs":
return "Alemán";
case "vocabEnEs":
return "Inglés";
case "vocabFrEs":
return "Francés";
case "vocabPtEs":
return "Portugués";
case "spellEs":
return "Palabras";
case "questionsEs":
return "Preguntas y respuestas";
case "vocabDePt":
return "Alemão";
case "vocabEnPt":
return "Inglês";
case "vocabFrPt":
return "Francês";
case "vocabEsPt":
return "Espanhol";
case "spellPt":
return "Palavras";
case "questionsPt":
return "Perguntas e respostas";
}
}());
};
})();
pages/_shared/calcLearnListCover/titleDiv/div.ls
(function(){
return function(listType){
var title;
title = inc("calcTitle/calc")(listType.type);
return Div({
display: "flex",
textAlign: "center",
lineHeight: "1.1em",
color: Color.blue[700],
padding: "0.4em 0 0.15em",
minHeight: "2em",
fontFamily: "Solocode School",
fontWeight: "bold",
fontSize: _.startsWith(listType.type, "questions") ? "0.6em" : "0.65em"
}).html(title);
};
})();
pages/_shared/calcLevelTitle/calc.ls
(function(){
return function(levelPath){
var p;
p = levelPath;
if (_.includes(p, "dragCard")) {
return T("dragCard");
} else if (_.includes(p, "memory")) {
return T("assign");
} else if (_.includes(p, "gapMultiWriteTrain")) {
return T("writeTrain");
} else if (_.includes(p, "wordBuilder")) {
return T("wordBuilder");
} else if (_.includes(p, "gapMulti")) {
return T("writeTest");
}
};
})();
pages/_shared/calcListColumns/_t.ls
(function(){
return {
words: {
de: "Wörter",
en: "Words",
fr: "Mots",
es: "Palabras",
pt: "Palavras"
}
};
})();
pages/_shared/calcListColumns/calc.ls
(function(){
return function(type){
var listType, l1;
listType = type.type
? type
: _.find(inc("../listTypes/types")(), {
type: type
});
l1 = listType.l1.slice(0, 2);
if (_.startsWith(type, "question")) {
return {
a: T("question"),
b: T("answer")
};
} else if (_.startsWith(type, "spell")) {
return {
a: (function(){
switch (l1) {
case "de":
return T("german");
case "en":
return T("english");
case "fr":
return T("french");
case "es":
return T("spanish");
case "pt":
return T("portuguese");
}
}())
};
} else {
return {
a: (function(){
switch (listType.type) {
case "vocabFrDe":
return T("french");
case "vocabEnDe":
return T("english");
case "vocabEsDe":
return T("spanish");
case "vocabRuDe":
return T("russian");
case "vocabUaDe":
return T("ukrainian");
case "vocabDeEnGb":
return T("german");
case "vocabFrEnGb":
return T("french");
case "vocabEsEnGb":
return T("spanish");
case "vocabPtEnGb":
return T("portuguese");
case "vocabDeEnUs":
return T("german");
case "vocabFrEnUs":
return T("french");
case "vocabEsEnUs":
return T("spanish");
case "vocabPtEnUs":
return T("portuguese");
case "vocabDeFr":
return T("german");
case "vocabEnFr":
return T("english");
case "vocabEsFr":
return T("spanish");
case "vocabPtFr":
return T("portuguese");
case "vocabDeEs":
return T("german");
case "vocabEnEs":
return T("english");
case "vocabFrEs":
return T("french");
case "vocabPtEs":
return T("portuguese");
case "vocabDePt":
return T("german");
case "vocabEnPt":
return T("english");
case "vocabFrPt":
return T("french");
case "vocabEsPt":
return T("spanish");
}
}()),
b: (function(){
switch (l1) {
case "de":
return T("german");
case "en":
return T("english");
case "fr":
return T("french");
case "es":
return T("spanish");
case "pt":
return T("portuguese");
}
}())
};
}
};
})();
pages/_shared/calcVoiceSettings/calc.ls
(function(){
return function(listType, mode){
var v;
v = {
vocabEnDe: {
a: {
voice: "f3",
lang: "en"
},
b: {
voice: "m3",
lang: "de"
}
},
vocabFrDe: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m3",
lang: "de"
}
},
vocabEsDe: {
a: {
voice: "f2",
lang: "es"
},
b: {
voice: "m3",
lang: "de"
}
},
vocabRuDe: {
a: {
voice: "f6",
lang: "ru"
},
b: {
voice: "m3",
lang: "de"
}
},
vocabUaDe: {
a: {
voice: "f2",
lang: "ua"
},
b: {
voice: "m3",
lang: "de"
}
},
spellDe: {
a: {
voice: "m3",
lang: "de"
}
},
questionsDe: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m3",
lang: "de"
}
},
vocabDeEnGb: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m2",
lang: "en"
}
},
vocabFrEnGb: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m2",
lang: "en"
}
},
vocabEsEnGb: {
a: {
voice: "f2",
lang: "es"
},
b: {
voice: "m2",
lang: "en"
}
},
vocabPtEnGb: {
a: {
voice: "f7",
lang: "pt"
},
b: {
voice: "m2",
lang: "en"
}
},
spellEnGb: {
a: {
voice: "f3",
lang: "en"
}
},
questionsEnGb: {
a: {
voice: "f3",
lang: "en"
},
b: {
voice: "m2",
lang: "en"
}
},
vocabDeEnUs: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m5Us",
lang: "en"
}
},
vocabFrEnUs: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m5Us",
lang: "en"
}
},
vocabEsEnUs: {
a: {
voice: "f2",
lang: "es"
},
b: {
voice: "m5Us",
lang: "en"
}
},
vocabPtEnUs: {
a: {
voice: "f7",
lang: "pt"
},
b: {
voice: "m5Us",
lang: "en"
}
},
spellEnUs: {
a: {
voice: "f8Us",
lang: "en"
}
},
questionsEnUs: {
a: {
voice: "f8Us",
lang: "en"
},
b: {
voice: "m5Us",
lang: "en"
}
},
vocabDeFr: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m1",
lang: "fr"
}
},
vocabEnFr: {
a: {
voice: "m2",
lang: "en"
},
b: {
voice: "f1",
lang: "fr"
}
},
vocabEsFr: {
a: {
voice: "f2",
lang: "es"
},
b: {
voice: "m1",
lang: "fr"
}
},
vocabPtFr: {
a: {
voice: "f7",
lang: "pt"
},
b: {
voice: "m1",
lang: "fr"
}
},
spellFr: {
a: {
voice: "f1",
lang: "fr"
}
},
questionsFr: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m1",
lang: "fr"
}
},
vocabDeEs: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m1EsUs",
lang: "es"
}
},
vocabEnEs: {
a: {
voice: "m5Us",
lang: "en"
},
b: {
voice: "f1",
lang: "es"
}
},
vocabFrEs: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m1EsUs",
lang: "es"
}
},
vocabPtEs: {
a: {
voice: "f7",
lang: "pt"
},
b: {
voice: "m1EsUs",
lang: "es"
}
},
spellEs: {
a: {
voice: "f1EsUs",
lang: "es"
}
},
questionsEs: {
a: {
voice: "f1EsUs",
lang: "es"
},
b: {
voice: "m1EsUs",
lang: "es"
}
},
vocabDePt: {
a: {
voice: "f5",
lang: "de"
},
b: {
voice: "m7",
lang: "pt"
}
},
vocabEnPt: {
a: {
voice: "m5Us",
lang: "en"
},
b: {
voice: "f7",
lang: "pt"
}
},
vocabFrPt: {
a: {
voice: "f1",
lang: "fr"
},
b: {
voice: "m7",
lang: "pt"
}
},
vocabEsPt: {
a: {
voice: "f6",
lang: "es"
},
b: {
voice: "m7",
lang: "pt"
}
},
spellPt: {
a: {
voice: "f7",
lang: "pt"
}
},
questionsPt: {
a: {
voice: "f7",
lang: "pt"
},
b: {
voice: "m7",
lang: "pt"
}
}
};
return v[listType][mode];
};
})();
pages/_shared/learnListRow/arrowIcon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[400]
});
};
})();
pages/_shared/learnListRow/center/center.ls
(function(){
return function(ld, context, groupCode, weekStartAt){
return Div({
flex: "1 1 auto",
textAlign: "left",
margin: "0.8em 0"
}).html(inc("name/name")(ld), inc("extras/extras")(ld, context), inc("preview/preview")(ld), inc("/pages/_shared/tagNewFork/tag")(ld, context), inc("/pages/_shared/tagNewList/tag")(ld, context), inc("pinTags/pinTags")(ld, context, groupCode, weekStartAt));
};
})();
pages/_shared/learnListRow/center/extras/creator/_t.ls
(function(){
return {
byShort: {
de: " von $1",
en: " by $1",
fr: " d'$1",
es: " de $1",
pt: " de $1"
},
by: {
de: " von $1",
en: " by $1",
fr: " de $1",
es: " de $1",
pt: " de $1"
}
};
})();
pages/_shared/learnListRow/center/extras/creator/creator.ls
(function(){
return function(ld){
var name, vowels, name0;
name = ld.creatorDisplayName;
if (_.startsWith(name, "Herr ") && engine.guiLanguage === "de") {
name = name.replace("Herr ", "Herrn ");
}
vowels = "aeiou".split("");
name0 = name[0].toLowerCase();
return Div({
display: "inline"
}).secureHtml(in$(name0, vowels)
? T("byShort", name)
: T("by", name));
};
})();
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
pages/_shared/learnListRow/center/extras/extras.ls
(function(){
return function(ld, context){
var n;
if (_.includes(context, "group")) {
return;
}
n = ld.creatorDisplayName;
return Div({
fontSize: "0.85em",
color: Color.grey[650],
lineHeight: "1.5em"
}).html(inc("totalItems/total")(ld), inc("creator/creator")(ld), inc("/pages/_shared/visibility/visibility")(ld, true), inc("myList/myList")(ld));
};
})();
pages/_shared/learnListRow/center/extras/myList/_t.ls
(function(){
return {
myList: {
de: "Meine Liste",
en: "My list",
fr: "Ma liste",
es: "Mi lista",
pt: "Minha lista"
}
};
})();
pages/_shared/learnListRow/center/extras/myList/myList.ls
(function(){
return function(ld){
if ((ld.isBookmarked || ld.isCreator) && app.currentPage.context === "allLists") {
return Div().append(Div({
display: "inline-block",
fontSize: "0.85em",
color: "white",
marginTop: "0.2em",
borderRadius: "3px",
backgroundColor: Color.blue[500],
padding: "0.1em 0.3em 0em"
}).html(T("myList")));
}
};
})();
pages/_shared/learnListRow/center/extras/totalItems/_t.ls
(function(){
return {
entries: {
de: "(($1 Eintrag | $1 Einträge))",
en: "(($1 entry | $1 entries))",
fr: "(($1 entrée | $1 entrée | $1 entrées))",
es: "(($1 entrada | $1 entradas))",
pt: "(($1 entrada | $1 entradas))"
}
};
})();
pages/_shared/learnListRow/center/extras/totalItems/total.ls
(function(){
return function(ld){
return T("entries", ld.totalItems);
};
})();
pages/_shared/learnListRow/center/name/name.ls
(function(){
return function(ld){
return Div({
overflow: "hidden",
lineHeight: "1.5em"
}).secureHtml(ld.name);
};
})();
pages/_shared/learnListRow/center/pinTags/pinTags.ls
(function(){
return function(ld, context, groupCode, weekStartAt){
return inc("/../app01/pages/content/_shared/rowPinTags/pinTags")({
context: context,
groupCode: groupCode,
weekStartAt: weekStartAt,
pinContent: {
type: "learnList",
listCode: ld.listCode
}
});
};
})();
pages/_shared/learnListRow/center/preview/preview.ls
(function(){
return function(ld){
var search;
if (!(ld.preview || ld.previewSearch)) {
return;
}
search = app.currentPage.params.search;
return Div({
fontSize: "0.8em",
color: Color.grey[650],
lineHeight: "1.5em",
paddingTop: "0.1em"
}).secureHtml(ld.preview);
};
})();
pages/_shared/learnListRow/cover/cover.ls
(function(){
return function(ld){
return inc("/pages/_shared/calcLearnListCover/cover")(ld).css({
flex: "0 0 auto",
margin: "0.4em 0.8em 0.4em 0em"
});
};
})();
pages/_shared/learnListRow/lastViewed/lastViewed.ls
(function(){
return function(listCode, context){
var e;
if (_.includes(context, "group")) {
return;
}
e = log.findLast("setLastLearnList");
if ((e != null ? e.listCode : void 8) !== listCode) {
return;
}
return Div({
position: "absolute",
top: 0,
right: 0,
padding: "0.05em 0.2em 0",
fontSize: "0.7em",
color: Color.grey[500]
}).html(T("lastViewed"));
};
})();
pages/_shared/learnListRow/pinCounter/calcTotal/calc.ls
(function(){
return function(listCode){
var pinDescriptions;
pinDescriptions = inc("/../app01/data/group/calcPinDescriptions/calc")({
pinContent: {
type: "learnList",
listCode: listCode
}
});
if (!inc("/../app01/data/user/isTeacher/get")()) {
pinDescriptions = _.uniqBy(pinDescriptions, "groupName");
}
return pinDescriptions.length;
};
})();
pages/_shared/learnListRow/pinCounter/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/pin.svg"),
color: Color.blue[500],
size: "0.9em"
});
};
})();
pages/_shared/learnListRow/pinCounter/number/number.ls
(function(){
return function(total){
return Div({
fontSize: "0.8em",
color: Color.blue[500]
}).html(total);
};
})();
pages/_shared/learnListRow/pinCounter/pinCounter.ls
(function(){
return function(ld, context){
var listCode, isCreated, total, update, create, div;
listCode = ld.listCode;
if (!window.log || _.includes(context, "group")) {
return;
}
isCreated = false;
total = undefined;
update = function(){
var total2;
if (!isCreated) {
return;
}
total2 = inc("calcTotal/calc")(listCode);
if (total !== total2) {
return create();
}
};
create = function(){
isCreated = true;
total = inc("calcTotal/calc")(listCode);
if (total > 0) {
return div.html(inc("icon/icon")(), inc("number/number")(total)).show();
}
};
div = Div({
display: "flex",
width: "1.5em",
height: "2em"
}).onElementClass("update", update).onScopeRender(create);
return div;
};
})();
pages/_shared/learnListRow/row.ls
(function(){
return function(p){
var context, learnListDescription, ld, listCode, groupCode, weekStartAt, tap, b;
context = p.context;
learnListDescription = inc("/data/calcLearnListDescription/calc")(p.listCode || p.learnListDescription);
ld = learnListDescription;
listCode = ld.listCode;
groupCode = p.groupCode;
weekStartAt = p.weekStartAt;
tap = function(){
var p;
inc("setLastLearnList/set")(listCode, context);
inc("/../app01/lib/util/cache/set/set")("learnListDescription", listCode, learnListDescription);
p = app.currentPage.params;
return inc("/pages/learnList/start")({
listCode: listCode,
context: context,
groupSinglePublicId: p.publicId,
groupCode: p.groupCode
});
};
return Div({
display: "flex",
borderBottom: b = "1px solid " + Color.grey[200],
borderTop: b,
background: "white",
marginTop: "-2px",
minHeight: "4.2em"
}).append(inc("cover/cover")(ld), inc("center/center")(ld, context, groupCode, weekStartAt), inc("pinCounter/pinCounter")(ld, context), inc("stats/stats")(ld, context, groupCode), inc("arrowIcon/icon")(), inc("lastViewed/lastViewed")(listCode, context)).tap(tap);
};
})();
pages/_shared/learnListRow/setLastLearnList/set.ls
(function(){
return function(listCode, context){
var e;
if (_.includes(context, "group")) {
return;
}
e = log.findLast("setLastLearnList");
if ((e != null ? e.listCode : void 8) !== listCode) {
if (e) {
log.deleteEvent(e);
}
return log.log({
event: "setLastLearnList",
listCode: listCode
});
}
};
})();
pages/_shared/learnListRow/stats/_canvas/canvas.ls
(function(){
return function(div){
var dpr, w, h;
dpr = window.devicePixelRatio;
w = _.round(div.width() * dpr);
h = _.round(div.height() * dpr);
return document.createElement("canvas").attr({
width: w,
height: h
}).css({
width: w / dpr + "px",
height: h / dpr + "px"
});
};
})();
pages/_shared/learnListRow/stats/canvasAll/calcFinishRates/calc.ls
(function(){
return function(ld, levelsReport){
var totalPupils, finishRates, level, sublevel, totalItems, puid, groupEvents, totalDone, finishRate;
totalPupils = levelsReport.members.length;
return finishRates = (function(){
var i$, ref$, len$, lresult$, j$, ref1$, len1$, results$ = [];
for (i$ = 0, len$ = (ref$ = ld.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
lresult$ = [];
for (j$ = 0, len1$ = (ref1$ = ld.sublevels).length; j$ < len1$; ++j$) {
sublevel = ref1$[j$];
totalItems = sublevel.to - sublevel.from + 1;
puid = "/learnList/" + ld.listCode + ("/" + level.trainer) + ("/sublevel-" + sublevel.id);
groupEvents = levelsReport.groupedEvents[puid];
totalDone = groupEvents ? _.keys(groupEvents).length : 0;
lresult$.push(finishRate = totalDone / totalPupils);
}
results$.push(lresult$);
}
return results$;
}());
};
})();
pages/_shared/learnListRow/stats/canvasAll/canvas.ls
(function(){
return function(ld, div, levelsReport){
var canvas, ctx, finishRates, rowHeight, i$, len$, i, finishRates2, yFrom, yTo, width;
canvas = inc("../_canvas/canvas")(div);
ctx = canvas.getContext("2d");
finishRates = inc("calcFinishRates/calc")(ld, levelsReport);
rowHeight = canvas.height / finishRates.length;
for (i$ = 0, len$ = finishRates.length; i$ < len$; ++i$) {
i = i$;
finishRates2 = finishRates[i$];
yFrom = _.round(i * rowHeight);
yTo = _.round((i + 1) * rowHeight);
width = canvas.width;
inc("row/row")(yFrom, yTo, width, finishRates2, ctx);
}
return canvas;
};
})();
pages/_shared/learnListRow/stats/canvasAll/row/row.ls
(function(){
return function(yFrom, yTo, width, finishRates, ctx){
var sublevelWitdh, i$, len$, i, finishRate, xFrom, xTo, results$ = [];
sublevelWitdh = width / finishRates.length;
for (i$ = 0, len$ = finishRates.length; i$ < len$; ++i$) {
i = i$;
finishRate = finishRates[i$];
xFrom = _.round(i * sublevelWitdh);
xTo = _.round((i + 1) * sublevelWitdh);
results$.push(inc("sublevel/sublevel")(yFrom, yTo, xFrom, xTo, finishRate, ctx));
}
return results$;
};
})();
pages/_shared/learnListRow/stats/canvasAll/row/sublevel/sublevel.ls
(function(){
return function(yFrom, yTo, xFrom, xTo, finishRate, ctx){
var yDelta, yDelta2, yFrom2;
if (finishRate === 0) {
return;
}
yDelta = yTo - yFrom;
yDelta2 = yDelta * finishRate;
yFrom2 = yFrom + yDelta - yDelta2;
ctx.fillStyle = Color.blue[300];
return ctx.fillRect(xFrom, yFrom2, xTo - xFrom, yTo - yFrom2);
};
})();
pages/_shared/learnListRow/stats/canvasSingle/calcProgressColors/calc.ls
(function(){
return function(ld, context){
var listCode, events, eventsByPuid, i$, len$, e, progressColors, level, sublevel, totalItems, puid;
listCode = ld.listCode;
events = context === "groupSingle"
? inc("calcEventsGroupSingle/calc")(ld)
: inc("calcEventsUser/calc")(ld);
eventsByPuid = {};
for (i$ = 0, len$ = events.length; i$ < len$; ++i$) {
e = events[i$];
eventsByPuid[e.puid] = e;
}
return progressColors = (function(){
var i$, ref$, len$, lresult$, j$, ref1$, len1$, results$ = [];
for (i$ = 0, len$ = (ref$ = ld.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
lresult$ = [];
for (j$ = 0, len1$ = (ref1$ = ld.sublevels).length; j$ < len1$; ++j$) {
sublevel = ref1$[j$];
totalItems = sublevel.to - sublevel.from + 1;
puid = "/learnList/" + listCode + ("/" + level.trainer) + ("/sublevel-" + sublevel.id);
e = eventsByPuid[puid];
lresult$.push(e != null ? e.progressColors : void 8);
}
results$.push(lresult$);
}
return results$;
}());
};
})();
pages/_shared/learnListRow/stats/canvasSingle/calcProgressColors/calcEventsGroupSingle/calc.ls
(function(){
return function(ld){
var page, publicId, member, events;
page = app.currentPage;
publicId = page.memberDescription.publicId;
member = _.find(page.levelsReport.members, {
publicId: publicId
});
events = member != null ? member.events : void 8;
return events = _.filter(events, function(e){
return _.startsWith(e.puid, "/learnList/" + ld.listCode);
});
};
})();
pages/_shared/learnListRow/stats/canvasSingle/calcProgressColors/calcEventsUser/calc.ls
(function(){
return function(ld){
return log.list(function(e){
return _.startsWith(e.puid, "/learnList/" + ld.listCode);
});
};
})();
pages/_shared/learnListRow/stats/canvasSingle/canvas.ls
(function(){
return function(ld, div, context){
var canvas, ctx, progressColors, rowHeight, i$, len$, i, pg, yFrom, yTo, width;
canvas = inc("../_canvas/canvas")(div);
ctx = canvas.getContext("2d");
progressColors = inc("calcProgressColors/calc")(ld, context);
rowHeight = canvas.height / progressColors.length;
for (i$ = 0, len$ = progressColors.length; i$ < len$; ++i$) {
i = i$;
pg = progressColors[i$];
yFrom = _.round(i * rowHeight);
yTo = _.round((i + 1) * rowHeight);
width = canvas.width;
inc("row/row")(yFrom, yTo, width, pg, ctx);
}
return canvas;
};
})();
pages/_shared/learnListRow/stats/canvasSingle/row/row.ls
(function(){
return function(yFrom, yTo, width, progressColors, ctx){
var sublevelWitdh, i$, len$, i, pg, xFrom, xTo, results$ = [];
sublevelWitdh = width / progressColors.length;
for (i$ = 0, len$ = progressColors.length; i$ < len$; ++i$) {
i = i$;
pg = progressColors[i$];
xFrom = _.round(i * sublevelWitdh);
xTo = _.round((i + 1) * sublevelWitdh);
results$.push(inc("sublevel/sublevel")(yFrom, yTo, xFrom, xTo, pg, ctx));
}
return results$;
};
})();
pages/_shared/learnListRow/stats/canvasSingle/row/sublevel/sublevel.ls
(function(){
return function(yFrom, yTo, xFrom, xTo, progressColors, ctx){
var s, parts, total, res$, i$, len$, i, p, t, scoreWidth, colors, xFrom2, xDelta, results$ = [];
if (!progressColors) {
return;
}
s = progressColors;
s = s.split("g").join("g|");
s = s.split("r").join("r|");
s = s.split("b").join("b|");
parts = s.split("|");
parts = parts.filter(function(p){
return p.length > 0;
});
total = 0;
res$ = [];
for (i$ = 0, len$ = parts.length; i$ < len$; ++i$) {
i = i$;
p = parts[i$];
if (p.length === 1) {
total++;
parts[i] = 1 + p;
res$.push({
color: p,
total: 1,
start: total - 1
});
} else {
t = +p.substr(0, p.length - 1);
total += t;
res$.push({
color: _.last(p),
total: t,
start: total - t
});
}
}
parts = res$;
scoreWidth = (xTo - xFrom) / total;
colors = {
g: Color.green[400],
r: Color.red[400],
b: Color.grey[400]
};
for (i$ = 0, len$ = parts.length; i$ < len$; ++i$) {
p = parts[i$];
xFrom2 = xFrom + p.start * scoreWidth;
xDelta = p.total * scoreWidth;
ctx.fillStyle = colors[p.color];
results$.push(ctx.fillRect(xFrom2, yFrom, xDelta, yTo - yFrom));
}
return results$;
};
})();
pages/_shared/learnListRow/stats/loadLevelsReport2/load.ls
(function(){
return function(ld, context, groupCode, div){
return inc("/data/loadLevelsReport2/load")({
listCode: ld.listCode,
groupCode: groupCode,
onOffline: function(){
return div.css({
backgroundColor: "blue"
});
},
onError: function(){
return div.css({
backgroundColor: "red"
});
},
onCachedReport: function(levelsReport){
return div.html(inc("../canvasAll/canvas")(ld, div, levelsReport));
},
onUpdatedReport: function(levelsReport){
return div.html(inc("../canvasAll/canvas")(ld, div, levelsReport));
}
});
};
})();
pages/_shared/learnListRow/stats/stats.ls
(function(){
return function(ld, context, groupCode){
var levelsReport, div;
levelsReport = app.currentPage.levelsReport;
if ((context === "groupAll" || context === "groupSingle") && !levelsReport) {
return inc("/pages/_shared/onlyOnline/onlyOnline")();
}
return div = Div({
width: "0.6em",
height: "2em",
margin: "0 0.4em",
backgroundColor: Color.grey[200],
overflow: "hidden"
}).onDomAppend(function(){
if (!div.canvas) {
return div.append(context === "groupAll"
? inc("canvasAll/canvas")(ld, div, levelsReport)
: inc("canvasSingle/canvas")(ld, div, context));
}
});
};
})();
pages/_shared/listTypes/types.ls
(function(){
return function(){
return [
{
type: "vocabEnDe",
name: "Vokabeln Englisch-Deutsch",
l1: "de",
l2: "en_gb"
}, {
type: "vocabFrDe",
name: "Vokabeln Französisch-Deutsch",
l1: "de",
l2: "fr"
}, {
type: "vocabEsDe",
name: "Vokabeln Spanisch-Deutsch",
l1: "de",
l2: "es"
}, {
type: "vocabRuDe",
name: "Vokabeln Russisch-Deutsch",
l1: "de",
l2: "ru"
}, {
type: "vocabUaDe",
name: "Vokabeln Ukrainisch-Deutsch",
l1: "de",
l2: "ua"
}, {
type: "spellDe",
name: "Rechtschreibung Wortliste (Deutsch)",
l1: "de"
}, {
type: "questionsDe",
name: "Fragen und Antworten (Deutsch)",
l1: "de"
}, {
type: "spellEnGb",
name: "Spelling List English",
l1: "en_gb"
}, {
type: "questionsEnGb",
name: "Questions and Answers",
l1: "en_gb"
}, {
type: "vocabDeEnGb",
name: "Vocabulary German-English",
l1: "en_gb",
l2: "de"
}, {
type: "vocabFrEnGb",
name: "Vocabulary French-English",
l1: "en_gb",
l2: "fr"
}, {
type: "vocabEsEnGb",
name: "Vocabulary Spanish-English",
l1: "en_gb",
l2: "es"
}, {
type: "vocabPtEnGb",
name: "Vocabulary Portuguese-English",
l1: "en_gb",
l2: "pt"
}, {
type: "vocabUaDe",
name: "Vocabulary Ukrainian-German",
l1: "en_gb",
l2: "ua"
}, {
type: "vocabRuDe",
name: "Vocabulary Russian-German",
l1: "en_gb",
l2: "ru"
}, {
type: "spellEnUs",
name: "Spelling List English",
l1: "en_us"
}, {
type: "questionsEnUs",
name: "Questions and Answers",
l1: "en_us"
}, {
type: "vocabDeEnUs",
name: "Vocabulary German-English",
l1: "en_us",
l2: "de"
}, {
type: "vocabFrEnUs",
name: "Vocabulary French-English",
l1: "en_us",
l2: "fr"
}, {
type: "vocabEsEnUs",
name: "Vocabulary Spanish-English",
l1: "en_us",
l2: "es"
}, {
type: "vocabPtEnUs",
name: "Vocabulary Portuguese-English",
l1: "en_us",
l2: "pt"
}, {
type: "vocabUaDe",
name: "Vocabulary Ukrainian-German",
l1: "en_us",
l2: "ua"
}, {
type: "vocabRuDe",
name: "Vocabulary Russian-German",
l1: "en_us",
l2: "ru"
}, {
type: "vocabDeFr",
name: "Vocabulaire allemand-français",
l1: "fr",
l2: "de"
}, {
type: "vocabEnFr",
name: "Vocabulaire anglais-français",
l1: "fr",
l2: "en_gb"
}, {
type: "vocabEsFr",
name: "Vocabulaire espagnol-français",
l1: "fr",
l2: "es"
}, {
type: "vocabPtFr",
name: "Vocabulaire portugais-français",
l1: "fr",
l2: "pt"
}, {
type: "spellFr",
name: "Orthographe en français",
l1: "fr"
}, {
type: "questionsFr",
name: "Questions et réponses",
l1: "fr"
}, {
type: "vocabDeEs",
name: "Vocabulario alemán-español",
l1: "es",
l2: "de"
}, {
type: "vocabEnEs",
name: "Vocabulario inglés-español",
l1: "es",
l2: "en_us"
}, {
type: "vocabFrEs",
name: "Vocabulario francés-español",
l1: "es",
l2: "fr"
}, {
type: "vocabPtEs",
name: "Vocabulario portugués-español",
l1: "es",
l2: "pt"
}, {
type: "spellEs",
name: "Ortografía en español",
l1: "es"
}, {
type: "questionsEs",
name: "Preguntas y respuestas",
l1: "es"
}, {
type: "vocabDePt",
name: "Vocabulário Alemão-Português",
l1: "pt",
l2: "de"
}, {
type: "vocabEnPt",
name: "Vocabulário Inglês-Português",
l1: "pt",
l2: "en_us"
}, {
type: "vocabFrPt",
name: "Vocabulário Francês-Português",
l1: "pt",
l2: "fr"
}, {
type: "vocabEsPt",
name: "Vocabulário Espanhol-Português",
l1: "pt",
l2: "es"
}, {
type: "spellPt",
name: "Ortografia da língua portuguesa",
l1: "pt"
}, {
type: "questionsPt",
name: "Perguntas e respostas",
l1: "pt"
}
];
};
})();
pages/_shared/onlyOnline/_t.ls
(function(){
return {
noDataOffline: {
de: "Keine Daten
(offline)",
en: "No data
(offline)",
fr: "Pas de données
(hors ligne)",
es: "No hay datos
(sin conexión)",
pt: "Não há dados
(sem conexão)"
}
};
})();
pages/_shared/onlyOnline/onlyOnline.ls
(function(){
return function(){
return Div({
fontSize: "0.8em",
color: Color.grey[400],
padding: "0 0.3em"
}).html(T("noDataOffline"));
};
})();
pages/_shared/reportPopup/01_popupChoices/_t.ls
(function(){
return {
whatTitle: {
de: "Warum möchtest du die Liste melden?",
en: "Why do you want to report the list?",
fr: "Pourquoi veux-tu signaler la liste ?",
es: "¿Por qué quieres reportar la lista?",
pt: "Por quê você quer denunciar a lista?"
},
inappropriate: {
de: "Ist unangemessen",
en: "It is inappropriate",
fr: "Contenu inapproprié",
es: "Es inapropiada",
pt: "É inapropriada"
},
copyright: {
de: "Verstößt gegen Urheberrecht",
en: "It violates copyright law",
fr: "Violation du droit d'auteur",
es: "Viola los derechos de autor",
pt: "Infringe os direitos autorais"
}
};
})();
pages/_shared/reportPopup/01_popupChoices/buttons/button/button.ls
(function(){
return function(choose, type){
var tap;
tap = function(){
return choose(type);
};
return Div().html(Button({
label: (function(){
switch (type) {
case "inappropriate":
return T("inappropriate");
case "copyright":
return T("copyright");
}
}()),
labelAllowWrap: true
}).css({
margin: "0.4em"
}).tap(tap));
};
})();
pages/_shared/reportPopup/01_popupChoices/buttons/buttons.ls
(function(){
return function(choose){
return Div().html(inc("button/button")(choose, "inappropriate"), inc("button/button")(choose, "copyright"));
};
})();
pages/_shared/reportPopup/01_popupChoices/popup.ls
(function(){
return function(){
var choose, div;
choose = function(type){
return inc("../02_popupInput/popup")(type);
};
div = Div({
padding: "1em 0.5em"
}).html(inc("title/title")(), inc("buttons/buttons")(choose));
return inc("/../app01/lib/gui/popup/popup")({
html: div
});
};
})();
pages/_shared/reportPopup/01_popupChoices/title/title.ls
(function(){
return function(){
return Div({
paddingBottom: "0.7em"
}).html(T("whatTitle"));
};
})();
pages/_shared/reportPopup/02_popupInput/_t.ls
(function(){
return {
whatTitle: {
de: "Weitere Kommentare:",
en: "Further comments:",
fr: "Autres commentaires :",
es: "Más comentarios:",
pt: "Mais comentários:"
},
send: {
de: "Senden",
en: "Send",
fr: "Envoyer",
es: "Enviar",
pt: "Enviar"
}
};
})();
pages/_shared/reportPopup/02_popupInput/buttonBack/button.ls
(function(){
return function(input){
var tap;
tap = function(){
return inc("../../01_popupChoices/popup")();
};
return inc("/../app01/lib/gui/link/link")({
label: T("backButton"),
direction: "left"
}).css({
margin: "0.3em",
verticalAlign: "-0.1em"
}).tap(tap);
};
})();
pages/_shared/reportPopup/02_popupInput/buttonSubmit/button.ls
(function(){
return function(input, type){
var tap;
tap = function(){
var ref$, v;
if ((ref$ = app.currentPopup) != null) {
ref$.close();
}
v = input.getValue().trim();
if (v === "") {
v = undefined;
}
return inc("../submit/submit")(v, type);
};
return Button(T("send")).css({
margin: "0.3em"
}).tap(tap);
};
})();
pages/_shared/reportPopup/02_popupInput/input/input.ls
(function(){
return function(){
var input;
return input = inc("/../app01/lib/gui/inputEditable/input")({
multiline: true,
lineHeight: "1.5em",
linePadding: "0 0.3em"
}).css({
margin: "1em 0.5em",
minHeight: "6em",
maxHeight: "calc(var(--centerHeight) * 0.25)"
});
};
})();
pages/_shared/reportPopup/02_popupInput/popup.ls
(function(){
return function(type){
var div, input;
div = Div({
padding: "1em 0.5em"
}).html(inc("title/title")(), input = inc("input/input")(), inc("buttonBack/button")(input), inc("buttonSubmit/button")(input, type));
return inc("/../app01/lib/gui/popup/popup")({
html: div
});
};
})();
pages/_shared/reportPopup/02_popupInput/submit/submit.ls
(function(){
return function(text, type){
var ld, listCode, spinner;
ld = app.currentPage.learnListDescription;
listCode = ld.listCode;
spinner = inc("/../app01/lib/gui/spinnerOverlay/overlay")(null, null, true);
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/reportList/report"),
params: {
listCode: ld.listCode,
text: text,
type: type
},
requiredSamePage: true,
onOffline: function(){
spinner.close();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onError: function(){
spinner.close();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onCompleted: function(result){
spinner.close();
if (result.status !== "ok") {
return inc("/../app01/lib/gui/errorPopup/popup")();
} else {
return inc("../../03_popupDone/popup")();
}
}
});
};
})();
pages/_shared/reportPopup/02_popupInput/title/title.ls
(function(){
return function(){
return Div({
paddingBottom: "0.2em"
}).html(T("whatTitle"));
};
})();
pages/_shared/reportPopup/03_popupDone/_t.ls
(function(){
return {
thanksForReporting: {
de: "Danke für deine Meldung!",
en: "Thanks for letting us know!",
fr: "Merci pour ton message !",
es: "¡Gracias por tu comentario!",
pt: "Agradecemos pelo seu comentário!"
}
};
})();
pages/_shared/reportPopup/03_popupDone/popup.ls
(function(){
return function(){
var tap, div, popup;
tap = function(){
return popup.close();
};
div = Div({
width: "18em",
margin: "1em 0"
}).html(Div({
paddingBottom: "0.8em"
}).html(T("thanksForReporting")), Button(T("ok")).css({
minWidth: "5em"
}).tap(tap));
return popup = inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/_shared/reportPopup/start.ls
(function(){
return function(page){
return inc("01_popupChoices/popup")(page);
};
})();
pages/_shared/sublevelBar/bar.ls
(function(){
return function(params){
var totalSublevels, selectedSublevelId, elementsList, onSelect, div, sublevelDivs, id, whiteRoundBorder, ref$, thumb;
if (!app.currentPage.learnListDescription) {
return;
}
totalSublevels = params.totalSublevels;
selectedSublevelId = params.selectedSublevelId;
elementsList = app.currentPage.learnListDescription.sublevels;
onSelect = function(sublevelId){
if (typeof thumb != 'undefined' && thumb !== null) {
thumb.updateThumb(sublevelId - 1, false);
}
return typeof params.onSelect == 'function' ? params.onSelect(sublevelId) : void 8;
};
div = Div({
display: "flex",
flexWrap: "wrap",
alignItems: "stretch",
width: "6em",
height: "1.15em"
}).append(sublevelDivs = (function(){
var i$, to$, results$ = [];
for (i$ = 1, to$ = totalSublevels; i$ <= to$; ++i$) {
id = i$;
results$.push(inc("sublevel/sublevel")(params, id, id === selectedSublevelId, onSelect));
}
return results$;
}()), whiteRoundBorder = Div({
position: "absolute",
left: "-5px",
top: "-3px",
right: "-5px",
bottom: "-3px",
border: "7px solid white",
borderRadius: "999px",
pointerEvents: "none"
}));
if (((ref$ = params.comingFromPage) === "intro" || ref$ === "finish") && totalSublevels > 1) {
div.append(thumb = inc("thumb/thumb")(params, div, sublevelDivs, elementsList, selectedSublevelId));
}
div.selectFromSlider = function(index){
var sublevel;
sublevel = div.findAll(".barSublevel")[index];
return sublevel.select();
};
div.getSelectedSublevelId = function(){
var i$, ref$, len$, el;
for (i$ = 0, len$ = (ref$ = div.childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
if (typeof el.isSelected == 'function' && el.isSelected()) {
return el.getSublevelId();
}
}
return null;
};
return div;
};
})();
pages/_shared/sublevelBar/sublevel/bar/bar.ls
(function(){
return function(params, sublevelId){
var progressColors, c;
progressColors = inc("calcProgressColors/calc")(params, sublevelId);
return Div({
flex: "1 1 auto",
display: "flex",
background: Color.grey[200],
alignItems: "stretch",
justifyContent: "stretch"
}).append(progressColors ? (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = progressColors).length; i$ < len$; ++i$) {
c = ref$[i$];
results$.push(Div({
flex: "1 1 auto",
background: c === "green"
? Color.green[400]
: c === "red"
? Color.red[400]
: c === "grey" ? Color.grey[400] : void 8
}));
}
return results$;
}()) : void 8);
};
})();
pages/_shared/sublevelBar/sublevel/bar/calcProgressColors/calc.ls
(function(){
return function(params, sublevelId){
var levelPath, e, s, l, colors, parts, i$, len$, p, total, j$, i;
levelPath = params.levelPath.split("/sublevel")[0];
levelPath = levelPath + "/sublevel-" + sublevelId;
e = app.currentPage.context === "groupSingle"
? inc("calcGroupSingleEvent/calc")(levelPath)
: params.events
? _.find(params.events, {
event: "finishLevel",
puid: levelPath
})
: log.findLast({
event: "finishLevel",
puid: levelPath
});
if (!e) {
return;
}
s = e.progressColors;
s = s.split("g").join("g|");
s = s.split("r").join("r|");
s = s.split("b").join("b|");
l = {
b: "grey",
r: "red",
g: "green"
};
colors = [];
parts = s.split("|");
for (i$ = 0, len$ = parts.length; i$ < len$; ++i$) {
p = parts[i$];
if (p) {
if (p.length === 1) {
colors.push(l[p]);
} else {
total = +p.substr(0, p.length - 1);
for (j$ = 1; j$ <= total; ++j$) {
i = j$;
colors.push(l[_.last(p)]);
}
}
}
}
return colors;
};
})();
pages/_shared/sublevelBar/sublevel/bar/calcProgressColors/calcGroupSingleEvent/calc.ls
(function(){
return function(levelPath){
var page, publicId, member, events, e;
page = app.currentPage;
publicId = page.memberDescription.publicId;
member = _.find(page.levelsReport.members, {
publicId: publicId
});
events = member != null ? member.events : void 8;
return e = _.find(events, {
event: "finishLevel",
puid: levelPath
});
};
})();
pages/_shared/sublevelBar/sublevel/sublevel.ls
(function(){
return function(params, sublevelId, selected, onSelect){
var select, deselect, div;
selected == null && (selected = false);
select = function(){
var i$, ref$, len$, el;
for (i$ = 0, len$ = (ref$ = div.parent().childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
if (el !== div) {
if (typeof el.deselect == 'function') {
el.deselect();
}
}
}
div.replaceWith(inc(THISFILE)(params, sublevelId, true, onSelect));
return onSelect(sublevelId);
};
deselect = function(){
if (selected) {
return div.replaceWith(inc(THISFILE)(params, sublevelId, false, onSelect));
}
};
div = Div({
flex: "1 1 auto",
display: "flex",
borderLeft: "1px solid white",
borderRight: "1px solid white",
justifyContent: "stretch",
alignItems: "stretch"
}).addClass("barSublevel").html(inc("bar/bar")(params, sublevelId)).tap(params.totalSublevels > 1 ? select : void 8);
div.deselect = function(){
return deselect();
};
div.select = function(){
return select();
};
div.isSelected = function(){
return selected;
};
div.getSublevelId = function(){
return sublevelId;
};
return div;
};
})();
pages/_shared/sublevelBar/thumb/_t.ls
(function(){
return {
part: {
de: "Teil $1",
en: "Part $1",
fr: "Partie $1",
es: "Parte $1",
pt: "Parte $1"
}
};
})();
pages/_shared/sublevelBar/thumb/thumb.ls
(function(){
return function(params, parent, sublevelDivs, elementsList, firstSublevelIndex){
var parentOffset, sublevelWidth, index, sublevelOffsets, updateThumb, onPageStart, onMove, onEnd, div, thumb, dragElement;
sublevelOffsets = [];
updateThumb = function(i, doInstant){
var posX;
if (i === sublevelOffsets.length) {
posX = _.last(sublevelOffsets).right - parentOffset.left;
} else {
posX = sublevelOffsets[i].left - parentOffset.left;
}
dragElement.css({
transform: "translate(" + posX + "px, 0px)"
});
if (doInstant) {
thumb.css({
left: posX + "px"
});
} else {
thumb.keyframeAnimate({
duration: 200,
keyframes: {
"100%": {
left: posX + "px"
}
}
});
}
if (params.comingFromPage === "intro" && i !== sublevelOffsets.length) {
return thumb.updateLabel(i);
}
};
onPageStart = function(){
var i$, to$, i;
parentOffset = parent.offset();
sublevelWidth = parentOffset.width / sublevelDivs.length;
for (i$ = 0, to$ = sublevelDivs.length; i$ < to$; ++i$) {
i = i$;
sublevelOffsets.push({
left: parentOffset.left + sublevelWidth * i,
right: parentOffset.left + sublevelWidth * (i + 1)
});
}
return updateThumb(firstSublevelIndex - 1, true);
};
onMove = function(e){
var position;
position = Math.max(Math.min(e.clientPosition.x, parentOffset.right - 1), parentOffset.left);
index = _.findIndex(sublevelOffsets, function(offset){
var ref$;
return offset.left <= (ref$ = position + sublevelWidth / 2) && ref$ < offset.right;
});
if (index === -1) {
index = sublevelOffsets.length - 1;
}
thumb.css({
left: (position - parentOffset.left) + "px"
});
if (params.comingFromPage === "intro") {
return thumb.updateLabel(index);
}
};
onEnd = function(e){
if (index != null) {
updateThumb(index, false);
return parent.selectFromSlider(index);
}
};
div = Div({
position: "absolute",
top: "-3px",
left: "-0.85em",
zIndex: 1
}).html(thumb = inc("thumbDiv/div")(elementsList), dragElement = Div({
position: "absolute",
width: "30px",
height: "30px"
}).drag({
onMove: onMove,
onEnd: onEnd,
tapZone: "0.5em",
animation: function(){}
})).onDomAppendAndVisible(onPageStart);
div.updateThumb = updateThumb;
return div;
};
})();
pages/_shared/sublevelBar/thumb/thumbDiv/div.ls
(function(){
return function(elementsList){
var updateLabel, div, label;
updateLabel = function(index){
return label.html(T("part", index + 1));
};
div = Div({
position: "absolute",
top: "3px",
display: "flex",
width: "1.3em",
height: "1.3em",
border: "1px solid " + Color.grey[300],
borderRadius: "50%",
background: Color.grey[200]
}).html(SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[500],
size: "14px"
}), Div({
display: "flex",
position: "absolute",
flexDirection: "column",
width: "100px",
textAlign: "center",
pointerEvents: "none"
}).html(label = Div({
top: "-30px"
})));
div.updateLabel = updateLabel;
return div;
};
})();
pages/_shared/tagNewFork/_t.ls
(function(){
return {
newlyConverted: {
de: "neu umgewandelt",
en: "recently modified",
fr: "récemment modifiée",
es: "modificado recientemente",
pt: "modificado recentemente"
}
};
})();
pages/_shared/tagNewFork/tag.ls
(function(){
return function(ld, context){
var age;
if (_.includes(context, "group") || !ld.forkedAt || !ld.isCreator) {
return;
}
age = new Date() - new Date(ld.forkedAt);
age = _.round(age / (1000 * 60));
if (age > 10) {
return;
}
return Div({
display: "inline-block",
fontSize: "0.75em",
color: Color.grey[650],
lineHeight: "1.5em",
background: Color.blue[50],
borderRadius: "5px",
padding: "0 0.2em"
}).html(T("newlyConverted"));
};
})();
pages/_shared/tagNewList/_t.ls
(function(){
return {
newlyCreated: {
de: "neu angelegt",
en: "newly created",
fr: "récemment créé",
es: "creado recientemente",
pt: "criado recentemente"
}
};
})();
pages/_shared/tagNewList/tag.ls
(function(){
return function(ld, context){
var age;
if (_.includes(context, "group") || ld.forkedAt || !ld.isCreator) {
return;
}
age = new Date() - new Date(ld.created);
age = _.round(age / (1000 * 60));
if (age > 10) {
return;
}
return Div({
display: "inline-block",
fontSize: "0.75em",
color: Color.grey[650],
lineHeight: "1.5em",
background: Color.blue[50],
borderRadius: "5px",
padding: "0 0.2em"
}).html(T("newlyCreated"));
};
})();
pages/_shared/textEditor/css/css.ls
(function(){
return function(editor){
var s;
s = Style();
s.innerHTML = '\n .lineNumbers > p {\n position : absolute;\n right : 0;\n padding : 0 0.3em 0 0.2em;\n margin : 0;\n line-height : 1.7em;\n min-height : 1.7em;\n min-width : 1.5em;\n border : 1px solid transparent;\n font-family : inherit;\n text-align : right;\n }\n';
return s.appendTo(editor.divContent);
};
})();
pages/_shared/textEditor/divContent/div.ls
(function(){
return function(editor){
return Div({
display: "flex",
justifyContent: "stretch",
alignItems: "stretch"
}).appendTo(editor.scrollDiv).onDomAppend(function(){
return this.css({
minHeight: editor.scrollDiv.offsetHeight - 2 + "px"
});
});
};
})();
pages/_shared/textEditor/divEditable/div.ls
(function(){
return function(editor){
var c;
return inc("/../app01/lib/gui/divEditable/div")({
parseMode: "learnListEditor",
onHeightChange: function(){
return typeof editor.updateLineNumbers == 'function' ? editor.updateLineNumbers() : void 8;
},
onCursorChange: c = function(){
return editor.onCursorChange();
},
onChange: editor.onChange,
onChangeLine: editor.onChangeLine,
onSoftKeyboardHeightChange: c,
onImageTap: editor.onImageTap,
onPasteImage: editor.onPasteImage
}).css({
flex: "1 1 auto",
paddingBottom: "4em"
}).onWindowResize(function(){
return setTimeout(function(){
return editor.updateLineNumbers();
});
}).appendTo(editor.divContent);
};
})();
pages/_shared/textEditor/divLineNumbers/div.ls
(function(){
return function(editor){
var div;
return div = Div().addClass("lineNumbers").css({
background: "rgba(0, 0, 0, 0.015)"
}).appendTo(editor.divContent);
};
})();
pages/_shared/textEditor/editor.ls
(function(){
return function(params){
var editor, div;
params == null && (params = {});
editor = {
debug: params.debug || false,
onImageTap: params.onImageTap,
onChange: params.onChange,
onChangeLine: params.onChangeLine,
onPasteImage: params.onPasteImage
};
editor.scrollDiv = inc("scrollDiv/div")(editor);
editor.divContent = inc("divContent/div")(editor);
editor.divLineNumbers = inc("divLineNumbers/div")(editor);
editor.divEditable = inc("divEditable/div")(editor);
editor.css = inc("css/css")(editor);
editor.updateLineNumbers = function(){
return inc("updateLineNumbers/update")(editor);
};
editor.setValue = function(value){
return inc("setValue/set")(editor, value);
};
editor.getValue = editor.divEditable.getValue;
editor.onCursorChange = function(l){
return inc("onCursorChange/onChange")(editor, l);
};
editor.setValue((params != null ? params.value : void 8) || "");
div = editor.scrollDiv;
div.editor = editor;
div.setValue = function(v){
return editor.setValue;
};
div.getValue = editor.getValue;
div.insertAtCursor = editor.divEditable.insertAtCursor;
div.focus = function(){
return editor.divEditable.focus();
};
div.blur = function(){
return editor.divEditable.blur();
};
return div;
};
})();
pages/_shared/textEditor/onCursorChange/getSelectedLine/get.ls
(function(){
return function(){
var el;
el = window.getSelection().anchorNode;
while (el && el.nodeName !== "P") {
el = el.parentElement;
}
return el;
};
})();
pages/_shared/textEditor/onCursorChange/onChange.ls
(function(){
return function(editor){
var l, i$, ref$, len$, el, results$ = [];
l = inc("getSelectedLine/get")();
editor.scrollDiv.scrollElementIntoView(l, {
instant: true
});
for (i$ = 0, len$ = (ref$ = editor.scrollDiv.findAll(".activeLine")).length; i$ < len$; ++i$) {
el = ref$[i$];
el.removeClass("activeLine").css({
background: ""
});
}
for (i$ = 0, len$ = (ref$ = [l, l != null ? l.lineNumberDiv : void 8]).length; i$ < len$; ++i$) {
el = ref$[i$];
results$.push(el != null ? el.addClass("activeLine").css({
background: "rgba(0, 0, 0, 0.03)"
}) : void 8);
}
return results$;
};
})();
pages/_shared/textEditor/scrollDiv/div.ls
(function(){
return function(editor){
var div;
div = ScrollDiv();
if (inc("/../app01/lib/util/isiOs/isiOs")()) {
div.scrollContainerDiv.css({
marginBottom: "0",
marginRight: "0"
});
div.contentDiv.css({
paddingBottom: "0",
paddingRight: "0"
});
}
return div;
};
})();
pages/_shared/textEditor/setValue/set.ls
(function(){
return function(editor, value){
var set;
set = function(){
editor.divEditable.setValue(value);
return editor.updateLineNumbers();
};
if (editor.scrollDiv.isVisible()) {
return set();
} else {
return editor.scrollDiv.onDomAppend(set);
}
};
})();
pages/_shared/textEditor/updateLineNumbers/update.ls
(function(){
var retry;
return function(editor){
var lines, lineNumbers, dif, i$, i, newNumber, p, to$, ref$, maxWidth, len$, l, ln, d;
lines = editor.divEditable.childrenAll();
lineNumbers = editor.divLineNumbers.childrenAll();
dif = lines.length - lineNumbers.length;
if (dif > 0) {
for (i$ = 1; i$ <= dif; ++i$) {
i = i$;
newNumber = lines.length - dif + i;
p = P();
p.html(newNumber).appendTo(editor.divLineNumbers);
}
}
if (dif < 0) {
for (i$ = 1, to$ = Math.abs(dif); i$ <= to$; ++i$) {
i = i$;
if ((ref$ = editor.divLineNumbers.lastChild) != null) {
ref$.remove();
}
}
}
lineNumbers = editor.divLineNumbers.childrenAll();
maxWidth = 0;
for (i$ = 0, len$ = lines.length; i$ < len$; ++i$) {
i = i$;
l = lines[i$];
ln = lineNumbers[i];
ln.css({
top: l.offsetTop + "px",
height: l.offsetHeight + "px"
});
l.lineNumberDiv = ln;
maxWidth = Math.max(maxWidth, ln.offsetWidth);
}
d = editor.divLineNumbers;
if (maxWidth !== d.lastWidth) {
d.css({
width: maxWidth + "px"
});
d.lastWidth = maxWidth;
if (retry) {
retry = false;
return;
}
retry = true;
return editor.updateLineNumbers();
}
};
})();
pages/_shared/topbarAbortScan/_t.ls
(function(){
return {
toMyLists: {
de: "Zu Meine Listen",
en: "To My lists",
fr: "À Mes listes",
es: "A Mis listas",
pt: "Ir para minhas listas"
},
toList: {
de: "Zur Liste: $1",
en: "To list: $1",
fr: "À la liste : $1",
es: "A la lista $1",
pt: "Ir para a lista: $1"
}
};
})();
pages/_shared/topbarAbortScan/bar.ls
(function(){
return function(tap){
var lastPageBefore, div;
lastPageBefore = inc("calcLastPageBefore/calc")();
tap = function(){
return inc("onClose/onClose")(lastPageBefore);
};
div = Div({
display: "flex",
justifyContent: "flex-start",
flex: "0 0 auto",
padding: "0.5em 0",
width: "100%",
marginBottom: "-1px",
borderBottom: "1px solid " + Color.grey[250],
fontSize: "0.9em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/icon/close-mini.svg")
}).css({
margin: "0 0 0 0.2em"
}), Div({
flex: "0 1 auto",
textAlign: "left"
}).secureHtml(inc("calcLabel/calc")(lastPageBefore)).tap({
animation: "none",
tapZone: "0.5em 1.5em 0.5em 1.2em",
down: function(){
return div.css({
color: Color.blue[700]
});
},
up: function(){
div.css({
color: ""
});
return tap();
},
cancel: function(){
return div.css({
color: ""
});
}
}));
if (lastPageBefore.steps === 1) {
div.addClass("keyManager-esc androidBack").bind("androidBack", tap).bind("keyManager", tap);
}
return div;
};
})();
pages/_shared/topbarAbortScan/calcLabel/calc.ls
(function(){
return function(lastPageBefore){
var lp, ld;
lp = lastPageBefore.page;
if (_.includes(lp.path, "myLists")) {
return T("toMyLists");
} else {
ld = inc("/data/calcLearnListDescription/calc")(lp.params.listCode);
if (!ld) {
return T("cancelButton");
} else {
return T("toList", "" + ld.name + "");
}
}
};
})();
pages/_shared/topbarAbortScan/calcLastPageBefore/calc.ls
(function(){
return function(){
var steps, i$, i, h;
steps = -1;
for (i$ = app.pageHistory.length - 1; i$ >= 0; --i$) {
i = i$;
steps++;
h = app.pageHistory[i];
if (!_.includes(h.path, "create") && !_.includes(h.path, "scan") && !_.includes(h.path, "editor")) {
break;
}
}
return {
page: h,
steps: steps
};
};
})();
pages/_shared/topbarAbortScan/onClose/_t.ls
(function(){
return {
closeLabel: {
de: "Möchtest du wirklich zu Meine Listen zurückgehen?
Deine Änderungen gehen dann verloren.",
en: "Are you sure you want to go back to My lists?
Your changes will be lost.",
fr: "Veux-tu vraiment revenir à Mes listes ?
Tes modifications seront alors perdues.",
es: "¿Quieres volver?
Tus cambios se perderán.",
pt: "Tem certeza que deseja voltar?
Suas alterações serão perdidas."
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
},
backButton: {
de: "Zurückgehen",
en: "Go back",
fr: "Revenir en arrière",
es: "Volver atrás",
pt: "Voltar"
}
};
})();
pages/_shared/topbarAbortScan/onClose/onClose.ls
(function(){
return function(lastPageBefore){
var go;
go = function(){
startPage({
animation: "slideDown",
history: -lastPageBefore.steps
});
return inc("/_shared/logNewList/log")({
event: "abort"
});
};
if (lastPageBefore.steps < 2) {
return go();
} else {
return inc("/../app01/lib/gui/confirmPopup/popup")({
onConfirm: go,
label: T("closeLabel"),
yesLabel: T("backButton"),
noLabel: T("cancelButton")
});
}
};
})();
pages/_shared/urlDescription/_t.ls
(function(){
return {
learnLists: {
de: "Lernlisten",
en: "Study list",
fr: "Listes",
es: "Listas",
pt: "Listas de estudo"
},
pageUrl: {
de: "lernlisten",
en: "study-list",
fr: "listes",
es: "listas",
pt: "listas-de-estudo"
}
};
})();
pages/_shared/urlDescription/description.ls
(function(){
return function(){
return {
pageUrl: T("pageUrl"),
title: T("learnLists"),
metaDescription: ""
};
};
})();
pages/_shared/visibility/_t.ls
(function(){
return {
all: {
de: "alle",
en: "all",
fr: "tous",
es: "todos",
pt: "todos"
},
vSchools: {
de: "((1 Schule | $1 Schulen))",
en: "((1 school | $1 schools))",
fr: "(($1 école | $1 école | $1 écoles))",
es: "((1 escuela | $1 escuelas))",
pt: "((1 escola | $1 escolas))"
},
visibleForL: {
de: ", sichtbar für $1",
en: ", visible for $1",
fr: ", visible pour $1",
es: ", visible para $1",
pt: ", visible para $1"
}
};
})();
pages/_shared/visibility/visibility.ls
(function(){
return function(ld, isLearnListRow){
var v, l;
v = ld.visibility;
if (!(v != null && v.length) > 0) {
return;
}
if (isLearnListRow && app.currentPage.context === "allLists" && v[0] === "all") {
return;
}
l = v[0] === "all"
? T("all")
: T("vSchools", v.length);
return T("visibleForL", l);
};
})();
pages/_t.ls
(function(){
return {
dragCard: {
de: "Karten",
en: "Cards",
fr: "Cartes",
es: "Cartas",
pt: "Cartas"
},
writeTrain: {
de: "Schreiben Training",
en: "Practice writing",
fr: "Écrire",
es: "Escribir",
pt: "Escrever"
},
wordBuilder: {
de: "Worte bauen",
en: "Build words",
fr: "Construire des mots",
es: "Construir palabras",
pt: "Construir palavras"
},
writeTest: {
de: "Schreiben Test",
en: "Take the test",
fr: "Test",
es: "Haz el test",
pt: "Fazer prova"
},
assign: {
de: "Zuordnen",
en: "Match",
fr: "Associer",
es: "Asociar",
pt: "Atribuir"
},
english: {
de: "Englisch",
en: "English",
fr: "Anglais",
es: "Inglés",
pt: "Inglês"
},
german: {
de: "Deutsch",
en: "German",
fr: "Allemand",
es: "Alemán",
pt: "Alemão"
},
french: {
de: "Französisch",
en: "French",
fr: "Français",
es: "Francés",
pt: "Francês"
},
spanish: {
de: "Spanisch",
en: "Spanish",
fr: "Espagnol",
es: "Español",
pt: "Espanhol"
},
russian: {
de: "Russisch",
en: "Russian",
fr: "Russe",
es: "Ruso",
pt: "Russo"
},
ukrainian: {
de: "Ukrainisch",
en: "Ukrainian",
fr: "Ukrainian",
es: "Ucraniano",
pt: "Ucraniano"
},
portuguese: {
de: "Portugiesisch",
en: "Portuguese",
fr: "Portugais",
es: "Portugués",
pt: "Português"
},
question: {
de: "Frage",
en: "Question",
fr: "Question",
es: "Pregunta",
pt: "Pergunta"
},
answer: {
de: "Antwort",
en: "Answer",
fr: "Réponse",
es: "Respuesta",
pt: "Resposta"
},
entries: {
de: "Einträge: $1",
en: "Entries: $1",
fr: "Entrées: $1",
es: "Entradas: $1",
pt: "Entradas: $1"
},
lastViewed: {
de: "Zuletzt angesehen",
en: "Last viewed",
fr: "Vu en dernier",
es: "Visto por última vez",
pt: "Visto por último"
},
lastStarted: {
de: "Zuletzt gestartet",
en: "Last started",
fr: "Vu en dernier",
es: "Visto por última vez",
pt: "Iniciado por último"
},
confirmSave: {
de: "Möchtest du deine Änderungen speichern?",
en: "Would you like to save your changes?",
fr: "Veux-tu enregistrer tes modifications ?",
es: "¿Quieres guardar tus cambios?",
pt: "Você gostaria de salvar suas alterações?"
}
};
})();
pages/createNewList/01_chooseType/_t.ls
(function(){
return {
pageTitle: {
de: "Bitte wähle einen Listentyp:",
en_gb: "Please choose a study list category:",
en: "Please choose a study list category:",
fr: "Choisis un format pour créer une liste :",
es: "Elige una categoría:",
pt: "Por favor, selecione uma categoria:"
}
};
})();
pages/createNewList/01_chooseType/_topbar/topbar.ls
(function(){
return function(){
return inc("/../app01/addons/topbar2/topbar")({
title: T("pageTitle")
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/createNewList/01_chooseType/list/calcData/calc.ls
(function(){
return function(page){
var listTypes, allowedTypes, res$, i$, len$, listType;
listTypes = inc("/pages/_shared/listTypes/types")();
res$ = [];
for (i$ = 0, len$ = listTypes.length; i$ < len$; ++i$) {
listType = listTypes[i$];
if (listType.l1 !== engine.guiLanguage) {
continue;
}
if (listType.isDebug && !engine.isDebug) {
continue;
}
res$.push(listType);
}
allowedTypes = res$;
if (page.context === "newListScan") {
allowedTypes = _.filter(allowedTypes, function(type){
return !_.startsWith(type.type, "question");
});
}
return allowedTypes;
};
})();
pages/createNewList/01_chooseType/list/list.ls
(function(){
var lastListPosition;
return function(page){
var data;
data = inc("calcData/calc")(page);
page.listData = _.concat({
rowType: "spacer"
}, data, {
rowType: "spacer"
});
return page.list = ListDiv({
data: page.listData,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: page.params.history <= 0 ? lastListPosition : void 8
}).css({
height: "var(--centerHeight)",
textAlign: "left"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
});
};
})();
pages/createNewList/01_chooseType/list/row/row.ls
(function(){
return function(page){
return function(data){
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(data.rowType === "spacer"
? inc("spacer/spacer")()
: inc("row/row")(page, data)));
};
};
})();
pages/createNewList/01_chooseType/list/row/row/cover/cover.ls
(function(){
return function(data){
return inc("/pages/_shared/calcLearnListCover/cover")({
type: data.type
}).css({
fontSize: "0.72em",
flex: "0 0 auto"
});
};
})();
pages/createNewList/01_chooseType/list/row/row/debugIcon/icon.ls
(function(){
return function(data){
if (!data.isDebug) {
return;
}
return SvgIcon({
svg: path("/../app01/lib/svg/shape/debug.svg")
});
};
})();
pages/createNewList/01_chooseType/list/row/row/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[700]
});
};
})();
pages/createNewList/01_chooseType/list/row/row/label/label.ls
(function(){
return function(data){
return Div({
paddingLeft: "0.4em",
flex: "1 1 auto"
}).html(data.name);
};
})();
pages/createNewList/01_chooseType/list/row/row/newTag/tag.ls
(function(){
return function(data){
if (!data.isNewUntil) {
return;
}
return inc("/../app01/lib/gui/newTag/newTag")(data.isNewUntil);
};
})();
pages/createNewList/01_chooseType/list/row/row/row.ls
(function(){
return function(page, data){
var b;
return Div({
display: "flex",
borderBottom: b = "1px solid " + Color.grey[200],
borderTop: b,
background: "white",
marginTop: "-2px",
minHeight: "4.2em"
}).html(inc("cover/cover")(data), inc("label/label")(data), Div({
flex: "1 1 auto"
}), inc("newTag/tag")(data), inc("debugIcon/icon")(data), inc("icon/icon")()).tap(function(){
return page.chooseType(data.type);
});
};
})();
pages/createNewList/01_chooseType/list/row/spacer/spacer.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/createNewList/01_chooseType/page.ls
(function(){
return function(page){
page.context = page.params.context;
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
page.chooseType = function(listType){
inc("/_shared/logNewList/log")({
event: "chooseType",
type: listType
});
if (page.context === "newListEditor") {
return inc("../02_edit/start")(listType);
} else if (page.context === "newListScan") {
return inc("../02_scan/start")(listType);
}
};
return page.html(inc("list/list")(page));
}
};
};
})();
pages/createNewList/02_edit/start.ls
(function(){
return function(listType){
return inc("/pages/learnList/editor/start")({
context: "newListEditor",
listType: listType
});
};
})();
pages/createNewList/02_scan/start.ls
(function(){
return function(type){
return startPage({
path: path("/pages/scan/01_chooseImage/page"),
animation: "slideLeft",
params: {
context: "newList",
listType: type
}
});
};
})();
pages/createNewList/03_setName/_t.ls
(function(){
return {
pageTitle: {
de: "Name der Lernliste",
en: "Study List Name",
fr: "Nom de la liste",
es: "Nombre de la lista",
pt: "Nome da lista de estudo"
},
label: {
de: "Name der neuen Lernliste:",
en: "Name of the new study list:",
fr: "Nom de la nouvelle liste :",
es: "Nombre de la nueva lista:",
pt: "Nome da nova lista de estudo:"
},
errorNameEmpty: {
de: "Der Name darf nicht leer sein.",
en_gb: "The name cannot be left empty.",
en: "The name cannot be left blank.",
fr: "Le nom ne peut pas rester vide.",
es: "El nombre no puede quedar vacío.",
pt: "O nome não pode ficar vazio."
},
createList: {
de: "Liste anlegen",
en: "Create list",
fr: "Créer la liste",
es: "Crear lista",
pt: "Criar lista"
}
};
})();
pages/createNewList/03_setName/_topbar/topbar.ls
(function(){
return function(){
return inc("/../app01/addons/topbar2/topbar")({
title: T("pageTitle"),
back: function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
}
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/createNewList/03_setName/page.ls
(function(){
return function(page){
var items;
page.context = page.params.context;
items = inc("/../app01/lib/util/cache/get/get")("listItems");
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var submit, form;
submit = function(){
var v;
v = form.input.getValue();
if (v.length === 0) {
form.error.html(T("errorNameEmpty"));
return form.input.start();
} else {
return inc("submit/submit")(page, form);
}
};
page.html(form = inc("/../app01/lib/gui/inputForm/inputForm")({
label: T("label"),
submit: submit,
submitLabel: T("createList"),
native: true,
cancel: false,
forceShowButtons: true,
screenKeyboardShiftStatus: true
}));
return form.input.start();
}
};
};
})();
pages/createNewList/03_setName/submit/log/log.ls
(function(){
return function(page, name, result){
inc("/_shared/logNewList/log")({
event: "createList",
name: name,
context: page.context,
listCode: result.listCode
});
return inc("/_shared/logNewList/log")({
event: "finish",
context: page.context
});
};
})();
pages/createNewList/03_setName/submit/submit.ls
(function(){
return function(page, form){
var name, items, type, onError;
name = form.input.getValue();
name = name.trim();
items = inc("/../app01/lib/util/cache/get/get")("listItems");
items = _.map(items, function(i){
return _.omit(i, "rowIndex");
});
type = page.params.listType;
form.showSpinner();
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/create/create"),
params: {
name: name,
type: type,
items: items
},
requiredVisibleDiv: form,
onError: onError = function(error){
form.hideSpinner();
return form.error.html(error.message || T("errorOops"));
},
onOffline: function(){
form.input.start();
form.hideSpinner();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(result){
if (result.status !== "ok") {
return onError(result);
} else {
inc("log/log")(page, name, result);
return log.sync(function(){
return startPage({
animation: "slideDown",
history: function(path){
return !_.includes(path, "create") && !_.includes(path, "scan") && !_.includes(path, "editor");
},
params: {
scrollToListCode: result.listCode
}
});
});
}
}
});
};
})();
pages/createNewList/start.ls
(function(){
return function(context, startElement){
inc("/_shared/logNewList/log")({
event: "start",
context: context,
startElement: startElement
});
return startPage({
path: path("01_chooseType/page"),
animation: "slideUp",
params: {
context: context
}
});
};
})();
pages/learnList/_shared/loadFile/load.ls
(function(){
return function(page, onDone){
var ld, fileId, fileFolder, load, onLoaded, onError;
ld = page.learnListDescription;
fileId = "learnList/" + page.listCode;
fileFolder = "learnLists/" + page.listCode + "/learnList";
page.html(inc("/../app01/lib/gui/spinner/spinner")());
load = function(){
return inc("/../app01/lib/util/downloadContentFile/download")({
fileId: fileId,
fileFolder: fileFolder,
etag: ld.etag,
returnFileContent: true,
onLoaded: onLoaded,
onError: onError
});
};
onLoaded = function(result){
var items, d;
page.listReport = result;
items = _.cloneDeep(result.items);
items = _.map(items, function(i){
return _.omit(i, "a.hyphens");
});
page.items = items;
page.itemsOriginal = _.cloneDeep(items);
d = inc("/../app01/lib/util/cache/set/set");
d("listItems", page.items);
d("listItemsOriginal", page.itemsOriginal);
return onDone();
};
onError = function(error){
var ref$;
if (error.error === "offline") {
if ((ref$ = page.bottom) != null) {
ref$.hide();
}
return inc("/../app01/lib/offline/offlinePage/offlinePage")(page);
} else {
debug(error);
return inc("/../app01/lib/gui/errorPopup/popup")();
}
};
return load();
};
})();
pages/learnList/_shared/popupImage/_t.ls
(function(){
return {
modifyImage: {
de: "Bild ändern"
},
titleSearch: {
de: "ANTON-Bilder Suche"
},
search: {
de: "Suchen"
},
noImagesFound: {
de: "Es wurden keine Bilder gefunden."
}
};
})();
pages/learnList/_shared/popupImage/buttonModify/button.ls
(function(){
return function(p){
return Button(T("modifyImage")).css({
margin: "1em 0.5em 0.5em"
}).tap(function(){
return inc("../popupImageSearch/popup")({
searchText: p.searchText,
onModifiedImageId: p.onModifiedImageId
});
});
};
})();
pages/learnList/_shared/popupImage/buttonRemove/button.ls
(function(){
return function(p){
return Button({
icon: path("/../app01/lib/svg/icon/bin.svg")
}).css({
margin: "1em 0.5em 0.5em"
}).tap(function(){
var ref$;
p.onModifiedImageId();
return (ref$ = app.currentPopup) != null ? ref$.close() : void 8;
});
};
})();
pages/learnList/_shared/popupImage/image/image.ls
(function(){
return function(p){
var listCode, ref$, imageId;
listCode = ((ref$ = app.currentPage.learnListDescription) != null ? ref$.listCode : void 8) || app.currentPage.listCode;
imageId = p.imageId;
return Div({
display: "flex"
}).append(inc("/../app01/lib/gui/image/image")({
id: imageId,
fileFolder: "learnLists/" + listCode + "/_images",
etag: "any"
}).css({
width: "20em",
height: "20em",
border: "1px solid " + Color.grey[150]
}));
};
})();
pages/learnList/_shared/popupImage/popup.ls
(function(){
return function(p){
var popup;
if (!p.imageId && p.canModify) {
return inc("popupImageSearch/popup")(p);
}
popup = {};
popup.html = Div({
padding: "0.5em"
}).append(inc("image/image")(p), p.canModify ? [inc("buttonRemove/button")(p), inc("buttonModify/button")(p)] : void 8);
return inc("/../app01/lib/gui/popup/popup")(popup);
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/_submit/submit.ls
(function(){
return function(popup){
var input, value;
input = popup.input;
value = input.getValue();
if (!value) {
return;
}
input.stop();
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/images/search/search"),
params: {
guiLanguage: "en_us",
search: value
},
onError: function(){
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(result){
return popup.imageTiles.update(result.images);
}
});
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/imageTiles/row/row.ls
(function(){
return function(popup){
return function(data){
if (data.images) {
return inc("rowImageTiles/row")(popup, data);
} else {
return inc("rowNothingFound/row")();
}
};
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/imageTiles/row/rowImageTiles/imageTile/tile.ls
(function(){
return function(popup, image){
var w, tap;
w = popup.imageTiles.width() - 2;
tap = function(){
return popup.selectImageId(image.imageId);
};
return Div({
width: w / 4 + "px",
height: w / 4 + "px"
}).onScopeRender(function(){
return this.append(inc("/../app01/lib/gui/image/image")({
id: image.imageId,
fileFolder: "NIX",
etag: "any"
}).css({
width: "100%",
height: "100%",
border: "1px solid " + Color.grey[150]
})).tap(tap);
});
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/imageTiles/row/rowImageTiles/row.ls
(function(){
return function(popup, data){
var image;
return Div({
display: "flex"
}).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = data.images).length; i$ < len$; ++i$) {
image = ref$[i$];
results$.push(inc("imageTile/tile")(popup, image));
}
return results$;
}()));
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/imageTiles/row/rowNothingFound/row.ls
(function(){
return function(){
return Div({
padding: "1em"
}).html(T("noImagesFound"));
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/imageTiles/tiles.ls
(function(){
return function(popup, data){
var div;
div = ListDiv({
data: data || [],
row: inc("row/row")(popup),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
}
}).css({
height: "15em",
border: "1px solid " + Color.grey[150],
background: Color.grey[50]
});
div.update = function(images){
var chunks, data, chunk;
chunks = _.chunk(images, 4);
data = chunks.length > 0
? (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = chunks).length; i$ < len$; ++i$) {
chunk = ref$[i$];
results$.push({
images: chunk
});
}
return results$;
}())
: ["none"];
return div.replaceWith(inc(THISFILE)(popup, data));
};
return popup.imageTiles = div;
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/popup.ls
(function(){
return function(p){
var popup;
popup = {};
popup.selectImageId = function(imageId){
popup.close();
return p.onModifiedImageId(imageId);
};
popup.html = Div({
padding: "1em 0.5em"
}).append(inc("title/title")(), inc("searchInput/input")(popup, p.searchText), inc("imageTiles/tiles")(popup));
inc("/../app01/lib/gui/popup/popup")(popup);
return requestAnimationFrame(function(){
return inc("_submit/submit")(popup);
});
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/searchInput/button/button.ls
(function(){
return function(popup, input){
var tap;
tap = function(){
return inc("../../_submit/submit")(popup, input);
};
return Div({
flex: "0 0 auto",
display: "flex",
alignSelf: "stretch",
background: Color.grey[250],
padding: "0em 0.5em"
}).html(T("search")).tap(tap);
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/searchInput/icon/icon.ls
(function(){
return function(){
return Div({
display: "flex",
background: Color.grey[100],
paddingLeft: "0.2em"
}).html(SvgIcon(path("/../app01/lib/svg/shape/search.svg")));
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/searchInput/input.ls
(function(){
return function(popup, searchText){
return Div({
display: "flex",
alignItems: "stretch"
}).append(inc("icon/icon")(), popup.input = inc("input/input")(popup, searchText), inc("button/button")(popup, popup.input));
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/searchInput/input/input.ls
(function(){
return function(popup, searchText){
var submit, input;
submit = function(){
return inc("../../_submit/submit")(popup, input);
};
return input = inc("/../app01/lib/gui/inputEditable/input")({
value: searchText,
onSubmit: submit
}).css({
flex: "1 1 auto"
});
};
})();
pages/learnList/_shared/popupImage/popupImageSearch/title/title.ls
(function(){
return function(){
return Div({
padding: "0.5em 0.5em 1em"
}).html(T("titleSearch"));
};
})();
pages/learnList/_shared/topRightEditButton/_t.ls
(function(){
return {
edit: {
de: "Bearbeiten",
en: "Edit",
fr: "Modifier",
es: "Editar",
pt: "Editar"
}
};
})();
pages/learnList/_shared/topRightEditButton/button.ls
(function(){
return function(page){
var ld, tap;
ld = page.learnListDescription;
if (!(ld.isCreator || ld.isBookmarked)) {
return;
}
tap = function(){
if (inc("/../app01/lib/util/isOnline/isOnline")()) {
return inc("menu/menu")(page, this);
} else {
return inc("/../app01/lib/offline/offlinePopup/popup")();
}
};
return Div({
display: "flex",
fontSize: "0.9em",
color: Color.blue[600],
padding: "0.1em 0.5em 0.1em 0"
}).html(T("edit")).tap(tap);
};
})();
pages/learnList/_shared/topRightEditButton/menu/_t.ls
(function(){
return {
menuEdit: {
de: "Einträge bearbeiten und hinzufügen",
en: "Edit and add entries",
fr: "Modifier et ajouter des entrées",
es: "Editar y agregar entradas",
pt: "Editar e adicionar entradas"
},
menuScan: {
de: "Neue Einträge einscannen",
en: "Scan new entries",
fr: "Scanner de nouvelles entrées",
es: "Escanear entradas nuevas",
pt: "Escanear novas entradas"
},
menuSettings: {
de: "Listen-Einstellungen",
en: "List Settings",
fr: "Paramètres de la liste",
es: "Configuración de listas",
pt: "Configuração de listas"
},
editOtherUsersList: {
de: "Du kannst diese Lernliste einer anderen Person hier bearbeiten. Beim Speichern deiner Änderungen wird sie dann in eine eigene Liste von dir umgewandelt.",
en: "Here you can edit this study list that was created by another user. Once you save your changes, you will appear as the author of a new version of this list.",
fr: "Tu peux modifier cette liste créée par un·e autre utilisateur·rice. Une fois tes modifications enregistrées, tu apparaîtras comme auteur·e de cette nouvelle version.",
es: "Aquí puedes editar una lista creada por alguien más. Al guardar los cambios que le hagas, aparecerás tú como el autor de la nueva lista. ",
pt: "Aqui você pode editar a lista de estudo de outra pessoa. Ao salvar suas alterações, você aparecerá como o(a) autor(a) de uma nova versão da lista."
}
};
})();
pages/learnList/_shared/topRightEditButton/menu/itemEdit/item.ls
(function(){
return function(page){
return {
label: T("menuEdit"),
icon: path("/../app01/lib/svg/shape/pen.svg"),
click: function(){
return inc("/pages/learnList/editor/start")({
listCode: page.params.listCode,
context: "editList"
});
}
};
};
})();
pages/learnList/_shared/topRightEditButton/menu/itemSaveForkHint/item.ls
(function(){
return function(page){
if (!page.learnListDescription.isBookmarked) {
return;
}
return {
label: Div({
fontSize: "0.9em",
maxWidth: "17em",
lineHeight: "1.6em"
}).html(T("editOtherUsersList"))
};
};
})();
pages/learnList/_shared/topRightEditButton/menu/itemScan/item.ls
(function(){
return function(page){
var listType;
listType = page.learnListDescription.type;
if (!_.startsWith(listType, "vocab") && !_.startsWith(listType, "spell")) {
return;
}
if (!page.learnListDescription.isCreator) {
return;
}
return {
label: T("menuScan"),
icon: path("/../app01/lib/svg/shape/camera.svg"),
click: function(){
inc("/_shared/logNewList/log")({
event: "start",
context: "addItemsScan"
});
return startPage({
path: path("/pages/scan/01_chooseImage/page"),
animation: "slideUp",
params: {
context: "addItemsScan",
listType: listType,
listCode: page.params.listCode
}
});
}
};
};
})();
pages/learnList/_shared/topRightEditButton/menu/itemSettings/item.ls
(function(){
return function(page){
if (!page.learnListDescription.isCreator) {
return;
}
return {
label: T("menuSettings"),
icon: path("/../app01/lib/svg/shape/gear.svg"),
click: function(){
return startPage({
path: path("/pages/learnList/settings/page"),
animation: "slideUp",
params: {
listCode: page.params.listCode
}
});
}
};
};
})();
pages/learnList/_shared/topRightEditButton/menu/menu.ls
(function(){
return function(page, button){
var listCode, listType, items;
listCode = page.params.listCode;
listType = page.learnListDescription.type;
items = [inc("itemEdit/item")(page, listCode), inc("itemScan/item")(page), inc("itemSettings/item")(page), inc("itemSaveForkHint/item")(page)];
return OverlayMenu({
referenceDiv: button,
items: items,
adjustXY: "-2 -3",
direction: "down left"
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/log/log.ls
(function(){
return function(page, items, result){
var ref$;
if (page.context === "editList") {
return;
}
return inc("/_shared/logNewList/log")({
event: "validateItems",
items: items,
errors: result.errors || [],
totalItems: items.length,
totalErrors: ((ref$ = result.errors) != null ? ref$.length : void 8) || 0,
editor: page.editor != null ? "text" : "list"
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/calcNewItems/calc.ls
(function(){
return function(itemsClean, currentListItemsClean){
var newItems, i$, len$, i, i2;
newItems = [];
for (i$ = 0, len$ = itemsClean.length; i$ < len$; ++i$) {
i = itemsClean[i$];
i2 = _.find(currentListItemsClean, fn$);
if (!i2) {
newItems.push(i);
}
}
return newItems;
function fn$(j){
return _.isEqual(i, j);
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/on.ls
(function(){
return function(page, result){
var items, currentListItems, newItems;
items = result.items;
currentListItems = result.currentListItems;
newItems = inc("calcNewItems/calc")(items, currentListItems);
if (newItems.length > 0) {
return inc("popupAddItems/popup")(items, newItems, currentListItems);
} else {
return inc("popupNoNewItems/popup")(items.length);
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/popupAddItems/_t.ls
(function(){
return {
textItems1: {
de: "((Soll $1 Eintrag | Sollen $1 Einträge)) nun zu deiner Liste hinzugefügt werden?",
en: "Should (($1 entry | $1 entries)) be added to your list?",
fr: "Veux-tu ajouter (($1 entrée | $1 entrées)) à ta liste ?",
es: "¿Quieres agregar (($1 entada | $1 entradas)) a tu lista?",
pt: "Você gostaria de adicionar (($1 entada | $1 entradas)) à sua lista?"
},
textItems2: {
de: "
((($1 Eintrag existiert | $1 Einträge existieren)) bereits.)",
en: "
((($1 entry already exists | $1 entries already exist)).)",
fr: "
((($1 entrée existe | $1 entrées existent)) déjà.)",
es: "
((($1 entrada ya existe | $1 entradas ya existen)).)",
pt: "
((($1 entrada já existe | $1 entradas já existem)).)"
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
},
addButton: {
de: "Hinzufügen",
en: "Add",
fr: "Ajouter",
es: "Agregar",
pt: "Adicionar"
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/popupAddItems/popup.ls
(function(){
return function(items, newItems, currentListItems){
var totalNew, totalExist, updateItems, label;
totalNew = newItems.length;
totalExist = items.length - newItems.length;
updateItems = _.concat(currentListItems, newItems);
label = T("textItems1", totalNew);
if (totalExist >= 1) {
label += T("textItems2", totalExist);
}
return inc("/../app01/lib/gui/confirmPopup/popup")({
yesLabel: T("addButton"),
noLabel: T("cancelButton"),
label: label,
onConfirm: function(){
return inc("submit/submit")(updateItems);
}
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/popupAddItems/submit/submit.ls
(function(){
return function(updateItems){
var page, p, type, listCode, spinner;
page = app.currentPage;
p = page.params;
type = p.listType;
listCode = p.listCode;
spinner = inc("/../app01/lib/gui/spinnerOverlay/overlay")(null, null, true);
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/updateListItems/update"),
params: {
type: type,
items: updateItems,
listCode: listCode
},
requiredSamePage: true,
onOffline: function(){
spinner.close();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onError: function(){
spinner.close();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onCompleted: function(result){
spinner.close();
if (result.status === "errorValidate") {
return inc("../../../onValidateError/on")(page, result);
} else if (result.status !== "ok") {
return inc("/../app01/lib/gui/errorPopup/popup")();
} else {
return log.sync(function(){
return startPage({
animation: "slideDown",
history: function(path){
return !_.includes(path, "create") && !_.includes(path, "scan");
}
});
});
}
}
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/popupNoNewItems/_t.ls
(function(){
return {
textItems: {
de: "((Diesen Eintrag | Diese $1 Einträge)) gibt es schon in deiner Liste.",
en: "((This entry is | These $1 entries are)) already in your list.",
fr: "((Cette entrée est | Ces $1 entrées sont)) déjà dans la liste.",
es: "((Esta entrada | Estas $1 entradas)) ya están en tu lista. ",
pt: "((Este item | Estes $1 itens)) já estão na sua lista."
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkAddItems/popupNoNewItems/popup.ls
(function(){
return function(total){
return inc("/../app01/lib/gui/errorPopup/popup")({
label: T("textItems", total)
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkNewList/on.ls
(function(){
return function(page){
return startPage({
path: path("/pages/createNewList/03_setName/page"),
animation: "slideLeft",
params: {
context: page.context,
listType: page.listType
}
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onOkUpdateList/on.ls
(function(){
return function(page, result){
var i$, ref$, len$, h, p;
if (page.listCode !== result.listCode) {
for (i$ = 0, len$ = (ref$ = app.pageHistory.slice(-3)).length; i$ < len$; ++i$) {
h = ref$[i$];
p = h.params;
if (p.listCode === page.listCode) {
p.listCode = result.listCode;
}
}
}
return log.sync(function(){
return startPage({
history: -1,
animation: "slideDown"
});
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/calcErrorLines/calc.ls
(function(){
return function(errors){
var errorLines, i$, len$, e, lineIndex;
errorLines = [];
for (i$ = 0, len$ = errors.length; i$ < len$; ++i$) {
e = errors[i$];
for (lineIndex in e.badItems) {
errorLines.push({
lineIndex: +lineIndex,
errorText: e.errorText
});
}
}
return errorLines = _.orderBy(errorLines, "lineIndex");
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/getErrorText/_t.ls
(function(){
return {
left: {
de: "linke",
en: "left",
fr: "de gauche",
es: "izquierda",
pt: "esquerda"
},
right: {
de: "rechte",
en: "right",
fr: "de droite",
es: "derecha",
pt: "direita"
},
spellDe: {
de: "deutsche",
en: "German",
fr: "allemand",
es: "alemán",
pt: "alemão"
},
wordTooLong: {
de: "Das $1 Feld hat zu viele Zeichen (maximal $2).",
en_gb: "The $1 term has too many characters (max. $2).",
en: "The $1 field contains too many characters (max. $2).",
fr: "L'entrée $1 contient trop de caractères (max. $2).",
es: "El campo de la $1 contiene demasiados caracteres (max. $2)",
pt: "O campo da $1 possui mais caracteres do que o permitido (máximo $2)."
},
missingValue: {
de: "Das $1 Feld ist leer.",
en: "The $1 field is empty.",
fr: "La partie $1 de cette entrée est vide.",
es: "El campo de la $1 está vacío. ",
pt: "O campo da $1 está vazio."
},
forbiddenTag: {
de: "Das $1 Feld enthält unerlaubte HTML-Elemente.",
en: "The $1 field contains html elements that are not permitted.",
fr: "L'entrée $1 contient des composants html non autorisés.",
es: "El campo de la $1 contiene elementos de html no autorizados.",
pt: "O campo da $1 contém elementos html não permitidos."
},
duplicateItems: {
de: "Eine identische Zeile existiert bereits weiter oben.",
en: "An identical entry already exists above.",
fr: "Une ligne identique existe déjà plus haut.",
es: "Hay una fila idéntica en la parte superior.",
pt: "Há uma linha idêntica na parte superior."
},
errorInLine: {
de: "Diese Zeile hat einen Fehler.",
en: "This entry contains an error.",
fr: "Cette ligne comporte une erreur.",
es: "Esta fila contiene un error.",
pt: "Esta linha contém um erro."
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/getErrorText/get.ls
(function(){
return function(e, listType){
var columnNames, errorText;
columnNames = _.startsWith(listType, "spell")
? {
a: ""
}
: {
a: T("left"),
b: T("right")
};
return errorText = (function(){
switch (e.errorType) {
case "maxCharsValueA":
return T("wordTooLong", columnNames.a, e.maxChars);
case "maxCharsValueB":
return T("wordTooLong", columnNames.b, e.maxChars);
case "missingValueA":
return T("missingValue", columnNames.a);
case "missingValueB":
return T("missingValue", columnNames.b);
case "forbiddenTagValueA":
return T("forbiddenTag", columnNames.a);
case "forbiddenTagValueB":
return T("forbiddenTag", columnNames.b);
case "duplicateItems":
return T("duplicateItems");
default:
return T("errorInLine");
}
}());
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/on.ls
(function(){
return function(page, result){
var errors, that, i$, len$, e, errorLines;
errors = result.errors;
if (that = _.find(errors, {
errorType: "maxItems"
})) {
inc("popupMaxItems/popup")(that);
return;
}
for (i$ = 0, len$ = errors.length; i$ < len$; ++i$) {
e = errors[i$];
e.errorText = inc("getErrorText/get")(e, page.listType);
}
errorLines = inc("calcErrorLines/calc")(errors);
return page.onValidateErrors(errorLines);
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/popupMaxItems/_t.ls
(function(){
return {
listTooLong: {
de: "Deine Liste ist zu lang.
Sie darf maximal $1 Einträge haben.",
en: "Your list is too long.
The list can have a maximum of $1 entries.",
fr: "Ta liste est trop longue.
Elle peut avoir $1 entrées maximum.",
es: "Tu lista es demasiado larga.
Puede tener máximo $1 entradas.",
pt: "Sua lista está muito longa.
Ela pode conter no máximo $1 entradas."
}
};
})();
pages/learnList/editor/_shared/submitEditedItems/onValidateError/popupMaxItems/popup.ls
(function(){
return function(e){
return inc("/../app01/lib/gui/errorPopup/popup")({
label: T("listTooLong", e.maxItems)
});
};
})();
pages/learnList/editor/_shared/submitEditedItems/submit.ls
(function(){
return function(page){
var context, items, unfreeze, spinner;
context = page.context;
items = _.map(page.items, function(i){
return _.omit(i, "a.hyphens", "rowIndex");
});
unfreeze = function(){
spinner.close();
page.css({
pointerEvents: ""
});
return page.buttonDone.css({
pointerEvents: ""
});
};
spinner = inc("/../app01/lib/gui/spinnerOverlay/overlay")(null, null, true);
page.css({
pointerEvents: "none"
});
page.buttonDone.css({
pointerEvents: "none"
});
return inc("/../app01/lib/util/pllsCall/call")({
path: context === "editList"
? path("/../server-apis-db2/apis/learnList/updateListItems/update")
: path("/../server-apis-db2/apis/learnList/validateScannedItemsBeta/validate"),
params: context === "editList"
? {
listCode: page.listCode,
items: items,
forkLearnList: page.learnListDescription.isBookmarked,
editor: page.editor != null ? "text" : "list"
}
: {
listCode: page.listCode,
items: items,
type: page.listType
},
requiredSamePage: true,
onOffline: function(){
unfreeze();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onError: function(){
unfreeze();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onCompleted: function(result){
unfreeze();
inc("log/log")(page, items, result);
if (result.status === "errorValidate") {
return inc("onValidateError/on")(page, result);
} else if (result.status !== "ok") {
return inc("/../app01/lib/gui/errorPopup/popup")();
} else if (context === "editList") {
return inc("onOkUpdateList/on")(page, result);
} else if (_.startsWith(context, "newList")) {
return inc("onOkNewList/on")(page);
} else if (_.startsWith(context, "addItems")) {
return inc("onOkAddItems/on")(page, result);
}
}
});
};
})();
pages/learnList/editor/_shared/topbar/_t.ls
(function(){
return {
newListTopTitle: {
de: "Neue Einträge erstellen",
en: "Create new entries",
fr: "Créer de nouvelles entrées",
es: "Crear nueva entrada",
pt: "Criar nova entrada"
},
listTab: {
de: "Listen-Editor",
en: "List Editor",
fr: "Éditeur de liste",
es: "Editor-de-listas",
pt: "Editor-de-listas"
},
textTab: {
de: "Text-Editor",
en: "Text Editor",
fr: "Éditeur de texte",
es: "Editor-de-textos",
pt: "Editor-de-textos"
},
noItemsPopup: {
de: "Diese Liste hat keine Einträge.",
en: "This list has no entries.",
fr: "Cette liste n’a aucune entrée.",
es: "Esta lista no tiene entradas.",
pt: "Esta lista não contém entradas."
},
nothingChangedPopup: {
de: "Es gibt keine Änderungen.",
en: "There are no changes.",
fr: "Aucun changement n’a été fait.",
es: "No hay cambios.",
pt: "Não há modificações."
}
};
})();
pages/learnList/editor/_shared/topbar/onBack/_t.ls
(function(){
return {
confirmPopup: {
de: "Möchtest du zurückgehen?
Deine Änderungen gehen dann verloren.",
en: "Would you like to go back?
Your changes will be lost.",
fr: "Veux-tu vraiment revenir en arrière ?
Tes modifications seront alors perdues.",
es: "¿Quieres volver atrás?
Tus cambios se perderán.",
pt: "Tem certeza que deseja voltar?
Suas alterações serão perdidas."
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
},
backButton: {
de: "Zurückgehen",
en: "Go back",
fr: "Revenir en arrière",
es: "Volver atrás",
pt: "Voltar"
}
};
})();
pages/learnList/editor/_shared/topbar/onBack/on.ls
(function(){
return function(page){
var go, ref$, items;
go = function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
};
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
app.lastInput = undefined;
items = page.calcItems();
if (items.length === 0) {
go();
return;
}
return inc("/../app01/lib/gui/confirmPopup/popup")({
label: T("confirmPopup"),
yesLabel: T("backButton"),
noLabel: T("cancelButton"),
onConfirm: go
});
};
})();
pages/learnList/editor/_shared/topbar/onClose/_t.ls
(function(){
return {
confirmSave: {
de: "Möchtest du deine Änderungen speichern?",
en: "Would you like to save your changes?",
fr: "Veux-tu enregistrer tes modifications ?",
es: "¿Quieres guardar tus cambios?",
pt: "Você gostaria de salvar suas alterações?"
},
saveListByOtherUser: {
de: "Hinweis: Die Liste ist von einem anderen Nutzer und wird beim Speichern in eine eigene Liste von dir umgewandelt.",
en: "Note: This list was created by another user. Once you save your changes, you will appear as the author of a new version of this list.",
fr: "À noter : La liste vient d'un·e autre utilisateur·rice et tu apparaîtras comme auteur·e de cette nouvelle version enregistrée.",
es: "Nota: Esta lista es de alguien más. Se convertirá en una de tus listas, cuando guardes tus cambios.",
pt: "Nota: esta lista foi criada por outro(a) usuário(a). Ela será convertida em uma lista sua, uma vez que você salve suas alterações."
},
saveButton: {
de: "Speichern",
en: "Save",
fr: "Enregistrer",
es: "Guardar",
pt: "Salvar"
},
discardButton: {
de: "Verwerfen",
en: "Discard",
fr: "Abandonner",
es: "Descartar",
pt: "Descartar"
}
};
})();
pages/learnList/editor/_shared/topbar/onClose/calcLabel/calc.ls
(function(){
return function(page){
var b;
return Div().html(Div({
lineHeight: "1.5em"
}).html(T("confirmSave")), page.learnListDescription.isBookmarked ? Div({
margin: "1em 0 0.2em",
fontSize: "0.95em",
lineHeight: "1.5em",
borderTop: b = "1px solid " + Color.grey[250],
borderBottom: b,
padding: "0.5em 0"
}).html(T("saveListByOtherUser")) : void 8);
};
})();
pages/learnList/editor/_shared/topbar/onClose/on.ls
(function(){
return function(page){
var go, ref$;
go = function(){
return startPage({
history: -1,
animation: "slideDown"
});
};
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
app.lastInput = undefined;
page.items = page.calcItems();
if (!page.items || _.isEqual(page.items, page.itemsOriginal)) {
go();
return;
}
return inc("/../app01/lib/gui/confirmPopup/popup")({
done: function(confirm){
if (confirm) {
return inc("submit/submit")(page);
} else {
return go();
}
},
label: inc("calcLabel/calc")(page),
yesLabel: T("saveButton"),
noLabel: T("discardButton")
});
};
})();
pages/learnList/editor/_shared/topbar/onClose/submit/submit.ls
(function(){
return function(page){
if (page.items.length === 0) {
return inc("/../app01/lib/gui/errorPopup/popup")({
label: T("noItemsPopup")
});
} else {
return inc("../../../submitEditedItems/submit")(page);
}
};
})();
pages/learnList/editor/_shared/topbar/tabMenuItems/tabMenuItems.ls
(function(){
return function(page){
var p, params, tap, items;
p = app.currentPagePath;
params = _.omit(page.params, ["history"]);
tap = function(t){
var items;
items = page.calcItems();
inc("/../app01/lib/util/cache/set/set")("listItems", items);
return startPage({
history: 0,
params: params,
path: t === "list"
? path("/pages/learnList/editor/list/page")
: path("/pages/learnList/editor/text/page")
});
};
return items = [
{
label: T("listTab"),
selected: _.includes(p, "/list"),
click: function(){
return tap("list");
}
}, {
label: T("textTab"),
selected: _.includes(p, "/text"),
click: function(){
return tap("text");
}
}
];
};
})();
pages/learnList/editor/_shared/topbar/topRightCustom/buttonDone/button.ls
(function(){
return function(page){
var tap, div;
tap = function(){
var ref$;
page.items = page.calcItems();
if ((ref$ = page.editor) != null) {
ref$.editor.divEditable.stop();
}
inc("/../app01/lib/util/cache/set/set")("listItems", page.items);
if (page.items.length === 0) {
inc("/../app01/lib/gui/errorPopup/popup")({
label: T("noItemsPopup")
});
return;
}
if (page.context === "editList" && _.isEqual(page.items, page.itemsOriginal)) {
inc("/../app01/lib/gui/errorPopup/popup")({
label: T("nothingChangedPopup")
});
return;
}
return inc("../../../submitEditedItems/submit")(page);
};
div = Div({
fontSize: "0.9em",
color: Color.blue[700],
padding: "0.3em 0.8em"
}).html(page.context === "editList"
? T("saveButton")
: T("continueButton")).tap({
up: tap,
tapZone: "0.5em"
});
div.tapButton = tap;
return page.buttonDone = div;
};
})();
pages/learnList/editor/_shared/topbar/topRightCustom/custom.ls
(function(){
return function(page){
return Div().html(inc("topErrorCounter/counter")(page), inc("buttonDone/button")(page));
};
})();
pages/learnList/editor/_shared/topbar/topRightCustom/topErrorCounter/_t.ls
(function(){
return {
correctError: {
de: "Bitte korrigiere ((den Fehler | die $1 Fehler)).",
en: "Please correct ((the error | the $1 errors)).",
fr: "Merci de corriger ((l’erreur | les $1 erreurs)).",
es: "Por favor, corrige ((el error | los $1 errores)).",
pt: "Por favor, corrija ((o erro | os $1 erros))."
}
};
})();
pages/learnList/editor/_shared/topbar/topRightCustom/topErrorCounter/calcTotalErrors/calc.ls
(function(){
return function(page){
var items, ref$, ref1$, ref2$;
if (page.list) {
items = ((ref$ = page.list) != null ? ref$.o.data : void 8) || [];
return _.filter(items, function(i){
return i.error != null;
}).length;
} else {
return ((ref1$ = page.editor) != null ? (ref2$ = ref1$.findAll(".lineError")) != null ? ref2$.length : void 8 : void 8) || 0;
}
};
})();
pages/learnList/editor/_shared/topbar/topRightCustom/topErrorCounter/counter.ls
(function(){
return function(page){
var totalErrors, tap, div, ref$, ref1$;
totalErrors = inc("calcTotalErrors/calc")(page);
tap = function(){
return page.buttonDone.tapButton();
};
div = Div({
fontSize: "0.9em",
color: Color.red[700],
padding: "0.3em 0.8em"
}).addClass("topErrorCounter").html(T("correctError", totalErrors)).tap({
up: tap,
tapZone: "0.5em"
});
if (totalErrors === 0) {
if ((ref$ = page.buttonDone) != null) {
ref$.show();
}
div.hide();
} else {
if ((ref1$ = page.buttonDone) != null) {
ref1$.hide();
}
div.show();
}
page.updateTopErrorCounter = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return div;
};
})();
pages/learnList/editor/_shared/topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: page.context === "editList"
? page.learnListDescription.name
: T("newListTopTitle"),
back: page.context !== "editList" ? function(){
return inc("onBack/on")(page);
} : void 8,
close: page.context === "editList" ? function(){
return inc("onClose/on")(page);
} : void 8,
topRightCustom: function(){
return inc("topRightCustom/custom")(page);
},
tabMenuItems: function(){
return inc("tabMenuItems/tabMenuItems")(page);
}
}).prepend(page.context !== "editList" ? inc("/pages/_shared/topbarAbortScan/bar")(page) : void 8);
};
})();
pages/learnList/editor/_t.ls
(function(){
return {
plusNewLine: {
de: "+ Neue Zeile",
en: "+ New entry",
fr: "+ Nouvelle ligne",
es: "+ Nueva fila",
pt: "+ Nova linha"
}
};
})();
pages/learnList/editor/list/_bottombar/bottombar.ls
(function(){
return function(page){
var div, create, done;
return div = Div({
display: "flex",
flexWrap: "wrap",
width: "35em",
maxWidth: "95%",
margin: "0 auto",
paddingBottom: "0.1em"
}).append(create = inc("link/link")({
label: T("plusNewLine"),
tap: function(){
return page.createRow();
}
}), Div({
flex: "1 1 auto"
}), !inc("/../app01/lib/util/isDesktop/isDesktop")() ? done = inc("link/link")({
label: T("done"),
tap: function(){
var ref$;
if ((ref$ = page.activeRow) != null) {
ref$.deactivate();
}
return document.activeElement.blur();
}
}).onDomAppend(function(){
var f;
f = function(){
if (div.isVisible()) {
if (document.activeElement === body) {
done.hide();
} else {
done.show();
}
return requestAnimationFrame(f);
}
};
return f();
}) : void 8);
};
})();
pages/learnList/editor/list/_bottombar/link/link.ls
(function(){
return function(p){
var tap;
tap = function(e){
var list;
if (typeof e.preventDefault == 'function') {
e.preventDefault();
}
if (typeof e.stopImmediatePropagation == 'function') {
e.stopImmediatePropagation();
}
list = app.currentPage.list;
if (!list) {
return;
}
list.css({
pointerEvents: "none"
});
setTimeout(function(){
return list.css({
pointerEvents: "auto"
});
}, 400);
return p.tap();
};
return Div({
margin: "0.3em",
padding: "0.2em",
color: Color.blue[600]
}).html(p.label).tap(tap);
};
})();
pages/learnList/editor/list/calcItems/calc.ls
(function(){
return function(page){
var items, res$, i$, ref$, len$, i, ref1$;
if (!page.list) {
return;
}
res$ = [];
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
i = ref$[i$];
if ((ref1$ = i.rowType) === "header" || ref1$ === "footer") {
continue;
} else if (_.startsWith(page.listType, "spell")) {
res$.push({
a: i.a
});
} else {
res$.push({
a: i.a,
b: i.b
});
}
}
items = res$;
for (i$ = 0, len$ = items.length; i$ < len$; ++i$) {
i = items[i$];
if ((ref$ = i.a) != null && ref$.text) {
i.a.text = i.a.text.trim();
}
if ((ref1$ = i.b) != null && ref1$.text) {
i.b.text = i.b.text.trim();
}
}
items = _.filter(items, function(i){
var ref$, ref1$, ref2$, ref3$;
return ((ref$ = i.a) != null ? (ref1$ = ref$.text) != null ? ref1$.length : void 8 : void 8) > 0 || ((ref2$ = i.b) != null ? (ref3$ = ref2$.text) != null ? ref3$.length : void 8 : void 8) > 0;
});
return items;
};
})();
pages/learnList/editor/list/createRow/create.ls
(function(){
return function(page){
var list, length, lastRowData, row, pos;
list = page.list;
length = list.o.data.length;
lastRowData = list.o.data[length - 2];
if ((lastRowData != null ? lastRowData.a : void 8) != null && (lastRowData != null ? lastRowData.a.text : void 8) === "" && (lastRowData != null ? lastRowData.b.text : void 8) === "") {
list.scrollRowIntoView(length - 2, {
padding: 30
});
row = list.o.rowsByIndex[length - 2];
row.row.activate();
row.row.text1.focus();
row.row.keyframeAnimate({
duration: 1000,
keyframes: {
"0%": {
background: Color.blue[50]
},
"100%": {
background: Color.grey[75]
}
}
});
return;
}
pos = list.o.data.length - 1;
list.insertRow({
position: pos,
data: {
a: {
text: ""
},
b: {
text: ""
}
}
});
list.scrollRowIntoView(pos + 1);
row = list.o.rowsByIndex[pos];
row.row.activate();
inc("startText1/start")(row.row.text1, page);
return inc("/../app01/lib/util/waitFrames/wait")(6, function(){
return list.scrollRowIntoView(pos + 1);
});
};
})();
pages/learnList/editor/list/createRow/startText1/start.ls
(function(){
return function(text1, page){
var start;
start = function(){
return text1.focus();
};
if (page.pageWrapper.pageAnimationDone) {
return start();
} else {
return text1.onElementClass("onPageAnimationDone", start);
}
};
})();
pages/learnList/editor/list/list/list.ls
(function(){
return function(page){
var data;
data = _.concat({
rowType: "header"
}, _.cloneDeep(page.items), {
rowType: "footer"
});
return page.list = ListDiv({
data: data,
row: inc("row/row")(page, data),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
}
}).css({
height: "var(--centerHeight)"
});
};
})();
pages/learnList/editor/list/list/row/row.ls
(function(){
return function(page, listData){
return function(data){
var div, row;
div = Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(data.rowType === "header"
? inc("rowHeader/row")()
: data.rowType === "footer"
? inc("rowFooter/row")(page)
: row = inc("rowItem/row")(page, data))).tap({
animation: "none",
up: function(){
if (data.isDeleted) {
document.activeElement.blur();
return div.row.activate();
}
}
}).css({
cursor: "default"
});
div.row = row;
return div;
};
};
})();
pages/learnList/editor/list/list/row/rowFooter/row.ls
(function(){
return function(page){
return Div({
display: "flex",
padding: "0.5em 0.3em 3.5em"
}).html(Div({
color: Color.lightBlue[700],
padding: "0.3em 0.5em"
}).html(T("plusNewLine")).tap(function(){
return page.createRow();
}));
};
})();
pages/learnList/editor/list/list/row/rowHeader/row.ls
(function(){
return function(){
return Div({
display: "flex",
padding: "0 0 0.7em",
marginTop: "0.7em",
background: "white"
});
};
})();
pages/learnList/editor/list/list/row/rowItem/_activate/activate.ls
(function(){
return function(page, row){
var item, currentRow;
item = row.rowData;
currentRow = page.activeRow;
if (currentRow != null && currentRow !== row) {
currentRow.deactivate();
}
page.activeRow = row;
row.labels.updateLabels();
row.actions.updateActions();
row.css({
background: item.error
? Color.red[100]
: Color.grey[50]
});
page.list.repositionCurrentRows();
return inc("scrollToRow/scroll")(page.list, item);
};
})();
pages/learnList/editor/list/list/row/rowItem/_activate/scrollToRow/scroll.ls
(function(){
return function(list, item){
var i;
i = _.indexOf(list.o.data, item);
return setTimeout(function(){
return list.scrollRowIntoView(i, {
padding: 20
});
}, 50);
};
})();
pages/learnList/editor/list/list/row/rowItem/_deactivate/deactivate.ls
(function(){
return function(page, row){
var item;
item = row.rowData;
if (page.activeRow === row) {
page.activeRow = undefined;
}
row.labels.updateLabels();
row.actions.updateActions();
row.css({
background: item.error ? Color.red[50] : "white"
});
return page.list.repositionCurrentRows();
};
})();
pages/learnList/editor/list/list/row/rowItem/actions/_t.ls
(function(){
return {
deleteLine: {
de: "Zeile löschen",
en: "Delete entry",
fr: "Effacer la ligne",
es: "Borrar fila",
pt: "Apagar linha"
},
modifyImage: {
de: "Bild bearbeiten",
en: "Edit image",
fr: "Modifier l’image",
es: "Editar imagen",
pt: "Editar imagem"
},
addImage: {
de: "Bild hinzufügen",
en: "Add image",
fr: "Ajouter une image",
es: "Agregar imagen",
pt: "Adicionar imagem"
}
};
})();
pages/learnList/editor/list/list/row/rowItem/actions/actions.ls
(function(){
return function(page, row){
var div;
div = Div({
display: "flex",
position: "absolute",
bottom: 0,
right: 0,
fontSize: "0.7em"
}).html(row === page.activeRow ? [inc("image/image")(page, row), inc("deleteRow/delete")(page, row)] : void 8);
div.updateActions = function(){
return div.replaceWith(inc(THISFILE)(page, row));
};
return row.actions = div;
};
})();
pages/learnList/editor/list/list/row/rowItem/actions/deleteRow/delete.ls
(function(){
return function(page, row){
var item, tap;
item = row.rowData;
tap = function(){
var ref$;
if ((ref$ = document.activeElement) != null) {
ref$.blur();
}
row.css({
pointerEvents: "none"
});
return row.keyframeAnimate({
duration: 300,
keyframes: {
"0%": {
opacity: 1
},
"100%": {
opacity: 0
}
},
onCompleted: function(){
var i$, ref$, len$, i, d, results$ = [];
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
i = i$;
d = ref$[i$];
if (d === item) {
page.list.removeRow(i);
break;
}
}
return results$;
}
});
};
return Div({
padding: "0.1em 0 0.2em 0.3em",
color: Color.lightBlue[700]
}).html(T("deleteLine")).tap({
down: tap
});
};
})();
pages/learnList/editor/list/list/row/rowItem/actions/image/image.ls
(function(){
return function(page, row){
var item, tap, div;
if (!(_.startsWith(page.listType, "spell") && engine.isDebug)) {
return;
}
item = row.rowData;
if (item.isDeleted) {
return;
}
tap = function(){
return inc("../../main/image/showPopup/show")(item, row);
};
return div = Div({
padding: "0.1em 0 0.2em 0.3em",
color: Color.lightBlue[700],
marginRight: "0.3em"
}).html(SvgIcon(path("/../app01/lib/svg/shape/debug.svg")).css({
verticalAlign: "-0.2em"
}), item.image
? T("modifyImage")
: T("addImage")).tap({
down: tap
});
};
})();
pages/learnList/editor/list/list/row/rowItem/error/error.ls
(function(){
return function(page, row){
var item, error, div;
item = row.rowData;
error = item.error;
if (!error) {
return;
}
div = Div({
position: "absolute",
left: 0,
bottom: 0,
color: Color.red[600],
fontSize: "0.7em",
padding: "0.2em 0.4em 0.2em 0.6em"
}).html(error);
return row.error = div;
};
})();
pages/learnList/editor/list/list/row/rowItem/labels/label/label.ls
(function(){
return function(page, column){
var l;
l = inc("/pages/_shared/calcListColumns/calc")(page.listType);
return Div({
flex: "1 1 auto",
width: "50%",
fontSize: "0.7em",
textAlign: "left",
color: Color.blue[700],
paddingLeft: "0.3em"
}).html(l[column]);
};
})();
pages/learnList/editor/list/list/row/rowItem/labels/labels.ls
(function(){
return function(page, row){
var div;
div = Div({
display: "flex",
top: 0,
position: "absolute",
width: "100%",
pointerEvents: "none"
}).append(page.activeRow === row ? [
inc("label/label")(page, "a"), Div({
width: "1em"
}), inc("label/label")(page, "b")
] : void 8);
div.updateLabels = function(){
return div.replaceWith(inc(THISFILE)(page, row));
};
return row.labels = div;
};
})();
pages/learnList/editor/list/list/row/rowItem/main/image/image.ls
(function(){
return function(row, page){
var item, listCode, imageId, div, tap, updateImage;
item = row.rowData;
listCode = page.listCode;
imageId = item.image;
if (!imageId) {
div = Div({
visibility: "hidden"
});
div.updateImage = function(){
return div.replaceWith(inc(THISFILE)(row, page));
};
return row.image = div;
}
tap = function(){
return inc("showPopup/show")(item, row);
};
updateImage = function(){
return div.replaceWith(inc(THISFILE)(row, page));
};
div = Div({
display: "flex",
marginRight: "0.2em"
}).append(Div({
width: "2em",
height: "2em",
cursor: "pointer"
}).onScopeRender(function(){
return this.append(inc("/../app01/lib/gui/image/image")({
id: imageId,
fileFolder: "learnLists/" + listCode + "/_images",
etag: "any"
}).css({
width: "2em",
height: "2em",
border: "1px solid " + Color.grey[150]
}));
})).tap({
animation: "none",
up: tap
}).css({
cursor: "default"
});
div.updateImage = updateImage;
return row.image = div;
};
})();
pages/learnList/editor/list/list/row/rowItem/main/image/showPopup/show.ls
(function(){
return function(item, row){
var searchText, imageId;
searchText = item.a.text;
imageId = item.image;
return inc("/pages/learnList/_shared/popupImage/popup")({
imageId: imageId,
searchText: searchText,
canModify: true,
onModifiedImageId: function(newImageId){
item.image = newImageId;
return row.image.updateImage();
}
});
};
})();
pages/learnList/editor/list/list/row/rowItem/main/main.ls
(function(){
return function(page, row){
return Div({
display: "flex",
alignItems: "stretch"
}).append(row.text1 = inc("textField/textField")(page, row, "a"), !_.startsWith(page.listType, "spell") ? row.text2 = inc("textField/textField")(page, row, "b") : void 8, inc("image/image")(row, page));
};
})();
pages/learnList/editor/list/list/row/rowItem/main/textField/onKeyEnter/onKey.ls
(function(){
return function(div, row, column){
var page, item, data, lastRowData;
page = app.currentPage;
if (!page.list) {
return;
}
item = row.rowData;
data = page.list.o.data;
lastRowData = data[data.length - 2];
if (_.startsWith(page.listType, "spell")) {
if (column === "a" && item === lastRowData && item.a.text) {
return page.createRow();
} else if (column === "a" && item === lastRowData && item.a.text === "") {
div.blur();
return page.list.removeRow(data.length - 2);
} else {
return div.blur();
}
} else {
if (column === "b" && item === lastRowData && item.b.text) {
return page.createRow();
} else if (column === "a" && item.b.text === "") {
return row.text2.focus();
} else {
return div.blur();
}
}
};
})();
pages/learnList/editor/list/list/row/rowItem/main/textField/onPaste/onPaste.ls
(function(){
return function(e, div){
var text, ref$, ref1$, a;
text = ((ref$ = e.clipboardData) != null ? ref$.getData("text/plain") : void 8) || ((ref1$ = e.clipboardData) != null ? ref1$.getData("Text") : void 8) || "";
a = text.split("\n");
if (a.length > 1) {
div.insertAtCursor(a.join(""));
e.preventDefault();
return e.stopImmediatePropagation();
}
};
})();
pages/learnList/editor/list/list/row/rowItem/main/textField/textField.ls
(function(){
return function(page, row, column){
var item, scrollTo, onChange, div;
item = row.rowData;
scrollTo = function(){
return page.list.scrollElementIntoView(div, {
instant: true,
padding: 20
});
};
onChange = function(){
var value;
page.list.repositionCurrentRows();
value = div.getValue();
value = value != null ? value.trim().replace("\n", "") : void 8;
item[column].text = value;
if (row.error) {
row.error.remove();
delete item.error;
row.css({
background: Color.blue[50]
});
return page.updateTopErrorCounter();
}
};
return div = inc("/../app01/lib/gui/divEditable/div")({
cssId: "learnListTextField",
value: item[column].text,
parseMode: "learnListCell",
onSoftKeyboardHeightChange: scrollTo,
onCursorChange: scrollTo,
onChange: onChange
}).css({
flex: "1 1 auto",
width: "50%",
minHeight: "1.7em",
padding: "1.25em 0.3em",
justifyContent: ""
}).bind("focusin", function(){
return row.activate();
}).bind("focusout", function(){
return row.deactivate();
}).bind("paste", function(e){
return inc("onPaste/onPaste")(e, div);
}).bind("keydown", function(e){
if (e.keyCode === 27) {
e.preventDefault();
e.stopImmediatePropagation();
div.blur();
}
if (e.keyCode === 13) {
e.preventDefault();
e.stopImmediatePropagation();
return inc("onKeyEnter/onKey")(div, row, column);
}
});
};
})();
pages/learnList/editor/list/list/row/rowItem/row.ls
(function(){
return function(page, rowData){
var row, b;
row = Div({
borderBottom: b = "1px solid " + Color.grey[200],
borderTop: b,
marginTop: "-2px",
background: rowData.error ? Color.red[50] : "white"
}).addClass("listRow");
row.rowData = rowData;
row.html(inc("main/main")(page, row), inc("labels/labels")(page, row), inc("actions/actions")(page, row), inc("error/error")(page, row));
row.activate = function(){
return inc("_activate/activate")(page, row);
};
row.deactivate = function(){
return inc("_deactivate/deactivate")(page, row);
};
return row;
};
})();
pages/learnList/editor/list/onValidateErrors/on.ls
(function(){
return function(page, errorLines){
inc("setRowErrors/set")(errorLines, page);
page.list.setListPosition(void 8, {
resetRows: true
});
page.updateTopErrorCounter();
return page.scrollToFirstError();
};
})();
pages/learnList/editor/list/onValidateErrors/setRowErrors/set.ls
(function(){
return function(errorLines, page){
var errors, i$, len$, l, index, ref$, r, ref1$, ref2$, that, ref3$, results$ = [];
errors = {};
for (i$ = 0, len$ = errorLines.length; i$ < len$; ++i$) {
l = errorLines[i$];
errors[l.lineIndex] = l;
}
index = 0;
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
r = ref$[i$];
if (((ref1$ = r.a) != null ? ref1$.text.length : void 8) > 0 || ((ref2$ = r.b) != null ? ref2$.text.length : void 8) > 0) {
index++;
}
if (that = errors[index]) {
r.error = that.errorText;
} else {
delete r.error;
}
results$.push((ref3$ = errors[index], delete errors[index], ref3$));
}
return results$;
};
})();
pages/learnList/editor/list/page.ls
(function(){
return function(page){
var ref$, ref1$;
page.context = page.params.context;
page.listCode = page.params.listCode;
page.items = inc("/../app01/lib/util/cache/get/get")("listItems");
page.itemsOriginal = inc("/../app01/lib/util/cache/get/get")("listItemsOriginal");
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.listType = (ref$ = (ref1$ = page.learnListDescription) != null ? ref1$.type : void 8) != null
? ref$
: page.params.listType;
page.calcItems = function(){
return inc("calcItems/calc")(page);
};
page.onValidateErrors = function(errorLines){
return inc("onValidateErrors/on")(page, errorLines);
};
page.createRow = function(){
return inc("createRow/create")(page);
};
page.scrollToFirstError = function(){
return inc("scrollToFirstError/scroll")(page);
};
return {
bottom: function(){
return inc("_bottombar/bottombar")(page);
},
top: function(){
return inc("../_shared/topbar/topbar")(page);
},
start: function(){
var loadFile, create;
loadFile = function(){
return inc("../../_shared/loadFile/load")(page, create);
};
create = function(){
page.html(inc("list/list")(page));
return requestAnimationFrame(function(){
if (page.items.length === 0) {
return page.createRow();
}
});
};
app.currentPage.bottom.css({
background: Color.grey[150]
});
if (page.items) {
return create();
} else {
return loadFile();
}
}
};
};
})();
pages/learnList/editor/list/scrollToFirstError/scroll.ls
(function(){
return function(page){
var i$, ref$, len$, index, d;
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
index = i$;
d = ref$[i$];
if (d.error) {
break;
}
}
return inc("/../app01/lib/util/waitFrames/wait")(3, function(){
return page.list.scrollRowIntoView(index, {
padding: 20
});
});
};
})();
pages/learnList/editor/start.ls
(function(){
return function(p){
var d;
if (p.context === "editList") {
d = inc("/../app01/lib/util/cache/del/del");
d("listItems");
d("listItemsOriginal");
} else if (p.context === "newListEditor") {
inc("/../app01/lib/util/cache/set/set")("listItems", []);
}
return startPage({
path: path("list/page"),
params: {
listCode: p.listCode,
listType: p.listType,
context: p.context
},
animation: p.context === "editList" ? "slideUp" : "slideLeft"
});
};
})();
pages/learnList/editor/text/_bottombar/bottombar.ls
(function(){
return function(page){
var b, i, div;
b = inc("button/button");
i = inc("insertText/insert");
page.bottom.css({
background: Color.grey[200]
});
div = Div({
display: "flex",
flexWrap: "wrap",
width: "100%"
}).append(b({
label: "=",
tap: function(){
return i(" = ", 0);
}
}), b({
label: "()",
tap: function(){
return i(" ()", 1);
}
}), engine.isDebug ? b({
label: "Image(Debug)",
tap: function(){
return inc("insertImage/insert")(page);
}
}) : void 8, Div({
flex: "1 1 auto"
})).hide();
inc("stopEvents/stop")(page, div);
return page.bottomBar = div;
};
})();
pages/learnList/editor/text/_bottombar/button/button.ls
(function(){
return function(p){
return Div({
margin: "0 0.1em",
padding: "0.5em 0.7em",
color: Color.blue[600]
}).html(p.label).tap(p.tap);
};
})();
pages/learnList/editor/text/_bottombar/insertImage/insert.ls
(function(){
return function(page){
var divEd, lineDiv, searchText, pos;
divEd = page.editor.editor.divEditable;
lineDiv = divEd.getSelectedLineDiv();
searchText = lineDiv != null ? lineDiv.textContent.trim() : void 8;
pos = divEd.getSelectionPositions();
divEd.stop();
return inc("/pages/learnList/_shared/popupImage/popup")({
searchText: searchText,
canModify: true,
onModifiedImageId: function(imageId){
divEd.start();
divEd.setSelectionPositions(pos);
return divEd.insertAtCursor("[[image=" + imageId + "]]");
}
});
};
})();
pages/learnList/editor/text/_bottombar/insertText/insert.ls
(function(){
return function(text, backChars){
var sel, i$, i, results$ = [];
document.execCommand("insertText", false, text);
sel = window.getSelection();
try {
for (i$ = 1; i$ <= backChars; ++i$) {
i = i$;
results$.push(sel.modify("move", "left", "character"));
}
return results$;
} catch (e$) {}
};
})();
pages/learnList/editor/text/_bottombar/stopEvents/stop.ls
(function(){
return function(page, div){
return div.bind("touchstart", function(e){
e.preventDefault();
e.stopImmediatePropagation();
return page.editor.css({
pointerEvents: "none"
});
}).bind("touchend", function(e){
e.preventDefault();
e.stopImmediatePropagation();
return page.editor.css({
pointerEvents: "auto"
});
}).bind("mousedown", function(e){
e.preventDefault();
return e.stopImmediatePropagation();
});
};
})();
pages/learnList/editor/text/calcItems/aOnly/aOnly.ls
(function(){
return function(rows){
var i$, len$, r, o, item, results$ = [];
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
r = rows[i$];
if (!r) {
continue;
}
o = inc("splitTextAndImage/split")(r);
item = {
a: {
text: o.text
}
};
if (o.image) {
item.image = o.image;
}
results$.push(item);
}
return results$;
};
})();
pages/learnList/editor/text/calcItems/aOnly/splitTextAndImage/split.ls
(function(){
return function(s){
var a, a2, i$, len$, image, r;
s = _.replaceAll(s, "[[", "§!$[[");
s = _.replaceAll(s, "]]", "]]§!$");
a = s.split("§!$");
if (a.length === 0) {
return {
text: s
};
}
a2 = [];
for (i$ = 0, len$ = a.length; i$ < len$; ++i$) {
s = a[i$];
if (_.startsWith(s, "[[")) {
image = s.substr(8).replace("]]", "");
} else {
a2.push(s);
}
}
return r = {
text: a2.join("").trim(),
image: image
};
};
})();
pages/learnList/editor/text/calcItems/ab/ab.ls
(function(){
return function(rows){
var i$, len$, r, i, results$ = [];
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
r = rows[i$];
if (!r) {
continue;
}
i = r.indexOf("=");
if (i === -1) {
results$.push({
a: {
text: r.trim()
},
b: {
text: ""
}
});
} else {
results$.push({
a: {
text: r.substr(0, i).trim()
},
b: {
text: r.substr(i + 1).trim()
}
});
}
}
return results$;
};
})();
pages/learnList/editor/text/calcItems/calc.ls
(function(){
return function(page){
var type, text, rows, res$, i$, len$, r, items;
type = page.listType;
text = page.editor.getValue();
rows = text.trim().split("\n");
res$ = [];
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
r = rows[i$];
res$.push(r.split("[[lineError")[0].trim());
}
rows = res$;
items = _.startsWith(type, "spell")
? inc("aOnly/aOnly")(rows)
: inc("ab/ab")(rows);
items = _.filter(items, function(i){
var ref$, ref1$;
return ((ref$ = i.a.text) != null ? ref$.length : void 8) > 0 || ((ref1$ = i.b.text) != null ? ref1$.length : void 8) > 0;
});
return items;
};
})();
pages/learnList/editor/text/calcOriginalText/calc.ls
(function(){
return function(page){
var a, item, s, that;
a = _.startsWith(page.listType, "spell")
? (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = page.items).length; i$ < len$; ++i$) {
item = ref$[i$];
s = item.a.text;
if (that = item.image) {
s += " [[image=" + that + "]]";
}
results$.push(s);
}
return results$;
}())
: (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = page.items).length; i$ < len$; ++i$) {
item = ref$[i$];
results$.push(s = item.a.text + " = " + item.b.text);
}
return results$;
}());
return a.join("\n");
};
})();
pages/learnList/editor/text/editor/editor.ls
(function(){
return function(page){
return page.editor = inc("/pages/_shared/textEditor/editor")({
value: page.originalText,
onChangeLine: function(line){
return inc("onChangeLine/on")(page, line);
},
onChange: function(){
return inc("onChange/on")(page);
},
onImageTap: inc("onImageTap/on")
}).addClass("safeAreaPaddingLeft safeAreaPaddingRight").css({
height: "var(--centerHeight)",
width: "100%",
background: Color.grey[75]
}).bind("focusin", function(){
return page.bottomBar.show();
}).bind("focusout", function(){
return page.bottomBar.hide();
});
};
})();
pages/learnList/editor/text/editor/onChange/on.ls
(function(){
return function(page){
var ref$;
if ((ref$ = body.findFirst(".topErrorCounter")) != null && ref$.isVisible()) {
return page.updateTopErrorCounter();
}
};
})();
pages/learnList/editor/text/editor/onChangeLine/on.ls
(function(){
return function(page, lineDiv){
var ref$;
return (ref$ = lineDiv.findFirst(".lineError")) != null ? ref$.remove() : void 8;
};
})();
pages/learnList/editor/text/editor/onImageTap/on.ls
(function(){
return function(image){
var lineDiv, searchText, id, imageId;
lineDiv = image.parent();
searchText = lineDiv.textContent.trim();
id = image.attr("image_id");
imageId = id.split(",")[0];
return inc("/pages/learnList/_shared/popupImage/popup")({
imageId: imageId,
searchText: searchText,
canModify: true,
onModifiedImageId: function(newImageId){
var divEd, s, r, a, idNew;
divEd = app.currentPage.editor.editor.divEditable.start();
s = window.getSelection();
r = new Range();
r.setStartAfter(image);
r.setEndAfter(image);
s.removeAllRanges();
s.addRange(r);
if (newImageId) {
a = id.split(",");
a[0] = newImageId;
idNew = a.join(",");
return image.attr({
src: "https://images.solocode.com/image/small?imageId=" + newImageId,
image_id: idNew
});
} else {
return image.remove();
}
}
});
};
})();
pages/learnList/editor/text/onValidateErrors/on.ls
(function(){
return function(page, errorLines){
inc("showLineErrors/show")(errorLines, page);
page.updateTopErrorCounter();
return page.scrollToFirstError();
};
})();
pages/learnList/editor/text/onValidateErrors/showLineErrors/show.ls
(function(){
return function(errorLines, page){
var editor, errors, i$, len$, l, ref$, el, index, lineDiv, that;
editor = page.editor.editor;
errors = {};
for (i$ = 0, len$ = errorLines.length; i$ < len$; ++i$) {
l = errorLines[i$];
errors[l.lineIndex] = l;
}
for (i$ = 0, len$ = (ref$ = editor.divEditable.findAll(".lineError")).length; i$ < len$; ++i$) {
el = ref$[i$];
el.remove();
}
index = 0;
for (i$ = 0, len$ = (ref$ = editor.divEditable.findAll(".lineDiv")).length; i$ < len$; ++i$) {
lineDiv = ref$[i$];
if (lineDiv.cleanString.length > 0) {
index++;
}
if (that = errors[index]) {
inc("/../app01/lib/gui/divEditable/createLineNodes/lineError/lineError")({
text: "[[lineError=" + that.errorText + "]]"
}).appendTo(lineDiv);
delete errors[index];
}
}
return editor.updateLineNumbers();
};
})();
pages/learnList/editor/text/page.ls
(function(){
return function(page){
var ref$, ref1$;
page.context = page.params.context;
page.listCode = page.params.listCode;
page.items = inc("/../app01/lib/util/cache/get/get")("listItems");
page.itemsOriginal = inc("/../app01/lib/util/cache/get/get")("listItemsOriginal");
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.listType = (ref$ = (ref1$ = page.learnListDescription) != null ? ref1$.type : void 8) != null
? ref$
: page.params.listType;
page.calcItems = function(){
return inc("calcItems/calc")(page);
};
page.onValidateErrors = function(errorLines){
return inc("onValidateErrors/on")(page, errorLines);
};
page.scrollToFirstError = function(){
return inc("scrollToFirstError/scroll")(page);
};
return {
bottom: function(){
return inc("_bottombar/bottombar")(page);
},
top: function(){
return inc("../_shared/topbar/topbar")(page);
},
start: function(){
var loadFile, create;
loadFile = function(){
return inc("../../_shared/loadFile/load")(page, create);
};
create = function(){
page.originalText = inc("calcOriginalText/calc")(page);
return page.html(inc("editor/editor")(page));
};
if (page.items) {
return create();
} else {
return loadFile();
}
}
};
};
})();
pages/learnList/editor/text/scrollToFirstError/scroll.ls
(function(){
return function(page){
var el;
el = page.editor.findFirst(".lineError");
return page.editor.scrollElementIntoView(el, {
padding: 50
});
};
})();
pages/learnList/items/_topbar/headers/header/header.ls
(function(){
return function(page, columnName){
var ld, type, isSingleHeader, label, checked, tap;
ld = page.learnListDescription;
type = ld.type;
isSingleHeader = _.startsWith(type, "spell");
label = inc("/pages/_shared/calcListColumns/calc")(type)[columnName];
checked = (columnName === "a" && !page.hideColumnA) || (columnName === "b" && !page.hideColumnB);
tap = function(){
if (columnName === "a") {
page.hideColumnA = !page.hideColumnA;
}
if (columnName === "b") {
page.hideColumnB = !page.hideColumnB;
}
return page.reset();
};
return Div({
width: "50%",
padding: "0.3em 0.5em 0.5em 1.2em",
display: "flex",
fontSize: "1em",
justifyContent: "flex-start"
}).append(SvgIcon({
svg: path("/../app01/lib/svg/shape/eye.svg"),
color: Color.blue[600]
}).css({
margin: "0.3em"
}), Div().html(label)).tap(!isSingleHeader && ld.totalItems > 0 ? tap : void 8);
};
})();
pages/learnList/items/_topbar/headers/headers.ls
(function(){
return function(page){
var h, div;
h = inc("header/header");
div = Div({
flex: "1 1 auto",
display: "flex",
borderTop: "1px solid " + Color.grey[250],
marginBottom: "-1px",
marginTop: "0.2em",
alignItems: "stretch"
}).append(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto",
display: "flex",
alignItems: "stretch"
}).append(_.startsWith(page.learnListDescription.type, "spell")
? h(page, "a").css({
width: "100%"
})
: [h(page, "a"), h(page, "b")]));
div.reset = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return page.header = div;
};
})();
pages/learnList/items/_topbar/topbar.ls
(function(){
return function(page){
var ld;
ld = page.learnListDescription;
return inc("/../app01/addons/topbar2/topbar")({
title: ld.name,
close: function(){
return startPage({
history: -1,
animation: "fadeIn"
});
},
topRightCustom: function(){
return inc("../../_shared/topRightEditButton/button")(page);
}
}).append(inc("headers/headers")(page));
};
})();
pages/learnList/items/list/list.ls
(function(){
var lastListPosition;
lastListPosition = null;
return function(page){
var data;
data = _.concat({
rowType: "header"
}, page.listReport.items, {
rowType: "footer"
});
page.list = ListDiv({
data: data,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: page.params.history <= 0 ? lastListPosition : void 8
}).css({
height: "var(--centerHeight)"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
});
page.list.reset = function(){
var lp;
lp = page.list.getListPosition();
page.list.replaceWith(inc(THISFILE)(page));
return page.list.setListPosition(lp);
};
return page.list;
};
})();
pages/learnList/items/list/row/footer/row.ls
(function(){
return function(page){
return Div({
height: "3em"
});
};
})();
pages/learnList/items/list/row/header/row.ls
(function(){
return function(page){
return Div({
display: "flex",
textAlign: "center",
padding: "1em 0em 0",
background: "white",
borderBottom: "1px solid " + Color.grey[200]
}).append();
};
})();
pages/learnList/items/list/row/item/box/box.ls
(function(){
return function(page, item, mode){
var text, hide, tap, div, speaker, hideOverlay;
text = item[mode].text;
hide = (mode === "a" && page.hideColumnA) || (mode === "b" && page.hideColumnB);
tap = function(){
if (hide) {
hideOverlay.remove();
}
return inc("playSound/play")(text, speaker, page, mode);
};
return div = Div({
flex: "1 1 auto",
display: "flex",
width: "50%",
minHeight: "3.4em"
}).html(speaker = inc("speaker/speaker")(page, item, mode), inc("text/text")(text), hideOverlay = inc("hideOverlay/overlay")(hide)).tap({
animation: "none",
up: tap
});
};
})();
pages/learnList/items/list/row/item/box/hideOverlay/overlay.ls
(function(){
return function(hide){
if (!hide) {
return;
}
return Div({
position: "absolute",
left: 0,
right: 0,
top: 0,
bottom: 0,
background: "white",
display: "flex",
justifyContent: "flex-start",
paddingLeft: "1.5em"
}).append(Div({
color: Color.grey[600]
}).html("?"));
};
})();
pages/learnList/items/list/row/item/box/playSound/play.ls
(function(){
return function(text, speaker, page, mode){
var type, sound, tapAt, voiceSettings;
type = page.learnListDescription.type;
sound = inc("/_shared/removeBracket/remove")(text);
tapAt = new Date();
voiceSettings = inc("/pages/_shared/calcVoiceSettings/calc")(type, mode);
return inc("/../app01/lib/util/downloadSound/download")({
fileFolder: "media/learnList/_sounds",
voiceLang: voiceSettings.lang,
voice: voiceSettings.voice,
text: sound,
onError: function(){},
onOffline: function(){},
onLoaded: function(sound){
var ref$, i$, ref1$, len$, el;
if (new Date() - tapAt < 700 && page === app.currentPage) {
if ((ref$ = app.lastSound) != null) {
ref$.stop();
}
for (i$ = 0, len$ = (ref1$ = page.findAll(".speaker")).length; i$ < len$; ++i$) {
el = ref1$[i$];
el.css({
visibility: "hidden"
});
}
speaker.css({
visibility: "visible"
});
return sound.play(function(){
return speaker.css({
visibility: "hidden"
});
});
}
}
});
};
})();
pages/learnList/items/list/row/item/box/speaker/speaker.ls
(function(){
return function(page, item, mode){
return SvgIcon({
svg: path("/../app01/lib/svg/icon/speaker.svg"),
color: Color.grey[400],
size: "1em"
}).addClass("speaker").css({
margin: "0.4em 0.2em 0.3em 0.2em",
visibility: "hidden"
});
};
})();
pages/learnList/items/list/row/item/box/text/calcParts/calc.ls
(function(){
return function(text){
var s, a;
s = text;
s = s.split("(").join("|||(");
s = s.split(")").join(")|||");
return a = s.split("|||");
};
})();
pages/learnList/items/list/row/item/box/text/part/part.ls
(function(){
return function(p){
return Span({
whiteSpace: "wrap",
wordWrap: "break-word",
hyphens: "auto",
color: _.includes(p, "(") ? Color.grey[500] : void 8
}).html(p);
};
})();
pages/learnList/items/list/row/item/box/text/text.ls
(function(){
return function(text){
var parts, p;
parts = inc("calcParts/calc")(text);
return Div({
flex: "1 1 auto",
textAlign: "left",
whiteSpace: "wrap",
padding: "0.3em 0"
}).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = parts).length; i$ < len$; ++i$) {
p = ref$[i$];
results$.push(inc("part/part")(p));
}
return results$;
}()));
};
})();
pages/learnList/items/list/row/item/image/image.ls
(function(){
return function(page, item){
var listCode, imageId, tap;
listCode = page.learnListDescription.listCode;
imageId = item.image;
if (!imageId) {
return;
}
tap = function(){
return inc("/pages/learnList/_shared/popupImage/popup")({
imageId: imageId,
canModify: false
});
};
return Div({
display: "flex"
}).append(Div({
width: "2.5em",
height: "2.5em"
}).onScopeRender(function(){
return this.append(inc("/../app01/lib/gui/image/image")({
id: imageId,
fileFolder: "learnLists/" + listCode + "/_images",
etag: "any"
}).css({
width: "2.5em",
height: "2.5em",
border: "1px solid " + Color.grey[150]
}));
}).tap(tap));
};
})();
pages/learnList/items/list/row/item/row.ls
(function(){
return function(page, item){
var b;
return Div({
display: "flex",
borderBottom: b = "1px solid " + Color.grey[200],
borderTop: b,
marginTop: "-2px",
alignItems: "stretch",
background: "white"
}).append(inc("box/box")(page, item, "a"), !_.startsWith(page.learnListDescription.type, "spell") ? inc("box/box")(page, item, "b") : void 8, inc("image/image")(page, item));
};
})();
pages/learnList/items/list/row/row.ls
(function(){
return function(page){
return function(data){
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(data.rowType === "header"
? inc("header/row")(page)
: data.rowType === "footer"
? inc("footer/row")(page)
: inc("item/row")(page, data)));
};
};
})();
pages/learnList/items/noItems/_t.ls
(function(){
return {
noEntries: {
de: "Diese Lernliste hat noch keine Einträge.",
en: "This study list does not have any entries.",
fr: "Cette liste n'a aucune entrée.",
es: "Esta lista no tiene ninguna entrada.",
pt: "Esta lista de estudo não possui nenhuma entrada."
},
newEntries: {
de: "
Tippe oben auf Bearbeiten, um neue Einträge anzulegen.",
en: "
Select Edit above to add new entries.",
fr: "
Appuie sur Modifier pour créer des entrées.",
es: "
Presiona Editar para crear una entrada.",
pt: "
Toque em Editar para criar novas entradas."
}
};
})();
pages/learnList/items/noItems/noItems.ls
(function(){
return function(page){
return Div({
width: "35em",
maxWidth: "90%",
margin: "0 auto",
lineheight: "1.5em"
}).append(T("noEntries"), page.learnListDescription.isCreator ? T("newEntries") : void 8);
};
})();
pages/learnList/items/onNewLogEvents/onNewLogEvents.ls
(function(){
return function(page){
page.addClass("onNewLogEvents_learnListDescription");
return page.onNewLogEvents = function(events){
var i$, len$, e, ref$, results$ = [];
for (i$ = 0, len$ = events.length; i$ < len$; ++i$) {
e = events[i$];
if (e.logId === log.id() && e.listCode === page.listCode && e.description.etag !== ((ref$ = page.learnListDescription) != null ? ref$.etag : void 8) && page === app.currentPage) {
startPage({
history: 0
});
break;
}
}
return results$;
};
};
})();
pages/learnList/items/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.hideColumnA = false;
page.hideColumnB = false;
inc("onNewLogEvents/onNewLogEvents")(page);
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var loadFile, create;
loadFile = function(){
return inc("../_shared/loadFile/load")(page, create);
};
create = function(){
return page.html(page.listReport.items.length > 0
? inc("list/list")(page)
: inc("noItems/noItems")(page));
};
page.reset = function(){
var ref$;
page.header.reset();
return (ref$ = page.list) != null ? ref$.reset() : void 8;
};
return loadFile();
}
};
};
})();
pages/learnList/learn/_rowLeft/left.ls
(function(){
return function(title, levelPath){
return Div({
flex: "1 1 auto",
textAlign: "left",
lineHeight: "1.4em",
padding: "0.7em 0.4em 0.7em",
wordWrap: "break-word",
hyphens: "auto"
}).html(title);
};
})();
pages/learnList/learn/_rowLeft/title/title.ls
(function(){
return function(level){
var l;
l = {
dragCard: T("dragCard"),
memory: T("assign"),
gapMultiWriteTrain: T("writeTrain"),
wordBuilder: T("wordBuilder"),
gapMulti: T("writeTest")
};
return l[level.trainer];
};
})();
pages/learnList/learn/_topbar/_t.ls
(function(){
return {
backLabel: {
de: "Lernlisten",
en: "Study lists",
fr: "Listes",
es: "Listas",
pt: "Listas de estudo"
},
tabLearn: {
de: "Lernen",
en: "Study",
fr: "Exercices",
es: "Ejercicios",
pt: "Exercícios"
},
tabList: {
de: "Einträge ($1)",
en: "Entries ($1)",
fr: "Entrées ($1)",
es: "Entradas ($1)",
pt: "Entradas ($1)"
},
tabSettings: {
de: "Einstellungen",
en: "Settings",
fr: "Paramètres",
es: "Ajustes",
pt: "Configurações"
}
};
})();
pages/learnList/learn/_topbar/backLabel/_t.ls
(function(){
return {
allLists: {
de: "Alle Listen",
en: "All lists",
fr: "Toutes les listes",
es: "Todas las listas",
pt: "Todas as listas"
},
myLists: {
de: "Meine Listen",
en: "My lists",
fr: "Mes listes",
es: "Mis listas",
pt: "Minhas listas"
}
};
})();
pages/learnList/learn/_topbar/backLabel/label.ls
(function(){
return function(page){
var c, ref$, ref1$, ref2$;
c = page.context;
if (c === "allLists") {
return T("allLists");
} else if (c === "myLists") {
return T("myLists");
} else if (c === "groupAll" || c === "groupPupil") {
return (ref$ = page.groupDescription) != null ? ref$.name : void 8;
} else if (c === "groupSingle") {
return ((ref1$ = page.memberDescription) != null ? ref1$.groupInternalName : void 8) || ((ref2$ = page.memberDescription) != null ? ref2$.displayName : void 8);
}
};
})();
pages/learnList/learn/_topbar/topbar.ls
(function(){
return function(page){
var ld;
ld = page.learnListDescription;
return inc("/../app01/addons/topbar2/topbar")({
title: ld.name,
back: true,
backLabel: inc("backLabel/label")(page),
topRightCustom: function(){
return inc("../../_shared/topRightEditButton/button")(page);
}
});
};
})();
pages/learnList/learn/buttons/addBookmarkButton/button.ls
(function(){
return function(page){
var tap;
if (page.learnListDescription.isCreator) {
return;
}
tap = function(){
return inc("popupConfirm/popup")(page);
};
return Div({
display: "flex",
justifyContent: "flex-start",
marginBottom: "0.7em"
}).html(Div({
display: "flex",
padding: "0 0.1em",
background: Color.grey[200],
borderRadius: "3px",
fontSize: "0.9em"
}).html(inc("icon/icon")(), inc("label/label")()).tap(tap));
};
})();
pages/learnList/learn/buttons/addBookmarkButton/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/plus.svg"),
size: "0.8em",
color: Color.blue[500]
}).css({
margin: "0.3em 0.1em 0.3em 0.3em"
});
};
})();
pages/learnList/learn/buttons/addBookmarkButton/label/_t.ls
(function(){
return {
myLists: {
de: "Meine Listen",
en: "My lists",
fr: "Mes listes",
es: "Mis listas",
pt: "Minhas listas"
}
};
})();
pages/learnList/learn/buttons/addBookmarkButton/label/label.ls
(function(){
return function(){
return Div({
padding: "0.2em"
}).html(T("myLists"));
};
})();
pages/learnList/learn/buttons/addBookmarkButton/popupConfirm/_t.ls
(function(){
return {
labelAdd: {
de: "Soll diese Lernliste jetzt zu deinen Listen hinzugefügt werden?",
en: "Would you like to add this study list to your lists?",
fr: "Veux-tu ajouter cette liste à tes listes personnelles maintenant ?",
es: "¿Quieres agregar esta lista a tus listas?",
pt: "Você gostaria de adicionar esta lista de estudo às suas listas?"
}
};
})();
pages/learnList/learn/buttons/addBookmarkButton/popupConfirm/popup.ls
(function(){
return function(page){
var submit;
submit = function(){
return inc("submit/submit")(page);
};
return inc("/../app01/lib/gui/confirmPopup/popup")({
onConfirm: submit,
yesLabel: T("addButton"),
noLabel: T("cancelButton"),
label: T("labelAdd")
});
};
})();
pages/learnList/learn/buttons/addBookmarkButton/popupConfirm/submit/submit.ls
(function(){
return function(page){
var listCode, spinner, onError;
listCode = page.learnListDescription.listCode;
spinner = inc("/../app01/lib/gui/spinnerOverlay/overlay")();
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/bookmark/add/add"),
params: {
listCode: listCode
},
requiredVisibleDiv: app.currentPage,
onError: onError = function(error){
spinner.remove();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
spinner.remove();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(result){
if (result.status !== "ok") {
return onError();
} else {
spinner.remove();
return log.sync(function(){
return startPage({
history: 0
});
});
}
}
});
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/button.ls
(function(){
return function(page){
var tap;
tap = function(){
return inc("popupConfirmRemove/popup")(page);
};
return Div({
display: "flex",
marginLeft: "0.3em",
padding: "0 0.1em",
background: Color.grey[200],
borderRadius: "3px",
fontSize: "0.9em"
}).append(inc("icon/icon")(), inc("label/label")()).tap(tap);
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/cross.svg"),
color: Color.blue[500],
size: "0.9em"
}).css({
margin: "0.3em 0.1em 0.3em 0.3em"
});
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/label/_t.ls
(function(){
return {
myList: {
de: "Meine Liste",
en: "My list",
fr: "Ma liste",
es: "Mi lista",
pt: "Minha lista"
}
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/label/label.ls
(function(){
return function(p){
return Div({
padding: "0.2em"
}).html(T("myList"));
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/popupConfirmRemove/_t.ls
(function(){
return {
labelRemove: {
de: "Soll diese Lernliste jetzt aus deinen Listen entfernt werden?",
en: "Would you like to remove this study list from your lists?",
fr: "Veux-tu retirer cette liste de tes listes personnelles maintenant ?",
es: "¿Quieres eliminar esta lista de tus listas?",
pt: "Você gostaria de remover esta lista de estudo das suas listas?"
}
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/popupConfirmRemove/popup.ls
(function(){
return function(page){
var submit;
submit = function(){
return inc("submit/submit")(page);
};
return inc("/../app01/lib/gui/confirmPopup/popup")({
onConfirm: submit,
yesLabel: T("removeButton"),
noLabel: T("cancelButton"),
label: T("labelRemove")
});
};
})();
pages/learnList/learn/buttons/buttonRemoveBookmark/popupConfirmRemove/submit/submit.ls
(function(){
return function(page){
var listCode, spinner, onError;
listCode = page.learnListDescription.listCode;
spinner = inc("/../app01/lib/gui/spinnerOverlay/overlay")();
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/bookmark/remove/remove"),
params: {
listCode: listCode
},
requiredVisibleDiv: app.currentPage,
onError: onError = function(error){
spinner.remove();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
spinner.remove();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(result){
if (result.status !== "ok") {
return onError();
} else {
spinner.remove();
return log.sync(function(){
return startPage({
history: -1,
animation: "slideRight"
});
});
}
}
});
};
})();
pages/learnList/learn/buttons/buttons.ls
(function(){
return function(page){
var ld, context;
ld = page.learnListDescription;
context = page.context;
if (ld.totalItems === 0 && ld.isCreator) {
return;
}
return Div({
display: "flex",
justifyContent: "flex-start",
alignItems: "flex-start"
}).append(_.includes(context, "group") || ld.isCreator
? inc("/../app01/pages/content/block/pinAndReport/pin/pin")(page)
: context === "allLists" && !ld.isBookmarked
? inc("addBookmarkButton/button")(page)
: inc("/../app01/pages/content/block/pinAndReport/pin/pin")(page).append(ld.isBookmarked ? inc("buttonRemoveBookmark/button")(page) : void 8), inc("/../app01/pages/content/block/pinAndReport/reportButton/reportButton")(page));
};
})();
pages/learnList/learn/calc/groupDescription/calc.ls
(function(){
return function(page){
if (_.includes(page.context, "group")) {
return inc("/../app01/data/group/calcGroupDescription/calc")();
}
};
})();
pages/learnList/learn/calc/memberDescription/calc.ls
(function(){
return function(page){
if (page.context === "groupSingle") {
return inc("/../app01/data/group/getCachedMemberDescription/get")(page.params.groupCode, page.params.groupSinglePublicId);
}
};
})();
pages/learnList/learn/cover/cover.ls
(function(){
return function(page){
return inc("/pages/_shared/calcLearnListCover/cover")(page.learnListDescription).css({
fontSize: "2.2em",
flex: "0 0 auto",
margin: "0.4em 0.8em 1.5em 0.4em"
});
};
})();
pages/learnList/learn/creator/creator.ls
(function(){
return function(page){
var ld, ref$;
ld = page.learnListDescription;
return Div({
display: "flex",
margin: "-1.4em 0 0.6em",
padding: "0.3em",
flexWrap: "wrap",
lineHeight: "1.4em"
}).html(inc("label/label")(ld), (ref$ = inc("/pages/_shared/tagNewFork/tag")(ld, page.context)) != null ? ref$.css({
marginLeft: "0.5em",
fontSize: "0.9em"
}) : void 8);
};
})();
pages/learnList/learn/creator/label/_t.ls
(function(){
return {
byShort: {
de: " von $1",
en: " by $1",
fr: " d'$1",
es: " de $1",
pt: " de $1"
},
by: {
de: " von $1",
en: " by $1",
fr: " de $1",
es: " de $1",
pt: " de $1"
}
};
})();
pages/learnList/learn/creator/label/label.ls
(function(){
return function(ld){
var name, vowels, name0, label;
name = ld.creatorDisplayName;
if (_.startsWith(name, "Herr ") && engine.guiLanguage === "de") {
name = name.replace("Herr ", "Herrn ");
}
vowels = "aeiou".split("");
name0 = name[0].toLowerCase();
label = in$(name0, vowels)
? T("byShort", name)
: T("by", name);
return Div({
color: Color.grey[600],
fontSize: "0.9em",
flex: "0 1 auto"
}).secureHtml(label, inc("/pages/_shared/visibility/visibility")(ld));
};
})();
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
pages/learnList/learn/debugInfos/debugInfos.ls
(function(){
return function(page){
return Div({
margin: "1.5em auto",
color: Color.grey[500],
fontSize: "0.95em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/shape/debug.svg"),
color: Color.grey[350]
}).css({
marginRight: "0.2em",
verticalAlign: "-0.1em"
}), "List Code: ", Div({
display: "inline",
userSelect: "text",
marginRight: "1em"
}).html(page.listCode), "List Type: ", Div({
display: "inline",
userSelect: "text"
}).html(page.learnListDescription.type));
};
})();
pages/learnList/learn/description/full/full.ls
(function(){
return function(page){
var description, d, tap, div, div1;
description = page.learnListDescription.description;
if (!description) {
return;
}
d = description.split("\n").join(" ");
tap = function(){
return div.replaceWith(inc("../short/short")(page));
};
return div = Div({
display: "flex",
margin: "-0.7em 0 1.5em",
fontSize: "0.9em",
color: Color.grey[600]
}).append(div1 = Div({
flex: "0 1 auto",
display: "flex",
overflow: "hidden",
padding: "0.2em",
margin: "0 1em",
lineHeight: "1.5em"
}).secureHtml(d)).tap({
up: tap,
animation: "none"
});
};
})();
pages/learnList/learn/description/short/dots/dots.ls
(function(){
return function(){
return Div({
position: "absolute",
background: "white",
top: 0,
right: 0,
paddingLeft: "0.2em"
}).html(Div({
display: "flex",
color: Color.blue[500],
padding: "0.1em 0.2em 0em",
margin: "0.1em 0 0 -0.1em"
}).html("..."));
};
})();
pages/learnList/learn/description/short/short.ls
(function(){
return function(page){
var description, d, tap, div, div1, div2;
description = page.learnListDescription.description;
if (!description) {
return;
}
d = description.split("\n").join(" ");
tap = function(){
return div.replaceWith(inc("../full/full")(page));
};
return div = Div({
display: "flex",
margin: "-0.7em 0 1.5em",
fontSize: "0.9em",
color: Color.grey[600]
}).append(div1 = Div({
flex: "0 1 auto",
display: "flex",
overflow: "hidden",
padding: "0.2em",
margin: "0 1em",
justifyContent: "flex-start"
}).append(div2 = Div({
whiteSpace: "nowrap"
}).secureHtml(d)).onDomAppend(function(){
if (div2.width() > div1.width()) {
return div1.append(inc("dots/dots")()).tap(tap);
}
}).onWindowResize(function(){
return div.replaceWith(inc(THISFILE)(page));
}));
};
})();
pages/learnList/learn/lastViewed/lastViewed.ls
(function(){
return function(levelPath){
var c;
c = inc("/../app01/lib/util/cache/get/get")("lastLearnListClick");
if (levelPath !== c) {
return;
}
return Div({
position: "absolute",
top: "0.15em",
right: "0.3em",
fontSize: "0.7em",
color: Color.grey[600]
}).html(_.endsWith(levelPath, "list")
? T("lastViewed")
: T("lastStarted"));
};
})();
pages/learnList/learn/levels/level/bar/bar.ls
(function(){
return function(page, level){
var context;
context = page.context;
level.levelPath = ("/learnList/" + page.listCode + "/") + level.trainer;
if ((context === "groupAll" || context === "groupSingle") && !page.levelsReport) {
return inc("/pages/_shared/onlyOnline/onlyOnline")();
} else if (context === "groupAll") {
return inc("barAll/bar")(page, level);
} else {
return inc("barSingle/bar")(page, level);
}
};
})();
pages/learnList/learn/levels/level/bar/barAll/bar.ls
(function(){
return function(page, level){
var div;
return Div({
display: "flex"
}).append(inc("icon/icon")(), div = Div({
display: "flex",
width: "4em",
height: "10px",
backgroundColor: Color.grey[200],
overflow: "hidden",
borderRadius: "10px"
}).onDomAppend(function(){
return div.append(inc("canvasAll/canvas")(div, page, level));
}));
};
})();
pages/learnList/learn/levels/level/bar/barAll/canvasAll/calcFinishRates/calc.ls
(function(){
return function(page, level){
var ld, levelsReport, totalPupils, finishRates, sublevel, totalItems, puid, groupEvents, totalDone, finishRate;
ld = page.learnListDescription;
levelsReport = page.levelsReport;
totalPupils = levelsReport.members.length;
return finishRates = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ld.sublevels).length; i$ < len$; ++i$) {
sublevel = ref$[i$];
totalItems = sublevel.to - sublevel.from + 1;
puid = "/learnList/" + ld.listCode + ("/" + level.trainer) + ("/sublevel-" + sublevel.id);
groupEvents = levelsReport.groupedEvents[puid];
totalDone = groupEvents ? _.keys(groupEvents).length : 0;
results$.push(finishRate = totalDone / totalPupils);
}
return results$;
}());
};
})();
pages/learnList/learn/levels/level/bar/barAll/canvasAll/canvas.ls
(function(){
return function(div, page, level){
var canvas, ctx, finishRates, rowWidth, i$, len$, i, finishRate, xFrom, xTo, height;
canvas = inc("canvas/canvas")(div);
ctx = canvas.getContext("2d");
finishRates = inc("calcFinishRates/calc")(page, level);
rowWidth = (canvas.width + 2) / finishRates.length;
for (i$ = 0, len$ = finishRates.length; i$ < len$; ++i$) {
i = i$;
finishRate = finishRates[i$];
xFrom = _.round(i * rowWidth);
xTo = _.round((i + 1) * rowWidth);
height = canvas.height;
inc("sublevel/sublevel")(xFrom, xTo, height, finishRate, ctx);
inc("whiteLine/line")(xFrom, height, ctx);
}
return canvas;
};
})();
pages/learnList/learn/levels/level/bar/barAll/canvasAll/canvas/canvas.ls
(function(){
return function(div){
var dpr, w, h;
dpr = window.devicePixelRatio;
w = _.round(div.width() * dpr);
h = _.round(div.height() * dpr);
return document.createElement("canvas").attr({
width: w,
height: h
}).css({
width: w / dpr + "px",
height: h / dpr + "px"
});
};
})();
pages/learnList/learn/levels/level/bar/barAll/canvasAll/sublevel/sublevel.ls
(function(){
return function(xFrom, xTo, height, finishRate, ctx){
var xDelta, yDelta, yFrom;
if (finishRate === 0) {
return;
}
xDelta = xTo - xFrom - 2;
yDelta = height * finishRate;
yFrom = height - yDelta;
ctx.fillStyle = Color.blue[300];
return ctx.fillRect(xFrom, yFrom, xDelta, yDelta);
};
})();
pages/learnList/learn/levels/level/bar/barAll/canvasAll/whiteLine/line.ls
(function(){
return function(xFrom, height, ctx){
ctx.fillStyle = "white";
return ctx.fillRect(xFrom - 2, 0, 2, height);
};
})();
pages/learnList/learn/levels/level/bar/barAll/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/user.svg"),
color: Color.grey[450],
size: "0.83em"
}).css({
margin: "0 0.1em 0 0"
});
};
})();
pages/learnList/learn/levels/level/bar/barSingle/bar.ls
(function(){
return function(page, level){
var t;
t = page.learnListDescription.totalSublevels;
return inc("/pages/_shared/sublevelBar/bar")({
levelPath: level.levelPath,
totalSublevels: t,
comingFromPage: "list"
}).css({
pointerEvents: "none",
height: "1em",
width: t > 10
? "7em"
: t > 8
? "6em"
: t > 6
? "5em"
: t > 4
? "4em"
: t > 2 ? "3em" : "2.5em"
});
};
})();
pages/learnList/learn/levels/level/level.ls
(function(){
return function(page, level){
var levelPath, title, tapNoItems, tap, b;
levelPath = ("/learnList/" + page.listCode + "/") + level.trainer;
title = inc("/pages/_shared/calcLevelTitle/calc")(levelPath);
tapNoItems = function(){
return inc("popupNoItems/popup")();
};
tap = function(){
inc("/../app01/lib/util/cache/set/set")("lastLearnListClick", levelPath);
return startPage({
path: path("/pages/level/intro/page"),
params: {
levelPath: levelPath,
context: "learnList"
}
});
};
return Div({
display: "flex",
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
marginTop: "-1px",
minHeight: "4em",
minWidth: 0
}).html(inc("../../_rowLeft/left")(title, levelPath), inc("../../lastViewed/lastViewed")(levelPath), inc("bar/bar")(page, level)).tap(page.learnListDescription.totalItems === 0 ? tapNoItems : tap);
};
})();
pages/learnList/learn/levels/level/popupNoItems/_t.ls
(function(){
return {
errorNoEntries: {
de: "Du kannst hier noch nichts lernen, da die Liste noch keine Einträge hat.",
en: "You won't be able to study anything here, since this list doesn't have any entries.",
fr: "Tu ne peux pas faire l'exercice car la liste n'a aucune entrée.",
es: "No puedes resolver ejercicios aquí porque esta lista aún no tiene entradas.",
pt: "Você ainda não pode aprender nada aqui, porque a lista ainda não tem entradas."
}
};
})();
pages/learnList/learn/levels/level/popupNoItems/popup.ls
(function(){
return function(){
return inc("/../app01/lib/gui/errorPopup/popup")({
label: T("errorNoEntries")
});
};
})();
pages/learnList/learn/levels/levels.ls
(function(){
return function(page){
var l;
return Div().html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = page.learnListDescription.levels).length; i$ < len$; ++i$) {
l = ref$[i$];
results$.push(inc("level/level")(page, l));
}
return results$;
}()));
};
})();
pages/learnList/learn/listRow/_t.ls
(function(){
return {
listTotalEntries: {
de: "Liste, (($1 Eintrag | $1 Einträge))",
en: "List, (($1 entry | $1 entries))",
fr: "Liste, (($1 entrée | $1 entrée | $1 entrées))",
es: "Lista, (($1 entrada | $1 entradas))",
pt: "Lista, (($1 entrada | $1 entradas))"
}
};
})();
pages/learnList/learn/listRow/icon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/icon/list2.svg"),
color: Color.grey[600],
size: "1.2em"
}).css({
marginRight: "0.4em"
});
};
})();
pages/learnList/learn/listRow/row.ls
(function(){
return function(page){
var levelPath, tap, b;
levelPath = ("/learnList/" + page.listCode + "/") + "list";
tap = function(){
inc("/../app01/lib/util/cache/set/set")("lastLearnListClick", levelPath);
return startPage({
path: path("/pages/learnList/items/page"),
animation: "fadeIn",
params: {
listCode: page.listCode
}
});
};
return Div({
display: "flex",
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
marginTop: "-1px",
minHeight: "4em",
minWidth: 0
}).append(inc("../_rowLeft/left")(inc("title/title")(page.learnListDescription), levelPath), inc("../lastViewed/lastViewed")(levelPath), inc("icon/icon")()).tap(tap);
};
})();
pages/learnList/learn/listRow/title/title.ls
(function(){
return function(ld){
var preview, total;
preview = ld.preview;
total = ld.totalItems;
if (total > 0 && !_.endsWith(preview, "...")) {
preview += "...";
}
return Div().html(T("listTotalEntries", total), Div({
fontSize: "0.8em",
color: Color.grey[550],
marginTop: "0.2em"
}).secureHtml(preview));
};
})();
pages/learnList/learn/loadLevelsReport/calcLearnListPuids/calc.ls
(function(){
return function(ld){
var puids, res$, i$, ref$, len$, level, lresult$, j$, ref1$, len1$, sublevel;
res$ = [];
for (i$ = 0, len$ = (ref$ = ld.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
lresult$ = [];
for (j$ = 0, len1$ = (ref1$ = ld.sublevels).length; j$ < len1$; ++j$) {
sublevel = ref1$[j$];
lresult$.push("/learnList/" + ld.listCode + ("/" + level.trainer) + ("/sublevel-" + sublevel.id));
}
res$.push(lresult$);
}
puids = res$;
return puids = _.flatten(puids);
};
})();
pages/learnList/learn/loadLevelsReport/load.ls
(function(){
return function(page, onDone){
var levelPuids;
levelPuids = inc("calcLearnListPuids/calc")(page.learnListDescription);
return inc("/../app01/data/group/getLevelsReport/get")({
levelPuids: levelPuids,
onOffline: function(){
return onDone();
},
onError: function(){
return debug("onError");
},
onLoaded: function(levelsReport){
page.levelsReport = levelsReport;
return onDone();
}
});
};
})();
pages/learnList/learn/navCategory/calc.ls
(function(){
return function(context){
if (_.includes(context, "group")) {
return "groups";
} else {
return inc("/_shared/calcNavCategory/calc")();
}
};
})();
pages/learnList/learn/noItems/_t.ls
(function(){
return {
noEntriesEdit: {
de: "Diese Liste hat noch keine Einträge. Tippe oben auf Bearbeiten, um neue Einträge anzulegen.",
en: "This list does not have any entries. Select Edit above to add new entries.",
fr: "Cette liste n'a aucune entrée. Appuie sur Modifier pour ajouter des entrées.",
es: "Esta lista no tiene entradas. Presiona editar para agregar entradas nuevas.",
pt: "Esta lista não possui entradas. Toque em editar para adicionar novas entradas."
}
};
})();
pages/learnList/learn/noItems/noItems.ls
(function(){
return function(page){
var ld;
ld = page.learnListDescription;
if (ld.totalItems === 0 && ld.isCreator) {
return Div({
background: Color.grey[100],
textAlign: "left",
padding: "0.3em",
marginBottom: "0.7em",
fontSize: "0.9em",
color: Color.grey[800],
lineHeight: "1.5em"
}).html(T("noEntriesEdit"));
}
};
})();
pages/learnList/learn/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.context = page.params.context;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.groupDescription = inc("calc/groupDescription/calc")(page);
page.memberDescription = inc("calc/memberDescription/calc")(page);
return {
navCategory: inc("navCategory/calc")(page.context),
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("../../_shared/urlDescription/description")();
},
start: function(){
var loadLevelsReport, create, ref$;
loadLevelsReport = function(){
return inc("loadLevelsReport/load")(page, create);
};
create = function(){
return page.css({
margin: "2em auto 3em",
width: "35em",
maxWidth: "95%"
}).html(inc("cover/cover")(page), inc("creator/creator")(page), inc("description/short/short")(page), inc("noItems/noItems")(page), inc("buttons/buttons")(page), inc("listRow/row")(page), inc("levels/levels")(page), inc("reportIcon/icon")(page), engine.isDebug ? inc("debugInfos/debugInfos")(page) : void 8);
};
page.refreshAfterPinChange = function(){
return create();
};
if ((ref$ = page.context) === "groupAll" || ref$ === "groupSingle") {
page.html(inc("/../app01/lib/gui/spinner/spinner")());
return loadLevelsReport();
} else {
return create();
}
}
};
};
})();
pages/learnList/learn/reportIcon/_t.ls
(function(){
return {
reportList: {
de: "Liste melden",
en: "Report list",
fr: "Signaler la liste",
es: "Reportar lista",
pt: "Denunciar lista"
}
};
})();
pages/learnList/learn/reportIcon/icon.ls
(function(){
return function(page){
if (page.learnListDescription.isCreator) {
return;
}
return Div({
margin: "1em auto",
color: Color.grey[500]
}).html(inc("/../app01/lib/gui/link/link")({
label: T("reportList")
}).tap(function(){
return inc("/pages/_shared/reportPopup/start")(page);
}));
};
})();
pages/learnList/settings/_row/arrow/arrow.ls
(function(){
return function(o){
if (!o.arrow) {
return;
}
return SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[400]
}).css({
marginLeft: "0.3em"
});
};
})();
pages/learnList/settings/_row/icon/icon.ls
(function(){
return function(o){
if (!o.icon) {
return;
}
return Div({
flex: "1 1 auto",
display: "flex",
justifyContent: "flex-end"
}).html(o.icon);
};
})();
pages/learnList/settings/_row/label/label.ls
(function(){
return function(o){
var label;
label = o.label;
if (!label) {
return;
}
return Div({
flex: "1 0 auto",
padding: "0.6em 0.6em 0.6em 0"
}).html(label);
};
})();
pages/learnList/settings/_row/row.ls
(function(){
return function(o){
var b;
return Div({
display: "flex",
textAlign: "left",
padding: "0 0.3em",
borderBottom: b = "1px solid " + Color.grey[200],
borderTop: b,
width: "35em",
maxWidth: "95%",
margin: "0 auto -1px",
alignItems: "center",
minHeight: "3.3em"
}).html(inc("label/label")(o), inc("value/value")(o), inc("icon/icon")(o), inc("arrow/arrow")(o));
};
})();
pages/learnList/settings/_row/value/value.ls
(function(){
return function(o){
var value, div, that;
value = o.value;
if (value == null) {
return;
}
if (value.html != null) {
return value;
}
value = "" + value;
div = Div({
flex: "1 1 auto",
display: "flex",
userSelect: "none",
color: Color.grey[700],
overflow: "hidden",
justifyContent: "flex-end",
textAlign: "right"
});
if (that = o.valueCustomCss) {
div.css(that);
}
if (!(value != null && value.length) > 0) {
div.html("-");
} else if (_.isString(value) || !_.isObject(value)) {
div.secureHtml(value);
} else {
div.html(value);
}
return div;
};
})();
pages/learnList/settings/_t.ls
(function(){
return {
type: {
de: "Listentyp",
en: "List type",
fr: "Type de liste",
es: "Tipo de lista",
pt: "Tipo de lista"
},
name: {
de: "Name",
en: "Name",
fr: "Nom",
es: "Nombre",
pt: "Nome"
},
description: {
de: "Beschreibung",
en: "Description",
fr: "Description",
es: "Descripción",
pt: "Descrição"
},
visibility: {
de: "Sichtbar für",
en: "Visible for",
fr: "Visible pour",
es: "Visible para",
pt: "Visível para"
},
created: {
de: "Liste angelegt",
en: "List created",
fr: "Liste créée",
es: "Lista creada",
pt: "Lista criada"
}
};
})();
pages/learnList/settings/_topbar/_t.ls
(function(){
return {
titleSettings: {
de: "Einstellungen",
en: "Settings",
fr: "Paramètres",
es: "Ajustes",
pt: "Configurações"
},
toList: {
de: "Zur Liste: $1",
en: "To list: $1",
fr: "À la liste : $1",
es: "A la lista $1",
pt: "Ir para lista: $1"
}
};
})();
pages/learnList/settings/_topbar/topbar.ls
(function(){
return function(page){
var ld;
ld = page.learnListDescription;
return inc("/../app01/addons/topbar2/topbar")({
title: T("titleSettings"),
close: true,
closeLabel: T("toList", "" + ld.name + "")
});
};
})();
pages/learnList/settings/coverImageId/_t.ls
(function(){
return {
noCoverId: {
de: "ohne",
en: "none",
fr: "sans",
es: "sin",
pt: "sem"
}
};
})();
pages/learnList/settings/coverImageId/page/_t.ls
(function(){
return {
title: {
de: "CoverImageId",
en: "CoverImageId",
fr: "CoverImageId",
es: "CoverImageId",
pt: "CoverImageId"
},
errorOops: {
de: "Ups, etwas ist schief gegangen.",
en: "Oops, something went wrong.",
fr: "Oups… une erreur s'est produite.",
es: "¡Ups! Ocurrió un error.",
pt: "Ops! Ocorreu um erro."
},
change: {
de: "Ändern",
en: "Change",
fr: "Changer",
es: "Cambiar",
pt: "Modificar"
}
};
})();
pages/learnList/settings/coverImageId/page/_topbar/topbar.ls
(function(){
return function(){
return inc("/../app01/addons/topbar2/topbar")({
back: true,
title: T("title")
});
};
})();
pages/learnList/settings/coverImageId/page/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var coverImageId, submit, form;
coverImageId = page.learnListDescription.coverImageId;
submit = function(){
var v;
v = form.input.getValue();
if (v === coverImageId) {} else {
return inc("submit/submit")(page, form);
}
};
page.append(form = inc("/../app01/lib/gui/inputForm/inputForm")({
submitLabel: T("change"),
submit: submit,
value: coverImageId
}));
return form.input.start();
}
};
};
})();
pages/learnList/settings/coverImageId/page/submit/submit.ls
(function(){
return function(page, form){
var imageId, onError, onOffline, onCompleted;
imageId = form.input.getValue();
form.showSpinner();
onError = function(error){
form.hideSpinner();
return form.error.html(error.message || T("errorOops"));
};
onOffline = function(){
form.input.start();
form.hideSpinner();
return inc("/../app01/lib/offline/offlinePopup/popup")();
};
onCompleted = function(result){
if (result.status !== "ok") {
return onError(result);
} else {
return log.sync(function(){
return startPage({
history: -1,
animation: "slideRight"
});
});
}
};
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/updateCoverImageId/update"),
params: {
listCode: page.listCode,
imageId: imageId
},
requiredVisibleDiv: form,
onError: onError,
onOffline: onOffline,
onCompleted: onCompleted
});
};
})();
pages/learnList/settings/coverImageId/row.ls
(function(){
return function(page){
var coverImageId, tap;
if (!engine.isDebug) {
return;
}
coverImageId = page.learnListDescription.coverImageId;
tap = function(){
return startPage({
path: path("page/page"),
animation: "slideLeft",
params: {
listCode: page.listCode
}
});
};
return inc("../_row/row")({
label: Div().html("CoverImageId", SvgIcon(path("/../app01/lib/svg/shape/debug.svg")).css({
verticalAlign: "-0.1em",
paddingLeft: "0.2em"
})),
arrow: true,
value: !coverImageId ? T("noCoverId") : coverImageId
}).tap(tap);
};
})();
pages/learnList/settings/created/row.ls
(function(){
return function(page){
var created, value;
created = page.learnListDescription.created;
value = inc("/../app01/lib/util/formatDate2/format")(created);
return inc("../_row/row")({
label: T("created"),
value: value.formats.full
});
};
})();
pages/learnList/settings/delete/_t.ls
(function(){
return {
deleteList: {
de: "Liste löschen",
en: "Delete list",
fr: "Effacer la liste",
es: "Eliminar lista",
pt: "Apagar lista"
},
popupText: {
de: "Möchtest du diese Lernliste jetzt löschen?",
en: "Would you like to delete this list now?",
fr: "Veux-tu effacer cette liste maintenant ?",
es: "¿Quieres eliminar esta lista ahora?",
pt: "Você quer mesmo apagar esta lista?"
},
yesDelete: {
de: "Ja, löschen",
en: "Yes, delete",
fr: "Oui, effacer",
es: "Sí, retirar",
pt: "Sim, apagar"
},
noAbort: {
de: "Nein, abbrechen",
en: "No, cancel",
fr: "Non, abandonner",
es: "No, cancelar",
pt: "Não, cancelar"
}
};
})();
pages/learnList/settings/delete/popup/popup.ls
(function(){
return function(page, onConfirm){
var clickYes, clickNo, div, buttonsDiv, css, popup;
clickYes = function(){
buttonsDiv.replaceWith(inc("/../app01/lib/gui/spinner/spinner")().css({
height: "3.5em"
}));
return onConfirm();
};
clickNo = function(){
return popup.close();
};
div = Div({
margin: "1em"
}).append(Div({
paddingBottom: "0.7em",
lineHeight: "1.5em",
margin: "0 0.5em"
}).html(T("popupText")), buttonsDiv = Div().append(Button(T("yesDelete")).css(css = {
minWidth: "6em",
margin: "0.5em"
}).addClass("keyManager-enter").bind("keyManager", clickYes).tap(clickYes), Button(T("noAbort")).css(css).tap(clickNo)));
popup = inc("/../app01/lib/gui/popup/popup")({
html: div
});
return page.popup = popup;
};
})();
pages/learnList/settings/delete/row.ls
(function(){
return function(page){
var tap;
tap = function(){
return inc("popup/popup")(page, function(){
return inc("submit/submit")(page);
});
};
return inc("../_row/row")({
label: T("deleteList"),
icon: SvgIcon({
svg: path("/../app01/lib/svg/icon/bin.svg"),
color: Color.grey[700]
})
}).tap(tap);
};
})();
pages/learnList/settings/delete/submit/submit.ls
(function(){
return function(page){
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/delete/delete"),
params: {
listCode: page.listCode
},
onCompleted: function(result){
return log.sync(function(){
page.popup.close();
return startPage({
history: function(path){
return !_.includes(path, "/learnList/");
},
animation: "slideRight",
params: {
clearCache: true
}
});
});
},
onError: function(){
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
return inc("/../app01/lib/offline/offlinePopup/popup")();
}
});
};
})();
pages/learnList/settings/description/page/_t.ls
(function(){
return {
title: {
de: "Beschreibung",
en: "Description",
fr: "Description",
es: "Descripción",
pt: "Descrição"
},
errorOops: {
de: "Ups, etwas ist schief gegangen.",
en: "Oops, something went wrong.",
fr: "Oups… une erreur s'est produite.",
es: "¡Ups! Algo salió mal.",
pt: "Ops! Algo deu errado aqui."
}
};
})();
pages/learnList/settings/description/page/_topbar/close/close.ls
(function(){
return function(page){
var ref$, oldValue, newValue, close;
if ((ref$ = document.activeElement) != null) {
ref$.blur();
}
oldValue = page.learnListDescription.description;
newValue = page.input.getValue();
close = function(){
return startPage({
history: -1,
animation: "slideRight"
});
};
if (oldValue !== newValue) {
return inc("popupSave/popup")(page, close);
} else {
return close();
}
};
})();
pages/learnList/settings/description/page/_topbar/close/popupSave/_t.ls
(function(){
return {
confirmSave: {
de: "Möchtest du deine Änderungen speichern?",
en: "Would you like to save your changes?",
fr: "Veux-tu enregistrer tes modifications ?",
es: "¿Quieres guardar tus cambios?",
pt: "Você gostaria de salvar suas alterações?"
},
saveButton: {
de: "Speichern",
en: "Save",
fr: "Enregistrer",
es: "Guardar",
pt: "Salvar"
},
discardButton: {
de: "Verwerfen",
en: "Discard",
fr: "Abandonner",
es: "Descartar",
pt: "Descartar"
}
};
})();
pages/learnList/settings/description/page/_topbar/close/popupSave/label/label.ls
(function(){
return function(page){
return Div({
lineHeight: "1.5em"
}).html(T("confirmSave"));
};
})();
pages/learnList/settings/description/page/_topbar/close/popupSave/popup.ls
(function(){
return function(page, close){
return inc("/../app01/lib/gui/confirmPopup/popup")({
label: inc("label/label")(page),
noLabel: T("discardButton"),
yesLabel: T("saveButton"),
done: function(confirm){
if (confirm) {
return page.submit();
} else {
page.css({
pointerEvents: "none"
});
return setTimeout(close, 500);
}
}
});
};
})();
pages/learnList/settings/description/page/_topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: T("title"),
back: function(){
return inc("close/close")(page);
}
});
};
})();
pages/learnList/settings/description/page/button/_t.ls
(function(){
return {
save: {
de: "Speichern",
en: "Save",
fr: "Enregistrer",
es: "Guardar",
pt: "Salvar"
}
};
})();
pages/learnList/settings/description/page/button/button.ls
(function(){
return function(page){
return Button(T("save")).css({
margin: "1em"
}).tap(page.submit);
};
})();
pages/learnList/settings/description/page/counter/_t.ls
(function(){
return {
editableLength: {
de: "$1 von 300 Zeichen",
en: "$1 of 300 characters",
fr: "(($1 caractère | $1 caractère | $1 caractères)) sur 300",
es: "(($1 carácter | $1 caracteres)) de 300",
pt: "$1 de 300 caracteres"
}
};
})();
pages/learnList/settings/description/page/counter/counter.ls
(function(){
return function(page){
var input, refresh, div;
input = page.input;
refresh = function(){
var v, l;
v = input.getValue();
l = input.getValue().length;
div.html(T("editableLength", l));
if (l > 300) {
return input.setValue(v.substr(0, 299));
}
};
div = Div({
width: "30em",
maxWidth: "95%",
textAlign: "right",
margin: "0 auto",
color: Color.grey[400]
});
div.refresh = refresh;
refresh();
return div;
};
})();
pages/learnList/settings/description/page/input/input.ls
(function(){
return function(p){
var input;
return input = inc("/../app01/lib/gui/inputEditable/input")({
value: p.value,
onChange: p.onChange,
multiline: true,
lineHeight: "1.5em",
linePadding: "0 0.3em",
maxLength: 300
}).css({
minHeight: "10em",
width: "30em",
maxWidth: "95%",
margin: "0 auto"
});
};
})();
pages/learnList/settings/description/page/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var description, counter, button;
description = page.learnListDescription.description;
page.submit = function(){
page.input.disable();
button.css({
pointerEvents: "none"
});
return inc("submit/submit")(page, button);
};
return page.html(page.input = inc("input/input")({
value: description,
onChange: function(){
return typeof counter != 'undefined' && counter !== null ? counter.refresh() : void 8;
}
}), counter = inc("counter/counter")(page), button = inc("button/button")(page));
}
};
};
})();
pages/learnList/settings/description/page/submit/submit.ls
(function(){
return function(page, button){
var input, description, onCompleted, onFail;
input = page.input;
description = input.getValue();
onCompleted = function(){
return startPage({
history: -1,
animation: "slideRight"
});
};
onFail = function(){
input.enable();
return button.css({
pointerEvents: "auto"
});
};
button.css({
pointerEvents: "none"
});
if (page.learnListDescription.description === description) {
onCompleted();
return;
}
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/updateDescription/update"),
params: {
listCode: page.listCode,
description: description
},
requiredVisibleDiv: page,
onError: function(){
onFail();
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
onFail();
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(){
return log.sync(function(){
return onCompleted();
});
}
});
};
})();
pages/learnList/settings/description/row.ls
(function(){
return function(page){
return inc("../_row/row")({
label: T("description"),
arrow: true,
value: page.learnListDescription.description,
valueCustomCss: {
display: "block",
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
maxWidth: "18em"
}
}).tap(function(){
return startPage({
path: path("page/page"),
animation: "slideLeft",
params: {
listCode: page.listCode
}
});
});
};
})();
pages/learnList/settings/listCode/listCode.ls
(function(){
return function(page){
if (!engine.isDebug) {
return;
}
return Div({
display: "flex",
fontSize: "0.9em",
color: Color.grey[500],
paddingTop: "1em"
}).append(Div({
paddingRight: "0.3em"
}).html("List Code: "), Div({
display: "inline",
userSelect: "text",
paddingRight: "0.3em"
}).html(page.listCode), SvgIcon({
svg: path("/../app01/lib/svg/shape/debug.svg")
}));
};
})();
pages/learnList/settings/name/page/_t.ls
(function(){
return {
title: {
de: "Listenname ändern",
en: "Change the name of the list",
fr: "Changer le nom de la liste",
es: "Cambiar el nombre de la lista",
pt: "Modificar o nome da lista"
},
listName: {
de: "Name",
en: "Name",
fr: "Nom",
es: "Nombre",
pt: "Nome"
},
errorOops: {
de: "Ups, etwas ist schief gegangen.",
en: "Oops, something went wrong.",
fr: "Oups… une erreur s'est produite.",
es: "¡Ups! Ocurrió un error.",
pt: "Ops! OCorreu um erro."
},
errorNameEmpty: {
de: "Der Name darf nicht leer sein.",
en: "The name cannot be left blank.",
fr: "Le nom ne peut pas rester vide.",
es: "El nombre no puede quedar vacío.",
pt: "O nome não pode ficar em branco."
},
errorNameChanged: {
de: "Der Name hat sich nicht geändert.",
en: "The name has not been changed.",
fr: "Le nom n'a pas été changé.",
es: "No se cambió el nombre.",
pt: "O nome não foi modificado."
},
change: {
de: "Ändern",
en: "Change",
fr: "Changer",
es: "Cambiar",
pt: "Modificar"
}
};
})();
pages/learnList/settings/name/page/_topbar/topbar.ls
(function(){
return function(){
return inc("/../app01/addons/topbar2/topbar")({
back: true,
title: T("title")
});
};
})();
pages/learnList/settings/name/page/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var name, submit, form;
name = page.learnListDescription.name;
submit = function(){
var v;
v = form.input.getValue();
if (v.length === 0) {
return form.error.html(T("errorNameEmpty"));
} else if (v === name) {
return form.error.html(T("errorNameChanged"));
} else {
return inc("submit/submit")(page, form);
}
};
return page.append(form = inc("/../app01/lib/gui/inputForm/inputForm")({
label: T("listName"),
submitLabel: T("change"),
submit: submit,
value: name,
native: true,
forceShowButtons: true,
cancel: false,
autocapitalize: true
}));
}
};
};
})();
pages/learnList/settings/name/page/submit/submit.ls
(function(){
return function(page, form){
var name, onError, onOffline, onCompleted;
name = form.input.getValue();
form.showSpinner();
onError = function(error){
form.hideSpinner();
return form.error.html(error.message || T("errorOops"));
};
onOffline = function(){
form.input.start();
form.hideSpinner();
return inc("/../app01/lib/offline/offlinePopup/popup")();
};
onCompleted = function(result){
if (result.status !== "ok") {
return onError(result);
} else {
return log.sync(function(){
return startPage({
history: -1,
animation: "slideRight"
});
});
}
};
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/updateName/update"),
params: {
listCode: page.listCode,
name: name
},
requiredVisibleDiv: form,
onError: onError,
onOffline: onOffline,
onCompleted: onCompleted
});
};
})();
pages/learnList/settings/name/row.ls
(function(){
return function(page){
return inc("../_row/row")({
label: T("name"),
value: page.learnListDescription.name,
arrow: true
}).tap(function(){
return startPage({
path: path("page/page"),
animation: "slideLeft",
params: {
listCode: page.listCode
}
});
});
};
})();
pages/learnList/settings/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.context = page.params.context;
page.userDescription = inc("/../app01/data/user/calcUserDescription/calc")();
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
return page.html(inc("name/row")(page), inc("type/row")(page), inc("created/row")(page), inc("description/row")(page), inc("coverImageId/row")(page), inc("visibility/row")(page), inc("delete/row")(page), inc("listCode/listCode")(page));
}
};
};
})();
pages/learnList/settings/type/row.ls
(function(){
return function(page){
var ld, listTypes, matchingTypes, matchingType;
ld = page.learnListDescription;
listTypes = inc("/pages/_shared/listTypes/types")();
matchingTypes = _.filter(listTypes, {
type: ld.type
});
matchingType = matchingTypes.length === 1
? matchingTypes[0]
: _.find(matchingTypes, {
l1: engine.guiLanguage
}) || _.find(matchingTypes, {
l1: "de"
});
return inc("../_row/row")({
label: T("type"),
value: matchingType.name
});
};
})();
pages/learnList/settings/visibility/_t.ls
(function(){
return {
totalSchools: {
de: "((nur mich | 1 Schule | $1 Schulen))",
en: "((just me | 1 school | $1 schools))",
fr: "((moi uniquement | 1 école | $1 écoles))",
es: "((Sólo para mí | 1 escuela | $1 escuelas))",
pt: "((Somente para mim | 1 escola | $1 escolas))"
},
all: {
de: "alle",
en: "all",
fr: "tous",
es: "todos",
pt: "todos"
}
};
})();
pages/learnList/settings/visibility/page/_topbar/_t.ls
(function(){
return {
visibility: {
de: "Sichtbarkeit",
en: "Visibility",
fr: "Visibilité",
es: "Visibilidad",
pt: "Visibilidade"
},
backSave: {
de: "Zurück/speichern",
en: "Back/save",
fr: "Retour/Enregistrer",
es: "Volver/guardar",
pt: "Voltar/salvar"
},
confirmSave: {
de: "Möchtest du deine Änderungen speichern?",
en: "Would you like to save your changes?",
fr: "Veux-tu enregistrer tes modifications ?",
es: "¿Quieres guardar tus cambios?",
pt: "Você gostaria de salvar suas alterações?"
},
saveButton: {
de: "Speichern",
en: "Save",
fr: "Enregistrer",
es: "Guardar",
pt: "Salvar"
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
}
};
})();
pages/learnList/settings/visibility/page/_topbar/back/back.ls
(function(){
return function(page){
var newVisibility, ref$;
newVisibility = inc("../calcVisibility/calc")(page);
if (newVisibility.join("") === (typeof (ref$ = page.learnListDescription.visibility).join == 'function' ? ref$.join("") : void 8)) {
startPage({
history: -1,
animation: "slideRight"
});
return;
}
return inc("/../app01/lib/gui/confirmPopup/popup")({
label: T("confirmSave"),
yesLabel: T("saveButton"),
noLabel: T("cancelButton"),
done: function(confirm){
if (confirm) {
return inc("submit/submit")(page, newVisibility);
} else {
return startPage({
history: -1,
animation: "slideRight"
});
}
}
});
};
})();
pages/learnList/settings/visibility/page/_topbar/back/submit/submit.ls
(function(){
return function(page, newVisibility){
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/updateVisibility/update"),
params: {
listCode: page.listCode,
visibility: newVisibility
},
onCompleted: function(result){
return log.sync(function(){
return startPage({
history: -1,
animation: "slideRight"
});
});
},
onError: function(){
return inc("/../app01/lib/gui/errorPopup/popup")();
},
onOffline: function(){
return inc("/../app01/lib/offline/offlinePopup/popup")();
}
});
};
})();
pages/learnList/settings/visibility/page/_topbar/calcVisibility/calc.ls
(function(){
return function(page){
var selectedSchoolDatas, schoolCodes, allData;
selectedSchoolDatas = _.filter(page.listData, {
type: "school",
selected: true
});
schoolCodes = _.map(selectedSchoolDatas, "schoolDescription.schoolCode");
schoolCodes = _.sortBy(schoolCodes);
if (schoolCodes.length > 0) {
return schoolCodes;
}
allData = _.find(page.listData, {
type: "all"
});
if (allData.selected) {
return ["all"];
}
return [];
};
})();
pages/learnList/settings/visibility/page/_topbar/topbar.ls
(function(){
return function(page){
var div, backLabel;
div = inc("/../app01/addons/topbar2/topbar")({
title: T("visibility"),
back: function(){
return inc("back/back")(page);
},
backLabel: backLabel = Span().html(T("backButton"))
});
page.updateBackLabel = function(){
var newVisibility, changedVisiblity, ref$;
newVisibility = inc("calcVisibility/calc")(page);
changedVisiblity = newVisibility.join("") !== (typeof (ref$ = page.learnListDescription.visibility).join == 'function' ? ref$.join("") : void 8);
return backLabel.html(changedVisiblity
? T("backSave")
: T("backButton"));
};
return div;
};
})();
pages/learnList/settings/visibility/page/list/calcListData/calc.ls
(function(){
return function(page){
var schoolDescriptions, visibility, items, sd;
schoolDescriptions = inc("/../app01/data/school/calcSchoolDescriptions/calc")();
visibility = page.learnListDescription.visibility;
return items = _.concat({
type: "header"
}, {
type: "all",
selected: _.includes(visibility, "all")
}, (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = schoolDescriptions).length; i$ < len$; ++i$) {
sd = ref$[i$];
results$.push({
type: "school",
schoolDescription: sd,
selected: _.includes(visibility, sd.schoolCode)
});
}
return results$;
}()), {
type: "footer"
});
};
})();
pages/learnList/settings/visibility/page/list/list.ls
(function(){
return function(page){
page.listData = inc("calcListData/calc")(page);
return page.list = ListDiv({
data: page.listData,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
}
}).css({
height: "var(--centerHeight)"
});
};
})();
pages/learnList/settings/visibility/page/list/row/allRow/check/check.ls
(function(){
return function(page, rowData){
var div;
div = Div({
flex: "0 0 auto",
width: "1.6em",
display: "flex",
padding: "0em 1em 0 0.7em",
alignSelf: "stretch"
}).html(SvgIcon({
color: Color.grey[600],
svg: rowData.selected
? path("/../app01/lib/svg/icon/check-on.svg")
: path("/../app01/lib/svg/icon/check-off.svg")
})).addClass("refresh");
div.refresh = function(){
return div.replaceWith(inc(THISFILE)(page, rowData));
};
return div;
};
})();
pages/learnList/settings/visibility/page/list/row/allRow/name/_t.ls
(function(){
return {
allUsers: {
de: "Alle ANTON-Nutzer/innen",
en: "For all ANTON users",
fr: "Pour tou·tes les utilisateur·rices d'ANTON",
es: "Para todos los/as usuarios/as de ANTON",
pt: "Para todos os usuários de ANTON"
}
};
})();
pages/learnList/settings/visibility/page/list/row/allRow/name/name.ls
(function(){
return function(){
return Div({
flex: "1 1 auto",
textAlign: "left",
padding: "0.2em 0"
}).html(T("allUsers"));
};
})();
pages/learnList/settings/visibility/page/list/row/allRow/row.ls
(function(){
return function(page, rowData){
var tap, div, b;
tap = function(){
var i$, ref$, len$, d, el;
rowData.selected = !rowData.selected;
if (rowData.selected) {
for (i$ = 0, len$ = (ref$ = page.listData).length; i$ < len$; ++i$) {
d = ref$[i$];
if (d.selected != null && d !== rowData) {
d.selected = false;
}
}
}
for (i$ = 0, len$ = (ref$ = page.list.findAll(".refresh")).length; i$ < len$; ++i$) {
el = ref$[i$];
el.refresh();
}
return page.updateBackLabel();
};
return div = Div().html(Div({
display: "flex",
padding: "0.5em 0",
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
maxWidth: "95%",
width: "35em",
margin: "-2px auto 0",
minHeight: "4em",
background: "white"
}).html(inc("check/check")(page, rowData), inc("name/name")(page)).tap(tap));
};
})();
pages/learnList/settings/visibility/page/list/row/footerRow/row.ls
(function(){
return function(page){
return Div().html(Div({
height: "2em"
}));
};
})();
pages/learnList/settings/visibility/page/list/row/headerRow/_t.ls
(function(){
return {
visibilityWhoCanFind: {
de: "Wer soll diese Liste im Reiter Alle finden können?",
en: "Who should be able to find this list in the All tab?",
fr: "Qui devrait pouvoir trouver cette liste dans l'onglet Autres ?",
es: "¿A quién debe mostrársele esta lista en la sección Otras?",
pt: "Quem deve encontrar esta lista na guia Outras?"
}
};
})();
pages/learnList/settings/visibility/page/list/row/headerRow/row.ls
(function(){
return function(page){
return Div().html(Div({
padding: "1em 0",
fontSize: "0.9em",
color: Color.grey[600],
maxWidth: "95%",
width: "35em",
margin: "2em auto 0.5em"
}).html(T("visibilityWhoCanFind")));
};
})();
pages/learnList/settings/visibility/page/list/row/row.ls
(function(){
return function(page){
return function(rowData){
if (rowData.type === "header") {
return inc("headerRow/row")(page);
} else if (rowData.type === "footer") {
return inc("footerRow/row")(page);
} else if (rowData.type === "all") {
return inc("allRow/row")(page, rowData);
} else {
return inc("schoolRow/row")(page, rowData);
}
};
};
})();
pages/learnList/settings/visibility/page/list/row/schoolRow/check/check.ls
(function(){
return function(page, rowData){
var div;
div = Div({
flex: "0 0 auto",
width: "1.6em",
display: "flex",
padding: "0em 1em 0 0.7em",
alignSelf: "stretch"
}).append(SvgIcon({
svg: rowData.selected
? path("/../app01/lib/svg/icon/check-on.svg")
: path("/../app01/lib/svg/icon/check-off.svg"),
color: Color.grey[600]
})).addClass("refresh");
div.refresh = function(){
return div.replaceWith(inc(THISFILE)(page, rowData));
};
return div;
};
})();
pages/learnList/settings/visibility/page/list/row/schoolRow/image/image.ls
(function(){
return function(d){
return Div().html(inc("/../app01/pages/school/_shared/schoolIcon/icon")({
schoolDescription: d
}).css({
margin: "0 0.7em"
}));
};
})();
pages/learnList/settings/visibility/page/list/row/schoolRow/name/name.ls
(function(){
return function(sd){
return Div({
flex: "1 1 auto",
textAlign: "left",
padding: "0.2em 0",
wordWrap: "break-word"
}).secureHtml(sd.name);
};
})();
pages/learnList/settings/visibility/page/list/row/schoolRow/row.ls
(function(){
return function(page, rowData){
var schoolDescription, tap, b;
schoolDescription = rowData.schoolDescription;
tap = function(){
var i$, ref$, len$, el;
rowData.selected = !rowData.selected;
_.find(page.listData, {
type: "all"
}).selected = false;
for (i$ = 0, len$ = (ref$ = page.list.findAll(".refresh")).length; i$ < len$; ++i$) {
el = ref$[i$];
el.refresh();
}
return page.updateBackLabel();
};
return Div().html(Div({
display: "flex",
padding: "0.5em 0",
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
maxWidth: "95%",
width: "35em",
margin: "-2px auto 0",
minHeight: "4em",
background: "white"
}).html(inc("check/check")(page, rowData), inc("name/name")(schoolDescription, page), inc("image/image")(schoolDescription)).tap(tap));
};
})();
pages/learnList/settings/visibility/page/page.ls
(function(){
return function(page){
page.listCode = page.params.listCode;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
return {
navCategory: inc("/_shared/calcNavCategory/calc")(),
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
return page.html(inc("list/list")(page));
}
};
};
})();
pages/learnList/settings/visibility/popupCantModify/_t.ls
(function(){
return {
popupCantModify: {
de: "Um eine Liste für alle ANTON-Nutzer/innen oder eine gesamte Schule sichtbar zu machen, musst du Schullizenz-Lehrkraft sein.",
en_gb: "You are unable to make your list available for everyone. For access to this feature, you need to be a School Licence teacher.",
en: "You are unable to make your list visible to all ANTON users or an entire school if you are not a School License teacher.",
fr: "Pour que ta liste soit visible pour tous les utilisateur·rices d'ANTON ou pour toute une école, tu dois être professeur·e titulaire d'une licence scolaire.",
es: "Para publicar una lista con todos/as necesitas ser parte de una Licencia Escolar.",
pt: "Você não pode tornar sua lista visível para outras pessoas. Para obter esta função, você deve ter uma conta de professor com uma Licença Escolar. "
},
teacherAddon: {
de: "Du kannst deine Liste trotzdem mit deinen Schüler/innen teilen, indem du sie in deiner Gruppe pinnst.",
en_gb: "However, you can still pin your list for the pupils in your groups.",
en: "However, you can still share your list with your students by pinning it in your group.",
fr: "Pour rendre cette liste accessible à tes élèves, tu peux tout simplement l'épingler dans tes groupes.",
es: "Para que tus estudiantes puedan trabajar con tus listas, puedes formar un grupo y asignárselas.",
pt: "Mesmo assim, você pode marcar a sua lista para seus alunos em seus grupos."
}
};
})();
pages/learnList/settings/visibility/popupCantModify/popup.ls
(function(){
return function(){
var label;
label = T("popupCantModify");
if (inc("/../app01/data/user/isTeacher/get")()) {
label += " " + T("teacherAddon");
}
return inc("/../app01/lib/gui/infoPopup/popup")({
label: label
});
};
})();
pages/learnList/settings/visibility/popupNoItems/_t.ls
(function(){
return {
popupNoItems: {
de: "Bitte füge zunächst Einträge deiner Liste hinzu, bevor du hier die Sichtbarkeit veränderst.",
en: "Please add entries to your list before you change the visibility of the list.",
fr: "Tu dois créer au moins une première entrée dans ta liste avant de pouvoir changer la visibilité.",
es: "Por favor, agrega entradas a tu lista antes de cambiar la visibilidad.",
pt: "Por favor, adicione entradas à sua lista primeiro,antes de alterar a visibilidade aqui."
}
};
})();
pages/learnList/settings/visibility/popupNoItems/popup.ls
(function(){
return function(){
return inc("/../app01/lib/gui/infoPopup/popup")({
label: T("popupNoItems")
});
};
})();
pages/learnList/settings/visibility/row.ls
(function(){
return function(page){
var s, isAll, totalSchools, canModify, tap;
s = page.learnListDescription.visibility;
isAll = s[0] === "all";
totalSchools = isAll
? 0
: s.length;
canModify = page.userDescription.isDirTeacher;
tap = function(){
if (!canModify) {
return inc("popupCantModify/popup")();
} else if (page.learnListDescription.totalItems === 0) {
return inc("popupNoItems/popup")();
} else {
return startPage({
path: path("page/page"),
animation: "slideLeft",
params: {
listCode: page.listCode
}
});
}
};
return inc("../_row/row")({
label: T("visibility"),
arrow: canModify,
value: inc("value/value")(canModify, isAll, totalSchools)
}).tap(tap);
};
})();
pages/learnList/settings/visibility/value/value.ls
(function(){
return function(canModify, isAll, totalSchools){
return Div({
display: "flex"
}).html(Div({
color: Color.grey[700]
}).html(isAll
? T("all")
: T("totalSchools", totalSchools)), !canModify ? SvgIcon({
svg: path("/../app01/lib/svg/shape/help.svg"),
color: Color.grey[500]
}).css({
marginLeft: "0.4em"
}) : void 8);
};
})();
pages/learnList/start.ls
(function(){
return function(p){
var params, that;
params = {
listCode: p.listCode,
context: p.context
};
if (that = p.groupSinglePublicId) {
params.groupSinglePublicId = that;
}
if (that = p.groupCode) {
params.groupCode = that;
}
return startPage({
path: path("learn/page"),
animation: "slideLeft",
params: params
});
};
})();
pages/learnLists/_topbar/_t.ls
(function(){
return {
topbarTitle: {
de: "Lernlisten",
en: "Study lists",
fr: "Listes",
es: "Listas",
pt: "Listas de estudo"
}
};
})();
pages/learnLists/_topbar/params/params.ls
(function(){
return function(page, isMyLists){
var params;
if (deviceLog['var']("enableLearnBetaTab")) {
return inc("paramsLearnTabBeta")(page, isMyLists);
}
return params = {
title: T("topbarTitle"),
tabMenuItems: function(){
return inc("../tabMenuItems/tabMenuItems")(page);
},
topRightCustom: isMyLists ? function(){
return inc("../topbarRightCustom/topbarRightCustom")(page);
} : void 8
};
};
})();
pages/learnLists/_topbar/params/paramsLearnTabBeta.ls
(function(){
return function(page, isMyLists){
var params;
params = {
title: isMyLists ? "Meine Lernlisten" : "Geteilte Lernlisten von anderen Nutzern",
topRightCustom: isMyLists ? function(){
return inc("../topbarRightCustom/topbarRightCustom")(page);
} : void 8
};
params.back = true;
params.backLabel = Svg({
svg: path("/../app01/lib/svg/shape/home.svg"),
color: Color.grey[650],
size: "0.9em"
}).css({
padding: "0.6em 0 0.4em"
});
return params;
};
})();
pages/learnLists/_topbar/tabMenuItems/_t.ls
(function(){
return {
my: {
de: "Meine Listen",
en: "My lists",
fr: "Mes listes",
es: "Mis listas",
pt: "Minhas listas"
},
all: {
de: "Alle",
en: "All",
fr: "Autres",
es: "Otras",
pt: "Outras"
}
};
})();
pages/learnLists/_topbar/tabMenuItems/tabMenuItems.ls
(function(){
return function(page){
var p, params, items;
p = app.currentPagePath;
params = _.omit(page.params, ["history", "search"]);
return items = [
{
label: T("my"),
selected: _.includes(p, "/myLists"),
click: function(){
return startPage({
path: path("/pages/learnLists/myLists/page"),
history: 0,
params: params
});
}
}, {
label: T("all"),
selected: _.includes(p, "/allLists"),
click: function(){
return startPage({
path: path("/pages/learnLists/allLists/overview/page"),
history: 0,
params: params
});
}
}
];
};
})();
pages/learnLists/_topbar/topSearch/iconHidden/icon.ls
(function(){
return function(o){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/search.svg"),
color: Color.blue[600],
size: "0.8em"
}).css({
position: "absolute",
top: "-1.8em",
padding: "0.5em"
}).tap(function(){
o.searchMode = "expanded";
this.parent().update();
return o.toggleSearchInput();
});
};
})();
pages/learnLists/_topbar/topSearch/searchBar/_t.ls
(function(){
return {
abort: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
}
};
})();
pages/learnLists/_topbar/topSearch/searchBar/bar.ls
(function(){
return function(o){
var isActive, onSubmit, onSearch, div, icon, input, spacer;
isActive = false;
o.toggleSearchInput = function(){
if (isActive) {
isActive = false;
spacer.show();
input.setValue("");
input.hide();
input.stop();
div.findFirst(".abort").css({
height: 0,
visibility: "hidden"
});
o.onSearch();
o.searchMode = "hidden";
return div.parent().update();
} else {
isActive = true;
spacer.hide();
input.show();
input.start();
return div.findFirst(".abort").css({
height: "auto",
visibility: "visible"
});
}
};
o.setSearchValue = function(value, stopInput){
input.setValue(value);
if (!isActive) {
o.toggleSearchInput();
}
if (stopInput) {
return input.stop();
}
};
onSubmit = function(autoSubmit){
var value;
if (!autoSubmit) {
input.stop();
}
value = input.getValue();
return o.onSearch(value, autoSubmit);
};
onSearch = function(){
var value;
value = input.getValue();
return o.onSearch(value);
};
return div = Div({
flex: "1 1 auto",
display: "flex",
color: Color.grey[800],
padding: "0.2em",
justifyContent: "flex-start"
}).addClass("searchTopbar").html(icon = inc("iconWithAbort/iconWithAbort")(o), input = inc("input/input")(o, onSubmit, onSearch), spacer = inc("spacer/spacer")(o)).addClass("keyManager-esc").bind("keyManager", function(e){
if (isActive) {
return o.toggleSearchInput();
}
});
};
})();
pages/learnLists/_topbar/topSearch/searchBar/iconWithAbort/iconWithAbort.ls
(function(){
return function(o){
return Div({
flex: "0 0 auto",
display: "flex",
flexDirection: "column",
margin: "0.15em 0.1em 0.1em -0.3em",
alignSelf: "stretch",
minWidth: "2em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/shape/search.svg"),
color: Color.blue[600]
}), Div({
fontSize: "0.6em",
color: Color.blue[700],
overflow: "hidden",
height: 0
}).addClass("abort").html(T("abort"))).tap({
up: o.toggleSearchInput,
tapZone: "1em",
animation: "none"
});
};
})();
pages/learnLists/_topbar/topSearch/searchBar/input/input.ls
(function(){
return function(o, onSubmit, onSearch){
return inc("/../app01/lib/gui/inputEditable/input")({
showResetIcon: true,
showSearchIcon: false,
onSubmit: onSubmit,
onReset: onSearch,
autoSubmitDelay: 1000,
maxLength: 50
}).css({
flex: "1 1 auto",
width: "100%",
marginTop: "0.1em",
textAlign: "left",
backgroundColor: "white",
border: "1px solid " + Color.grey[200],
overflow: "hidden"
}).hide();
};
})();
pages/learnLists/_topbar/topSearch/searchBar/spacer/spacer.ls
(function(){
return function(o){
var ref$;
return Div().css({
flex: "1 1 auto",
height: "2em",
textAlign: "left",
lineHeight: "2em",
color: Color.grey[400],
paddingRight: "0.3em",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
fontSize: "0.9em"
}).tap({
up: o.toggleSearchInput,
animation: "none"
}).html((ref$ = o.searchPlaceholder) != null ? ref$ : "");
};
})();
pages/learnLists/_topbar/topSearch/topSearch.ls
(function(){
return function(o){
var div;
div = Div(o.searchMode === "expanded" ? {
flex: "1 1 auto",
display: "flex",
color: Color.grey[800],
padding: "0.2em",
justifyContent: "flex-start",
borderTop: "1px solid " + Color.grey[200]
} : void 8).html(o.searchMode === "hidden"
? inc("iconHidden/icon")(o)
: o.searchMode === "expanded" ? inc("searchBar/bar")(o) : void 8);
o.topbar.setSearchValue = function(query){
o.searchMode = "expanded";
div.update();
return o.setSearchValue(query);
};
div.update = function(){
return div.replaceWith(inc(THISFILE)(o));
};
return div;
};
})();
pages/learnLists/_topbar/topbar.ls
(function(){
return function(page){
var isMyLists, topbar;
isMyLists = _.includes(app.currentPagePath, "myLists");
topbar = inc("/../app01/addons/topbar2/topbar")(inc("params/params")(page, isMyLists));
return topbar.append(!deviceLog['var']("enableLearnBetaTab") && (!isMyLists || (isMyLists && page.data.length > 0)) ? inc("topSearch/topSearch")({
searchMode: "hidden",
topbar: topbar,
onSearch: function(query){
page.params.search = query;
return page.loadData();
}
}) : void 8);
};
})();
pages/learnLists/_topbar/topbarRightCustom/_t.ls
(function(){
return {
'new': {
de: "Neu",
en: "New",
fr: "Nouvelle",
es: "Nueva",
pt: "Novo"
}
};
})();
pages/learnLists/_topbar/topbarRightCustom/menu/_t.ls
(function(){
return {
newListScan: {
de: "Neue Liste scannen",
en: "Scan new list",
fr: "Scanner une nouvelle liste",
es: "Escanear lista nueva",
pt: "Escanear nova lista"
},
newListEditor: {
de: "Neue Liste schreiben",
en: "Write new list",
fr: "Écrire une nouvelle liste",
es: "Escribir lista nueva",
pt: "Escrever nova lista"
}
};
})();
pages/learnLists/_topbar/topbarRightCustom/menu/items/items.ls
(function(){
return function(){
var items;
return items = [inc("newListEditor/new")(), inc("newListScan/new")()];
};
})();
pages/learnLists/_topbar/topbarRightCustom/menu/items/newListEditor/new.ls
(function(){
return function(){
return {
label: T("newListEditor"),
icon: path("/../app01/lib/svg/shape/pen.svg"),
click: function(){
return inc("/pages/createNewList/start")("newListEditor", "topRightMenu");
}
};
};
})();
pages/learnLists/_topbar/topbarRightCustom/menu/items/newListScan/new.ls
(function(){
return function(){
return {
label: T("newListScan"),
icon: path("/../app01/lib/svg/shape/camera.svg"),
click: function(){
return inc("/pages/createNewList/start")("newListScan", "topRightMenu");
}
};
};
})();
pages/learnLists/_topbar/topbarRightCustom/menu/menu.ls
(function(){
return function(page, div){
return OverlayMenu({
referenceDiv: div,
items: inc("items/items")(),
direction: "down left",
adjustXY: "-5 -3"
});
};
})();
pages/learnLists/_topbar/topbarRightCustom/topbarRightCustom.ls
(function(){
return function(page){
var tap;
tap = function(){
return inc("menu/menu")(page, this);
};
return Div({
fontSize: "0.9em",
color: Color.blue[600],
padding: "0.1em 0.7em 0.1em 0"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/shape/plus.svg"),
size: "0.8em",
color: Color.blue[600]
}).css({
marginRight: "0.2em"
}), T("new")).tap(tap);
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/filter/check/check.ls
(function(){
return function(page, enableFilter){
return SvgIcon({
svg: enableFilter
? path("/../app01/lib/svg/icon/check-on.svg")
: path("/../app01/lib/svg/icon/check-off.svg"),
color: Color.grey[600]
});
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/filter/filter.ls
(function(){
return function(page){
var enableFilter, tap;
enableFilter = inc("/../app01/lib/util/cache/get/get")("enableListAllMySchoolFilter") || false;
tap = function(){
inc("/../app01/lib/util/cache/set/set")("enableListAllMySchoolFilter", !enableFilter);
return startPage({
history: 0
});
};
return Div({
display: "flex",
padding: "0.3em",
fontSize: "0.85em"
}).html(inc("check/check")(page, enableFilter), inc("text/text")(page)).tap(tap);
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/filter/text/_t.ls
(function(){
return {
onlyMySchool: {
de: "nur meine Schule ($1)",
en: "only my school ($1)",
fr: "Seulement mon école ($1)",
es: "sólo mi escuela ($1)",
pt: "só minha escola ($1)"
}
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/filter/text/text.ls
(function(){
return function(page){
return Div({
color: Color.grey[600],
paddingLeft: "0.3em"
}).html(T("onlyMySchool", page.totalInUserSchools));
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/row.ls
(function(){
return function(page){
return Div({
display: "flex",
justifyContent: "space-between",
padding: "2em 0 0.3em",
borderBottom: "1px solid " + Color.grey[200],
background: "white"
}).html(inc("totalLists/total")(page), Div({
flex: "1 0 auto"
}), log.findLast("isSchoolMember") ? inc("filter/filter")(page) : void 8);
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/totalLists/_t.ls
(function(){
return {
total: {
de: "(($1 Treffer | $1 Treffer))",
en: "(($1 result | $1 results))",
fr: "(($1 résultat | $1 résultats))",
es: "(($1 resultado | $1 resultados))",
pt: "(($1 resultado | $1 resultados))"
}
};
})();
pages/learnLists/allLists/_shared/rowAllFilterMySchools/totalLists/total.ls
(function(){
return function(page){
var total, ref$;
total = (ref$ = page.originalData) != null ? ref$.length : void 8;
if (!page.params.search || _.includes(app.currentPagePath, "overview/page") || total === 0) {
return;
}
return Div({
display: "flex",
padding: "0.3em",
fontSize: "0.85em",
color: Color.grey[600]
}).html(T("total", total));
};
})();
pages/learnLists/allLists/list/_t.ls
(function(){
return {
noListFound: {
de: "Keine Liste gefunden",
en: "No lists found",
fr: "Aucune liste n'a été trouvée",
es: "No se encontró ninguna lista",
pt: "Nenhuma lista encontrada"
}
};
})();
pages/learnLists/allLists/list/_topbar/_t.ls
(function(){
return {
allLists: {
de: "Alle Lernlisten",
en_gb: "All study lists",
en: "All study lists",
fr: "Toutes les listes",
es: "Todas las listas",
pt: "Todas as listas"
}
};
})();
pages/learnLists/allLists/list/_topbar/topbar.ls
(function(){
return function(page){
var listTypes, allowedTypes, title;
listTypes = inc("/pages/_shared/listTypes/types")();
allowedTypes = _.filter(listTypes, {
l1: engine.guiLanguage
});
title = _.find(allowedTypes, {
type: page.params.type
}).name;
return inc("/../app01/addons/topbar2/topbar")({
title: title,
back: true,
backLabel: T("allLists"),
onSearch: function(query){
var h, ref$;
page.params.search = query;
h = app.pageHistory;
if ((ref$ = h[h.length - 2]) != null) {
ref$.params.search = query;
}
return page.loadData();
}
});
};
})();
pages/learnLists/allLists/list/list/list.ls
(function(){
var lastListPosition;
lastListPosition = null;
return function(page){
var data;
data = _.concat({
rowType: "header"
}, page.data, {
rowType: "footer"
});
return page.list = ListDiv({
data: data,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: page.params.history <= 0 ? lastListPosition : void 8
}).css({
height: "var(--centerHeight)"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
});
};
})();
pages/learnLists/allLists/list/list/row/footer/row.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/learnLists/allLists/list/list/row/noListFound/row.ls
(function(){
return function(){
return Div({
padding: "1.5em 0",
fontSize: "0.9em",
color: Color.grey[600]
}).html(T("noListFound"));
};
})();
pages/learnLists/allLists/list/list/row/row.ls
(function(){
return function(page){
return function(data){
var t;
t = data.rowType;
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(t === "header"
? inc("../../../_shared/rowAllFilterMySchools/row")(page)
: t === "footer"
? inc("footer/row")()
: t === "noListFound"
? inc("noListFound/row")()
: inc("/pages/_shared/learnListRow/row")({
context: "allLists",
learnListDescription: data
})));
};
};
})();
pages/learnLists/allLists/list/loadData/calcData/calc.ls
(function(){
return function(page, learnListDescriptions){
var data, res$, i$, len$, ld;
res$ = [];
for (i$ = 0, len$ = learnListDescriptions.length; i$ < len$; ++i$) {
ld = learnListDescriptions[i$];
res$.push(inc("/data/calcLearnListDescription/calc")(ld));
}
data = res$;
page.originalData = data;
if (data.length === 0) {
data = [{
rowType: "noListFound"
}];
}
return data;
};
})();
pages/learnLists/allLists/list/loadData/load.ls
(function(){
return function(page, onDone){
var spinner, type, filterMySchoolsOnly, ref$;
page.html(spinner = inc("/../app01/lib/gui/spinner/spinner")());
type = page.params.type;
filterMySchoolsOnly = (ref$ = inc("/../app01/lib/util/cache/get/get")("enableListAllMySchoolFilter")) != null ? ref$ : false;
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/allLists/list/list"),
params: {
type: type,
filterMySchoolsOnly: filterMySchoolsOnly,
search: page.params.search
},
onError: function(error){
spinner.remove();
page.html(T("errorOops"));
return debug(error);
},
onOffline: function(){
spinner.remove();
return inc("/../app01/lib/offline/offlinePage/offlinePage")(page);
},
onCompleted: function(result, samePage){
if (!samePage) {
return;
}
spinner.remove();
if (result.status === "ok") {
page.totalInUserSchools = result.totalInUserSchools;
page.data = inc("calcData/calc")(page, result.learnListDescriptions);
inc("/../app01/lib/util/cache/set/set")("allListsCache", type, {
data: page.data,
originalData: page.originalData,
totalInUserSchools: page.totalInUserSchools
});
return onDone();
} else {
page.html("errror");
return debug(result);
}
}
});
};
})();
pages/learnLists/allLists/list/page.ls
(function(){
return function(page){
var ref$;
page.context = "allLists";
(ref$ = page.params).type == null && (ref$.type = "spellDe");
return {
navCategory: inc("/_shared/calcNavCategory/calc")(),
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("../../../_shared/urlDescription/description")();
},
start: function(){
var create, s, ref$, cachedData;
page.loadData = function(){
return inc("loadData/load")(page, create);
};
create = function(){
return page.html(inc("list/list")(page));
};
if (s = page.params.search) {
if (typeof (ref$ = page.topbar).setSearchValue == 'function') {
ref$.setSearchValue(s);
}
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
}
cachedData = inc("/../app01/lib/util/cache/get/get")("allListsCache", page.params.type);
if (cachedData && page.params.history === -1 && !page.params.clearCache) {
page.data = cachedData.data;
page.originalData = cachedData.originalData;
page.totalInUserSchools = cachedData.totalInUserSchools;
return create();
} else {
return page.loadData();
}
}
};
};
})();
pages/learnLists/allLists/overview/list/list.ls
(function(){
var lastListPosition;
lastListPosition = null;
return function(page){
var data;
data = _.concat({
rowType: "header"
}, page.data, {
rowType: "footer"
});
return page.list = ListDiv({
data: data,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: page.params.history <= 0 ? lastListPosition : void 8
}).css({
height: "var(--centerHeight)"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
});
};
})();
pages/learnLists/allLists/overview/list/row/footer/row.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/learnLists/allLists/overview/list/row/row.ls
(function(){
return function(page){
return function(data){
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(data.rowType === "header"
? inc("../../../_shared/rowAllFilterMySchools/row")(page)
: data.rowType === "footer"
? inc("footer/row")()
: inc("type/row")(data, page)));
};
};
})();
pages/learnLists/allLists/overview/list/row/type/arrow/arrow.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[400]
}).css({
marginLeft: "0.3em"
});
};
})();
pages/learnLists/allLists/overview/list/row/type/label/label.ls
(function(){
return function(d){
return Div({
flex: "1 1 80%",
padding: "0.7em 0.3em",
textAlign: "left",
overflow: "hidden",
whiteSpace: "wrap"
}).html(d.label);
};
})();
pages/learnLists/allLists/overview/list/row/type/row.ls
(function(){
return function(data, page){
var tap, b;
tap = function(){
return startPage({
path: path("/pages/learnLists/allLists/list/page"),
animation: "slideLeft",
params: {
type: data.type,
search: page.params.search
}
});
};
return Div({
display: "flex",
justifyContent: "space-between",
padding: "0.5em 0em",
background: "white",
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
marginTop: "-2px"
}).html(inc("label/label")(data), inc("total/total")(data), inc("arrow/arrow")()).tap(tap);
};
})();
pages/learnLists/allLists/overview/list/row/type/total/total.ls
(function(){
return function(d){
return Div({
flex: "0 0 auto"
}).html(d.total);
};
})();
pages/learnLists/allLists/overview/loadData/calcData/calc.ls
(function(){
return function(result){
var listTypes, allowedTypes, data, type;
listTypes = inc("/pages/_shared/listTypes/types")();
allowedTypes = _.filter(listTypes, {
l1: engine.guiLanguage
});
return data = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = allowedTypes).length; i$ < len$; ++i$) {
type = ref$[i$];
results$.push({
type: type.type,
label: type.name,
total: result.totalByType[type.type] || 0
});
}
return results$;
}());
};
})();
pages/learnLists/allLists/overview/loadData/load.ls
(function(){
return function(page, onDone){
var spinner, filterMySchoolsOnly;
page.html(spinner = inc("/../app01/lib/gui/spinner/spinner")());
filterMySchoolsOnly = inc("/../app01/lib/util/cache/get/get")("enableListAllMySchoolFilter") || false;
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/allLists/overview/overview"),
params: {
filterMySchoolsOnly: filterMySchoolsOnly,
search: page.params.search,
guiLanguage: engine.guiLanguage
},
onError: function(error){
spinner.remove();
page.html(T("errorOops"));
return debug(error);
},
onOffline: function(){
spinner.remove();
return inc("/../app01/lib/offline/offlinePage/offlinePage")(page);
},
onCompleted: function(result, samePage){
if (!samePage) {
return;
}
spinner.remove();
if (result.status === "ok") {
page.totalInUserSchools = result.totalInUserSchools;
page.data = inc("calcData/calc")(result);
return onDone();
} else {
page.html("error");
return debug(result);
}
}
});
};
})();
pages/learnLists/allLists/overview/page.ls
(function(){
return function(page){
page.context = "allLists";
return {
navCategory: inc("/_shared/calcNavCategory/calc")(),
top: function(){
return inc("../../_topbar/topbar")(page);
},
urlDescription: function(){
return inc("../../../_shared/urlDescription/description")();
},
start: function(){
var create, s, ref$;
page.loadData = function(){
return inc("loadData/load")(page, create);
};
create = function(){
return page.append(inc("list/list")(page));
};
if (s = page.params.search) {
if (typeof (ref$ = page.topbar).setSearchValue == 'function') {
ref$.setSearchValue(s);
}
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
}
return page.loadData();
}
};
};
})();
pages/learnLists/myLists/_t.ls
(function(){
return {
learnListNameLabel: {
de: "Name der Liste",
en: "name",
fr: "nom",
es: "nombre",
pt: "nome"
},
updatedDescLabel: {
de: "zuletzt bearbeitet",
en: "last edited",
fr: "Modifiée en dernier",
es: "Editado por última vez",
pt: "Editado por último"
},
totalSearch: {
de: "(($1 Treffer | $1 Treffer))",
en: "(($1 result | $1 results))",
fr: "(($1 résultat | $1 résultats))",
es: "(($1 resultado | $1 resultados))",
pt: "(($1 resultado | $1 resultados))"
},
total: {
de: "(($1 Liste | $1 Listen))",
en: "(($1 list | $1 lists))",
fr: "(($1 liste | $1 listes))",
es: "(($1 lista | $1 listas))",
pt: "(($1 lista | $1 listas))"
},
type: {
de: "Listentyp",
en: "list type",
fr: "type de liste",
es: "tipo de lista",
pt: "tipo de lista"
}
};
})();
pages/learnLists/myLists/calcData/calc.ls
(function(){
return function(page){
var events, i$, len$, e;
events = _.concat(log.list({
event: "hasLearnList"
}), log.list({
event: "bookmarkLearnList"
}));
events = _.cloneDeep(events);
for (i$ = 0, len$ = events.length; i$ < len$; ++i$) {
e = events[i$];
e.description = inc("/data/calcLearnListDescription/calc")(e.listCode);
}
return events;
};
})();
pages/learnLists/myLists/calcSorting/calc.ls
(function(){
return function(){
var sorting;
sorting = inc("/../app01/lib/util/cache/get/get")("myLearnListsSorting");
sorting == null && (sorting = "updatedDesc");
return sorting;
};
})();
pages/learnLists/myLists/list/list.ls
(function(){
var lastListPosition;
lastListPosition = null;
return function(page){
page.listData = _.compact(_.concat({
rowType: "createNew"
}, {
rowType: "header"
}, page.data, {
rowType: "footer"
}));
return page.list = ListDiv({
data: page.listData,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: page.params.history <= 0 ? lastListPosition : void 8
}).css({
height: "var(--centerHeight)"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
});
};
})();
pages/learnLists/myLists/list/row/createNew/_t.ls
(function(){
return {
text: {
de: "Erstelle ganz leicht deine eigene Lernliste, z.B. für Vokabeln oder Rechtschreibung.",
en: "Easily create your own study lists, e.g. for vocabulary or spelling.",
fr: "Tu peux facilement créer une liste de mots ou de phrases pour apprendre par exemple du vocabulaire.",
es: "Crea fácilmente tus propias listas para practicar, por ejemplo, vocabulario y ortografía.",
pt: "Crie facilmente sua própria lista de estudo para praticar, por exemplo, vocabulário ou ortografia."
},
buttonWrite: {
de: "Liste schreiben",
en: "Write list",
fr: "Écrire une liste",
es: "Escribir lista",
pt: "Escrever lista"
},
buttonScan: {
de: "Liste scannen",
en: "Scan list",
fr: "Scanner une liste",
es: "Escanear lista",
pt: "Escanear lista"
}
};
})();
pages/learnLists/myLists/list/row/createNew/buttons/_button/button.ls
(function(){
return function(icon, label){
return Div({
display: "flex",
background: Color.grey[250],
padding: "0.6em",
margin: "0.5em 0 0.5em 0.5em"
}).html(icon, Div({
marginLeft: "0.3em"
}).html(label));
};
})();
pages/learnLists/myLists/list/row/createNew/buttons/buttonListEditor/button.ls
(function(){
return function(){
var tap;
tap = function(){
return inc("/pages/createNewList/start")("newListEditor", "createNewRow");
};
return inc("../_button/button")(SvgIcon({
svg: path("/../app01/lib/svg/shape/pen.svg"),
color: Color.grey[800],
size: "1em"
}), T("buttonWrite")).tap(tap);
};
})();
pages/learnLists/myLists/list/row/createNew/buttons/buttonListScan/button.ls
(function(){
return function(){
var tap;
tap = function(){
return inc("/pages/createNewList/start")("newListScan", "createNewRow");
};
return inc("../_button/button")(SvgIcon({
svg: path("/../app01/lib/svg/shape/camera.svg"),
color: Color.grey[800],
size: "1.1em"
}), T("buttonScan")).tap(tap);
};
})();
pages/learnLists/myLists/list/row/createNew/buttons/buttons.ls
(function(){
return function(){
return Div({
display: "flex",
alignItems: "stretch",
flexWrap: "wrap",
justifyContent: "flex-start"
}).html(inc("buttonListEditor/button")(), inc("buttonListScan/button")());
};
})();
pages/learnLists/myLists/list/row/createNew/row.ls
(function(){
return function(page){
return Div({
display: "flex",
margin: "1.3em 0 0",
background: Color.grey[50],
border: "1px solid " + Color.grey[100],
fontSize: "0.9em",
alignItems: "stretch",
flexDirection: "column"
}).html(inc("text/text")(), inc("buttons/buttons")());
};
})();
pages/learnLists/myLists/list/row/createNew/text/text.ls
(function(){
return function(){
return Div({
flex: "1 1 auto",
textAlign: "left",
lineHeight: "1.5em",
padding: "0.5em 0.5em 0em"
}).html(T("text"));
};
})();
pages/learnLists/myLists/list/row/footer/row.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/learnLists/myLists/list/row/header/row.ls
(function(){
return function(page){
return Div({
display: "flex",
justifyContent: "space-between",
margin: "1em 0 0.7em"
}).html(inc("totalLabel/label")(page), Div({
flex: "1 0 auto"
}), inc("sortLabel/label")(page));
};
})();
pages/learnLists/myLists/list/row/header/sortLabel/icon/icon.ls
(function(){
return function(page){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/arrow-down-sort.svg"),
color: Color.grey[600]
});
};
})();
pages/learnLists/myLists/list/row/header/sortLabel/items/items.ls
(function(){
return function(page, options){
var i$, len$, results$ = [];
for (i$ = 0, len$ = options.length; i$ < len$; ++i$) {
results$.push((fn$.call(this, options[i$])));
}
return results$;
function fn$(o){
return {
label: o.label,
icon: path("/../app01/lib/svg/shape/arrow-down-sort.svg"),
iconColor: Color.grey[750],
selected: page.sorting === o.id,
click: function(){
if (o.id === page.sorting) {
return;
}
inc("/../app01/lib/util/cache/set/set")("myLearnListsSorting", o.id);
return startPage({
history: 0
});
}
};
}
};
})();
pages/learnLists/myLists/list/row/header/sortLabel/label.ls
(function(){
return function(page){
var options, tap, div;
options = inc("options/options")();
tap = function(){
return OverlayMenu({
referenceDiv: div,
items: inc("items/items")(page, options),
direction: "down left",
adjustXY: "-6 -6"
});
};
return div = Div({
display: "flex",
padding: "0.3em",
fontSize: "0.9em"
}).html(inc("icon/icon")(page), inc("text/text")(page, options)).tap(tap);
};
})();
pages/learnLists/myLists/list/row/header/sortLabel/options/options.ls
(function(){
return function(){
var options;
return options = [
{
id: "updatedDesc",
label: T("updatedDescLabel")
}, {
id: "learnListNameAsc",
label: T("learnListNameLabel")
}, {
id: "typeAsc",
label: T("type")
}
];
};
})();
pages/learnLists/myLists/list/row/header/sortLabel/text/text.ls
(function(){
return function(page, options){
var label;
label = _.find(options, {
id: page.sorting
}).label;
return Div({
color: Color.grey[600],
fontSize: "0.9em",
paddingLeft: "0.2em"
}).html(label);
};
})();
pages/learnLists/myLists/list/row/header/totalLabel/label.ls
(function(){
return function(page){
return Div({
display: "flex",
padding: "0.3em",
fontSize: "0.85em",
color: Color.grey[600]
}).html(page.params.search
? T("totalSearch", page.data.length)
: T("total", page.data.length));
};
})();
pages/learnLists/myLists/list/row/row.ls
(function(){
return function(page){
return function(data){
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(data.rowType === "header"
? inc("header/row")(page)
: data.rowType === "footer"
? inc("footer/row")()
: data.rowType === "createNew"
? inc("createNew/row")()
: inc("/pages/_shared/learnListRow/row")({
context: "myLists",
listCode: data.listCode
})));
};
};
})();
pages/learnLists/myLists/loadData/load.ls
(function(){
return function(page, onDone){
var onError, spinner;
if (page.originalData.length === 0) {
onDone();
return;
}
if (!page.params.search) {
page.data = page.originalData;
onDone();
return;
}
onError = function(){
spinner.remove();
return inc("/../app01/lib/gui/errorPopup/popup")();
};
page.html(spinner = inc("/../app01/lib/gui/spinner/spinner")());
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/learnList/myLists/search"),
params: {
search: page.params.search
},
requiredVisibleDiv: page,
onError: onError,
onOffline: function(){
return inc("/../app01/lib/offline/offlinePage/offlinePage")(page);
},
onCompleted: function(result){
var resultCodes;
if (result.status !== "ok") {
return onError();
} else {
resultCodes = _.map(result.learnListDescriptions, "listCode");
page.data = _.filter(page.originalData, function(l){
return in$(l.listCode, resultCodes);
});
return onDone();
}
}
});
};
})();
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
pages/learnLists/myLists/noList/_t.ls
(function(){
return {
text1: {
de: "Erstelle ganz leicht deine eigene Lernliste, z.B. für Vokabeln oder Rechtschreibung.",
en: "Easily create your own study lists, e.g. for vocabulary or spelling.",
fr: "Tu peux facilement créer une liste de mots ou de phrases pour apprendre par exemple du vocabulaire.",
es: "Crea tus propias listas para practicar, por ejemplo, vocabulario y ortografía.",
pt: "Crie suas próprias listas de estudo para praticar, por exemplo, vocabulário e ortografia."
},
text2: {
de: "Oder gehe oben auf Alle und übernimm Lernlisten von anderen Nutzer/innen.",
en: "Or go to All and use a study list from another user.",
fr: "Tu peux aussi aller dans Autres pour utiliser la liste d'un·e autre utilisateur·rice.",
es: "O presiona Otras en la parte de arriba y reutiliza las listas de otras personas.",
pt: "Ou selecione Outras na parte superior da tela e utilize a lista de estudo de outros usuários."
},
buttonScan: {
de: "Neue Liste scannen",
en: "Scan new list",
fr: "Scanner une nouvelle liste",
es: "Escanear lista nueva",
pt: "Escanear nova lista"
},
buttonWrite: {
de: "Neue Liste schreiben",
en: "Write new list",
fr: "Écrire une nouvelle liste",
es: "Escribir lista nueva",
pt: "Escrever nova lista"
}
};
})();
pages/learnLists/myLists/noList/buttons/_button/button.ls
(function(){
return function(icon, label){
return Div({
display: "flex",
background: Color.grey[250],
padding: "0.6em",
margin: "0.4em"
}).html(Div({
display: "flex",
width: "1em"
}).html(icon), Div({
marginLeft: "0.3em",
flex: "1 1 auto"
}).html(label));
};
})();
pages/learnLists/myLists/noList/buttons/buttons.ls
(function(){
return function(){
return Div({
display: "inline-block",
padding: "1em 0"
}).html(inc("listEditor/button")(), inc("listScan/button")());
};
})();
pages/learnLists/myLists/noList/buttons/listEditor/button.ls
(function(){
return function(){
var tap;
tap = function(){
return inc("/pages/createNewList/start")("newListEditor", "noListPage");
};
return inc("../_button/button")(SvgIcon({
svg: path("/../app01/lib/svg/shape/pen.svg"),
color: Color.grey[800],
size: "1em"
}), T("buttonWrite")).tap(tap);
};
})();
pages/learnLists/myLists/noList/buttons/listScan/button.ls
(function(){
return function(){
var tap;
tap = function(){
return inc("/pages/createNewList/start")("newListScan", "noListPage");
};
return inc("../_button/button")(SvgIcon({
svg: path("/../app01/lib/svg/shape/camera.svg"),
color: Color.grey[800],
size: "1.1em"
}), T("buttonScan")).tap(tap);
};
})();
pages/learnLists/myLists/noList/noList.ls
(function(){
return function(page){
return Div({
lineHeight: "1.5em",
width: "30em",
maxWidth: "90%",
margin: "0 auto"
}).html(inc("text1/text1")(), inc("buttons/buttons")(), inc("text2/text2")());
};
})();
pages/learnLists/myLists/noList/text1/text1.ls
(function(){
return function(){
return Div({
lineHeight: "1.5em"
}).html(T("text1"));
};
})();
pages/learnLists/myLists/noList/text2/text2.ls
(function(){
return function(){
return Div({
lineHeight: "1.5em"
}).html(T("text2"));
};
})();
pages/learnLists/myLists/noSearchResult/_t.ls
(function(){
return {
noListFoundSearch: {
de: "Keine Liste gefunden.",
en: "No lists found.",
fr: "Aucune liste n’a été trouvée.",
es: "No se encontró ninguna lista.",
pt: "Nenhuma lista encontrada."
}
};
})();
pages/learnLists/myLists/noSearchResult/noSearchResult.ls
(function(){
return function(page){
return Div({
lineHeight: "1.5em",
width: "30em",
maxWidth: "90%",
margin: "0 auto"
}).html(T("noListFoundSearch"));
};
})();
pages/learnLists/myLists/onNewLogEvents/onNewLogEvents.ls
(function(){
return function(page){
var restarted;
page.addClass("onNewLogEvents_learnListDescription", "onNewLogEvents_hasLearnList", "onNewLogEvents_bookmarkLearnList", "onNewLogEvents_deleteEvent");
restarted = false;
return page.onNewLogEvents = function(events){
var i$, len$, e, ref$, results$ = [];
for (i$ = 0, len$ = events.length; i$ < len$; ++i$) {
e = events[i$];
if (page !== app.currentPage || e.logId !== log.id()) {
continue;
}
if (e.event === "deleteEvent" && ((ref$ = e.target.event) !== "hasLearnList" && ref$ !== "bookmarkLearnList")) {
continue;
}
if (restarted) {
break;
}
restarted = true;
log.sync(fn$);
break;
}
return results$;
function fn$(){
return startPage({
history: 0
});
}
};
};
})();
pages/learnLists/myLists/page.ls
(function(){
return function(page){
page.context = "myLists";
page.data = inc("calcData/calc")();
page.originalData = page.data;
page.sorting = inc("calcSorting/calc")();
inc("onNewLogEvents/onNewLogEvents")(page);
return {
navCategory: inc("/_shared/calcNavCategory/calc")(),
top: function(){
return inc("../_topbar/topbar")(page);
},
urlDescription: function(){
return inc("../../_shared/urlDescription/description")();
},
start: function(){
var sortLists, create, that, ref$;
page.loadData = function(){
return inc("loadData/load")(page, sortLists);
};
sortLists = function(){
return inc("sortLists/sort")(page, create);
};
create = function(){
page.html(page.data.length === 0 && page.params.search
? inc("noSearchResult/noSearchResult")(page)
: page.data.length === 0
? inc("noList/noList")(page)
: inc("list/list")(page));
return inc("scrollToList/scroll")(page);
};
if (that = page.params.search) {
if (typeof (ref$ = page.topbar).setSearchValue == 'function') {
ref$.setSearchValue(that);
}
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
return page.loadData();
} else {
return sortLists();
}
}
};
};
})();
pages/learnLists/myLists/scrollToList/scroll.ls
(function(){
return function(page){
var scrollIndex;
if (!page.params.scrollToListCode) {
return;
}
scrollIndex = _.findIndex(page.listData, function(r){
return r.listCode === page.params.scrollToListCode;
});
delete page.params.scrollToListCode;
if (page.sorting === "updatedDesc") {
return;
}
return setTimeout(function(){
if (app.currentPage !== page) {
return;
}
return page.list.scrollRowIntoView(scrollIndex, {
top: true,
padding: 20
});
}, 1000);
};
})();
pages/learnLists/myLists/sortLists/sort.ls
(function(){
return function(page, onDone){
var sorting, data2, sortKey, sortDirection;
if (!page.data) {
return;
}
sorting = page.sorting;
if (!sorting) {
onDone(page.data);
return;
}
data2 = _.map(page.data, function(l){
var d;
d = l.description;
l.typeName = inc("/pages/_shared/calcLearnListCover/titleDiv/calcTitle/calc")(d.type);
if (_.isArray(l.typeName)) {
l.typeName = l.typeName[0];
}
l.name = d.name;
l.listUpdated = l.event === "bookmarkLearnList"
? _.max([d.updated, l.inserted.toISOString()])
: d.updated;
return l;
});
sortKey = _.startsWith(sorting, "learnListName")
? "name"
: _.startsWith(sorting, "updated")
? "listUpdated"
: _.startsWith(sorting, "type") ? "typeName" : void 8;
sortDirection = _.endsWith(sorting, "Asc")
? "asc"
: _.endsWith(sorting, "Desc") ? "desc" : void 8;
data2 = _.orderBy(data2, sortKey, sortDirection);
data2 = _.map(data2, function(l){
return _.omit(l, ["name", "listUpdated", "typeName"]);
});
page.data = data2;
return onDone();
};
})();
pages/level/feedbackIcon/00_shared/button/button.ls
(function(){
return function(label, tap){
return Button(label).css({
minWidth: "5em",
margin: "0.5em"
}).tap(tap);
};
})();
pages/level/feedbackIcon/01_popupStart/popup.ls
(function(){
return function(){
var player, trainer, listCode, lld, showNewPopup, clickYes, clickNo, div, popup;
app.currentPage.lockLayout = false;
player = app.currentPage.levelPlayer;
if (!player) {
return;
}
trainer = player.currentSlide.trainerParams.trainer;
listCode = app.currentPage.level.path.split("/")[2];
lld = inc("/data/calcLearnListDescription/calc")(listCode);
showNewPopup = (trainer === "gapMultiLearnList" || trainer === "dragCard") && !lld.isCreator;
clickYes = function(){
if (showNewPopup) {
return inc("../02_popupItems/popup")(player, lld);
} else {
return inc("../02_popupChoices/popup")();
}
};
clickNo = function(){
return popup.close();
};
div = Div({
width: "20em",
margin: "1em 0em 0.5em"
}).html(Div({
padding: "0 0.5em 0.5em"
}).html(showNewPopup
? T("sendCorrection")
: T("sendFeedback")), inc("../00_shared/button/button")(T("yes"), clickYes).addClass("keyManager-enter").bind("keyManager", clickYes), inc("../00_shared/button/button")(T("no"), clickNo));
return popup = inc("/../app01/lib/gui/popup/popup")({
html: div
});
};
})();
pages/level/feedbackIcon/02_popupChoices/buttons/buttons.ls
(function(){
return function(){
var b;
b = function(label, func){
return inc("../../00_shared/button/button")(label, func).css({
display: "block"
});
};
return [
b(T("tooHard"), function(){
return inc("../../04_popupDone/popup")("tooHard");
}), b(T("tooEasy"), function(){
return inc("../../04_popupDone/popup")("tooEasy");
}), b(T("inappropriate"), function(){
return inc("../../03_popupInput/popup")("inappropriate");
}), b(T("hasMistake"), function(){
return inc("../../03_popupInput/popup")("mistake");
})
];
};
})();
pages/level/feedbackIcon/02_popupChoices/popup.ls
(function(){
return function(){
var div;
div = Div({
width: "18em",
maxWidth: "90%",
margin: "1em 0.5em"
}).html(inc("title/title")(), inc("buttons/buttons")());
return inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/level/feedbackIcon/02_popupChoices/title/title.ls
(function(){
return function(){
return Div({
paddingBottom: "0.5em"
}).html(T("theList"));
};
})();
pages/level/feedbackIcon/02_popupItems/_t.ls
(function(){
return {
sendFeedback: {
de: "Möchtest du einen Fehler in dieser Lernliste melden?",
en: "Would you like to report a mistake in this study list?",
fr: "Veux-tu signaler une erreur dans cette liste ?",
es: "¿Quieres reportar un error en esta lista?",
pt: "Você gostaria de relatar um erro nesta lista de estudo?"
},
title: {
de: "Wähle den Eintrag aus, bei dem es einen Fehler gibt:",
en: "Choose the entry that contains the mistake.",
fr: "Sélectionne l'entrée dans laquelle se trouve l’erreur.",
es: "Selecciona el elemento que contiene el error:",
pt: "Selecione o item que apresenta um erro:"
},
noItems: {
de: "Bitte lerne noch weiter, um hier einen Eintrag korrigieren zu können.",
en: "Please continue studying to be able to correct an entry here.",
fr: "Continue à apprendre pour pouvoir corriger une entrée ici.",
es: "Por favor, continúa aprendiendo para poder corregir elementos aquí.",
pt: "Por favor, continue aprendendo para poder corrigir algum item aqui."
}
};
})();
pages/level/feedbackIcon/02_popupItems/calcVisibleItems/calc.ls
(function(){
return function(player){
var visibleItems, itemIndex, i$, to$, i, slide, ref$, info, visibleItem;
visibleItems = [];
itemIndex = 0;
for (i$ = 0, to$ = player.currentSlideIndex; i$ <= to$; ++i$) {
i = i$;
slide = player.slides[i];
for (i in ref$ = slide.visibleLearnListItemsInfos) {
info = ref$[i];
visibleItem = _.find(player.level.items, fn$);
visibleItem.visibleParts = info;
visibleItems.push(visibleItem);
}
}
return visibleItems;
function fn$(item){
return _.isEqual(item.atom, slide.atoms[i]);
}
};
})();
pages/level/feedbackIcon/02_popupItems/list/continueButton/button.ls
(function(){
return function(o){
return Button(T("continueButton")).css({
marginTop: "0.8em"
}).tap();
};
})();
pages/level/feedbackIcon/02_popupItems/list/list.ls
(function(){
return function(visibleItems, player, lld, onChoose){
var i, item;
return ScrollDiv().css({
margin: "0 0 0.5em 0.2em",
maxHeight: "20em",
paddingRight: "0.5em"
}).html(Div({
color: Color.grey[700]
}).append((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = visibleItems).length; i$ < len$; ++i$) {
i = i$;
item = ref$[i$];
results$.push(inc("row/row")({
item: item,
i: i,
player: player,
lld: lld,
visibleItems: visibleItems,
onChoose: onChoose
}));
}
return results$;
}())));
};
})();
pages/level/feedbackIcon/02_popupItems/list/row/calcItemParts/calc.ls
(function(){
return function(o){
var listType, item;
listType = o.lld.type;
item = o.item;
return [
_.includes(item.visibleParts, "a") ? Div({
color: Color.grey[600]
}).secureHtml(_.startsWith(listType, "vocab")
? item.b.text
: item.a.text) : void 8, _.includes(item.visibleParts, "b") && !_.startsWith(listType, "spell") ? Div({
color: Color.grey[600]
}).secureHtml(_.startsWith(listType, "vocab")
? item.a.text
: item.b.text) : void 8
];
};
})();
pages/level/feedbackIcon/02_popupItems/list/row/row.ls
(function(){
return function(o){
return Div({
display: "flex",
textAlign: "left",
padding: "0.6em 0 0.6em 0.6em",
borderBottom: o.i !== o.visibleItems.length - 1 ? "1px solid " + Color.grey[250] : void 8
}).html(Div({
flex: "1 1 auto"
}).html(inc("calcItemParts/calc")(o)), SvgIcon({
svg: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
color: Color.grey[500]
}).css({
flex: "0 1 auto"
})).tap(function(){
return o.onChoose(o.item);
});
};
})();
pages/level/feedbackIcon/02_popupItems/popup.ls
(function(){
return function(player, lld){
var visibleItems, isEmpty, onChoose, div;
visibleItems = inc("calcVisibleItems/calc")(player);
isEmpty = visibleItems.length === 0;
onChoose = function(item){
var itemIndex;
itemIndex = _.findIndex(player.level.items, item);
return inc("../03_popupInputItem/popup")(player, lld, item, itemIndex);
};
div = Div({
width: "25em",
maxWidth: "90%",
maxHeight: "35em",
margin: "1em 0.5em"
}).html(inc("title/title")(isEmpty), !isEmpty ? inc("list/list")(visibleItems, player, lld, onChoose) : void 8);
return inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/level/feedbackIcon/02_popupItems/title/title.ls
(function(){
return function(isEmpty){
return Div({
paddingBottom: "0.5em"
}).html(!isEmpty
? T("title")
: T("noItems"));
};
})();
pages/level/feedbackIcon/03_popupInput/input/input.ls
(function(){
return function(){
var input;
return input = inc("/../app01/lib/gui/inputEditable/input")({
multiline: true,
lineHeight: "1.5em",
linePadding: "0 0.3em",
maxLength: 500
}).css({
margin: "1.5em auto",
height: "5em",
width: "95%"
});
};
})();
pages/level/feedbackIcon/03_popupInput/popup.ls
(function(){
return function(type){
var tap, div, input;
tap = function(){
return inc("../04_popupDone/popup")(type, input.getValue());
};
div = Div({
width: "18em",
margin: "1em 1em 0.5em"
}).html(inc("title/title")(type), input = inc("input/input")(), Button(T("send")).css({
margin: "0.4em"
}).tap(tap));
input.start();
return inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/level/feedbackIcon/03_popupInput/title/title.ls
(function(){
return function(type){
return Div().html(type === "mistake"
? T("mistakeInput")
: type === "inappropriate" ? T("inappropriateInput") : void 8);
};
})();
pages/level/feedbackIcon/03_popupInputItem/_t.ls
(function(){
return {
correctMistake: {
de: "Bitte korrigiere den Fehler:",
en: "Please correct the mistake:",
fr: "Merci de corriger l'erreur :",
es: "Por favor, corrige el error:",
pt: "Por favor, corrija o erro:"
}
};
})();
pages/level/feedbackIcon/03_popupInputItem/buttons/buttons.ls
(function(){
return function(tapBack, tapSend){
return Div({
margin: "0.6em 0.3em 0.7em"
}).html(inc("/../app01/lib/gui/link/link")({
label: T("backButton"),
direction: "left"
}).css({
verticalAlign: "-0.15em",
marginRight: "0.5em"
}).tap(tapBack), Button(T("send")).tap(tapSend));
};
})();
pages/level/feedbackIcon/03_popupInputItem/inputs/input/input.ls
(function(){
return function(value){
var input;
input = inc("/../app01/lib/gui/inputEditable/input")({
value: value,
lineWrapping: true
}).css({
marginBottom: "0.3em",
width: "15em",
maxWidth: "100%"
});
input.originalValue = value;
return input;
};
})();
pages/level/feedbackIcon/03_popupInputItem/inputs/inputs.ls
(function(){
return function(item, lld){
var listType, start, getValues, getOriginalValues, checkChanged, div, inputA, inputB;
listType = lld.type;
start = function(){
var ref$;
return (ref$ = inputA || inputB) != null ? ref$.start() : void 8;
};
getValues = function(){
var v, that;
v = {};
if (that = typeof inputA != 'undefined' && inputA !== null ? inputA.getValue() : void 8) {
v.a = that;
}
if (that = typeof inputB != 'undefined' && inputB !== null ? inputB.getValue() : void 8) {
v.b = that;
}
return v;
};
getOriginalValues = function(){
var v, that;
v = {};
if (that = typeof inputA != 'undefined' && inputA !== null ? inputA.originalValue : void 8) {
v.a = that;
}
if (that = typeof inputB != 'undefined' && inputB !== null ? inputB.originalValue : void 8) {
v.b = that;
}
return v;
};
checkChanged = function(){
return !((typeof inputA != 'undefined' && inputA !== null ? inputA.originalValue : void 8) === (typeof inputA != 'undefined' && inputA !== null ? inputA.getValue() : void 8) && (typeof inputB != 'undefined' && inputB !== null ? inputB.originalValue : void 8) === (typeof inputB != 'undefined' && inputB !== null ? inputB.getValue() : void 8));
};
div = Div({
margin: "0.4em 0",
width: "100%"
}).html(_.includes(item.visibleParts, "a") ? inputA = inc("input/input")(_.startsWith(listType, "vocab")
? item.b.text
: item.a.text) : void 8, _.includes(item.visibleParts, "b") ? inputB = inc("input/input")(_.startsWith(listType, "vocab")
? item.a.text
: item.b.text) : void 8);
div.start = start;
div.getValues = getValues;
div.getOriginalValues = getOriginalValues;
div.checkChanged = checkChanged;
return div;
};
})();
pages/level/feedbackIcon/03_popupInputItem/log/log.ls
(function(){
return function(inputs, item, itemIndex, player){
var values, originalValues, e;
values = inputs.getValues();
originalValues = inputs.getOriginalValues();
e = {
event: "sendLearnListCorrection",
listCode: player.level.path.split("/")[2],
values: values,
originalValues: originalValues,
itemIndex: itemIndex
};
return log.log(e);
};
})();
pages/level/feedbackIcon/03_popupInputItem/popup.ls
(function(){
return function(player, lld, item, itemIndex){
var tapSend, tapBack, div, inputs;
tapSend = function(){
if (!inputs.checkChanged()) {
return;
}
inc("log/log")(inputs, item, itemIndex, player);
return inc("../04_popupDone/popup")();
};
tapBack = function(){
return inc("../02_popupItems/popup")(player, lld);
};
div = Div({
display: "flex",
flexDirection: "column",
width: "18em",
margin: "1em 1em 0.5em"
}).html(inc("title/title")(), inputs = inc("inputs/inputs")(item, lld), inc("buttons/buttons")(tapBack, tapSend));
inputs.start();
return inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/level/feedbackIcon/03_popupInputItem/title/title.ls
(function(){
return function(){
return Div({
margin: "0.3em 0 0.8em"
}).html(T("correctMistake"));
};
})();
pages/level/feedbackIcon/04_popupDone/logFeedback/log.ls
(function(){
return function(type, text){
var p, l, s, e;
p = app.currentPage;
l = p.levelPlayer;
s = l.currentSlide;
e = {
event: "sendFeedbackLearnList",
listCode: l.level.path.split("/")[2],
type: type,
pagePath: app.currentPagePath,
scrollTop: p.pageScrollWrapper.scrollTop,
appType: inc("/../app01/lib/util/calcAppType/calc")(),
currentSlideIndex: l.currentSlideIndex,
trainerParams: _.omit(s.trainerParams, "atoms"),
level: l.level.path,
totalScoredAtoms: s.score.totalScoredAtoms()
};
if (text) {
e.text = text;
}
if (engine.isDebug) {
e.isDebug = true;
}
return typeof log != 'undefined' && log !== null ? log.log(e) : void 8;
};
})();
pages/level/feedbackIcon/04_popupDone/popup.ls
(function(){
return function(type, text){
var close, div, popup;
close = function(){
return popup.close();
};
if (type) {
inc("logFeedback/log")(type, text);
}
div = Div({
width: "18em",
margin: "1em 0 0.5em"
}).html(Div({
paddingBottom: "0.5em"
}).html(T("thanksForReporting")), inc("../00_shared/button/button")(T("ok"), close));
return popup = inc("/../app01/lib/gui/popup/popup")({
html: div,
animationOnShow: false
});
};
})();
pages/level/feedbackIcon/_t.ls
(function(){
return {
sendCorrection: {
de: "Möchtest du einen Fehler in dieser Lernliste melden?",
en: "Would you like to report a mistake in this study list?",
fr: "Veux-tu signaler une erreur dans cette liste ?",
es: "¿Quieres reportar un error en esta lista?",
pt: "Você gostaria de reportar um erro nesta lista de estudo?"
},
sendFeedback: {
de: "Möchtest du ein Problem zu dieser Lernliste melden?",
en: "Would you like to report a problem with this study list?",
fr: "Veux-tu signaler un problème dans cette liste ?",
es: "¿Quieres reportar algún problema en esta lista?",
pt: "Você gostaria de reportar um problema nesta lista de estudo?"
},
theList: {
de: "Die Lernliste ...",
en: "The study list ...",
fr: "La liste…",
es: "La lista...",
pt: "A lista de estudo..."
},
tooHard: {
de: "ist zu schwer",
en: "is too difficult",
fr: "est trop difficile",
es: "es demasiado difícil",
pt: "é difícil demais"
},
tooEasy: {
de: "ist zu leicht",
en: "is too easy",
fr: "est trop facile",
es: "es demasiado fácil",
pt: "é fácil demais"
},
inappropriate: {
de: "hat unangemessene Inhalte",
en: "has inappropriate content",
fr: "contient des éléments inappropriés",
es: "Tiene contenido inapropiado",
pt: "tem conteúdos inapropriados"
},
hasMistake: {
de: "hat einen Fehler",
en: "contains a mistake",
fr: "a une erreur",
es: "tiene un error",
pt: "tem um erro"
},
thanksForReporting: {
de: "Danke für deine Meldung!",
en: "Thanks for letting us know!",
fr: "Merci pour ton message !",
es: "¡Gracias por tu comentario!",
pt: "Agradecemos pelo seu comentário!"
},
mistakeInput: {
de: "Was ist der Fehler?",
en: "What is the mistake?",
fr: "Quelle erreur as-tu vue ?",
es: "¿Cuál es el error?",
pt: "Qual é o erro?"
},
inappropriateInput: {
de: "Was ist das Problem?",
en: "What is the problem?",
fr: "Quel problème as-tu vu ?",
es: "¿Cuál es el problema?",
pt: "Qual é o problema?"
},
send: {
de: "Senden",
en: "Send",
fr: "Envoyer",
es: "Enviar",
pt: "Enviar"
}
};
})();
pages/level/feedbackIcon/icon.ls
(function(){
return function(page){
var tap;
tap = function(){
return inc("01_popupStart/popup")();
};
return Div({
flex: "0 0 2.5em",
display: "flex"
}).html(SvgIcon(path("/../app01/lib/svg/icon/feedback.svg"))).tap({
up: tap,
animation: "hover"
});
};
})();
pages/level/finishLevelLearnList/_shared/calcFinishLevelEvent/calc.ls
(function(){
return function(){
return log.findLast(function(e){
return e.event === "finishLevel" && e.src === Store("sourceId");
});
};
})();
pages/level/finishLevelLearnList/_topbar/_t.ls
(function(){
return {
cancelNow: {
de: "Jetzt abbrechen?",
en: "Are you sure you want to quit?",
fr: "Quitter maintenant ?",
es: "¿Realmente quieres terminar?",
pt: "Você tem certeza que deseja cancelar?"
}
};
})();
pages/level/finishLevelLearnList/_topbar/abortIcon/icon.ls
(function(){
return function(page){
var click;
click = function(){
return inc("../../close/close")();
};
return Div({
flex: "0 0 2.5em",
display: "flex"
}).append(SvgIcon({
svg: path("/../app01/lib/svg/icon/close-small.svg")
})).tap({
up: click,
tapZone: "0 1em 1em 0",
animation: "hover"
}).addClass("keyManager-esc androidBack").bind("androidBack", click).bind("keyManager", click).attr({
"aria-label": T("cancelButton"),
role: "button"
});
};
})();
pages/level/finishLevelLearnList/_topbar/abortIcon/popup/popup.ls
(function(){
return function(finish){
var clickYes, clickNo, div, css, popup;
clickYes = function(){
popup.close();
return finish();
};
clickNo = function(){
return popup.close();
};
div = Div({
width: "18em",
margin: "1.5em 0 0.5em"
}).append(Div().html(T("cancelNow")), Div({
margin: "1em 0 0.4em"
}).append(Button(T("yes")).css(css = {
minWidth: "6em",
margin: "0.4em"
}).addClass("keyManager-enter").bind("keyManager", clickYes).tap(clickYes), Button(T("no")).css(css).tap(clickNo)));
return popup = inc("/lib/gui/popup/popup")({
html: div
});
};
})();
pages/level/finishLevelLearnList/_topbar/topbar.ls
(function(){
return function(page){
var div;
div = Div().html(Div({
display: "flex",
alignItems: "stretch",
textAlign: "center",
minHeight: "2.4em",
justifyContent: "flex-start",
zIndex: 2,
backgroundClip: "border-box"
}).addClass("topBar").html(inc("abortIcon/icon")(page)));
return page.topbar = div;
};
})();
pages/level/finishLevelLearnList/bar/bar.ls
(function(){
return function(page){
var total, onSelect;
total = page.learnListDescription.totalSublevels;
onSelect = function(id){
var ref$;
page.nextSublevelId = id;
return (ref$ = page.buttons) != null ? ref$.refresh() : void 8;
};
return Div({
display: "flex"
}).css(total === 1 ? {
pointerEvents: "none"
} : void 8).append(inc("/pages/_shared/sublevelBar/bar")({
totalSublevels: total,
levelPath: page.levelPath,
selectedSublevelId: page.currentSublevelId + 1,
comingFromPage: "finish",
onSelect: onSelect
}).css({
width: "14em",
height: "1.3em",
margin: "1.5em 0 1.5em"
}));
};
})();
pages/level/finishLevelLearnList/buttons/buttonContinue/_t.ls
(function(){
return {
startPart: {
de: "Start Teil $1",
en: "Begin part $1",
fr: "Commencer la partie $1",
es: "Comenzar parte $1",
pt: "Iniciar parte $1"
}
};
})();
pages/level/finishLevelLearnList/buttons/buttonContinue/button.ls
(function(){
return function(page, isLast){
var tap;
if (isLast) {
return;
}
tap = function(){
var lp, p;
lp = page.levelPath.split("/sublevel-")[0];
lp = lp + "/sublevel-" + page.nextSublevelId;
p = _.cloneDeep(page.params);
p.levelPath = lp;
return startPage({
history: -1,
params: p
});
};
return Button(T("startPart", page.nextSublevelId)).css({
margin: "0.25em"
}).tap(tap).addClass("keyManager-enter").bind("keyManager", tap);
};
})();
pages/level/finishLevelLearnList/buttons/buttonEnd/_t.ls
(function(){
return {
end: {
de: "Beenden",
en: "Quit",
fr: "Quitter",
es: "Salir",
pt: "Sair"
}
};
})();
pages/level/finishLevelLearnList/buttons/buttonEnd/button.ls
(function(){
return function(page){
return Button(T("end")).css({
margin: "0.25em"
}).tap(function(){
return inc("../../close/close")();
});
};
})();
pages/level/finishLevelLearnList/buttons/buttonRepeat/button.ls
(function(){
return function(){
var click;
click = function(){
return startPage({
history: -1
});
};
return Button({
icon: path("/../app01/lib/svg/icon/refresh.svg"),
action: click,
key: 49
}).css({
margin: "0.25em"
});
};
})();
pages/level/finishLevelLearnList/buttons/buttons.ls
(function(){
return function(page){
var sublevelId, isLast, div;
sublevelId = page.currentSublevelId;
isLast = page.nextSublevelId > page.learnListDescription.totalSublevels;
div = Div().html(inc("buttonRepeat/button")(page), inc("buttonContinue/button")(page, isLast), inc("buttonEnd/button")(page));
div.refresh = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return page.buttons = div;
};
})();
pages/level/finishLevelLearnList/close/close.ls
(function(){
return function(){
return startPage({
animation: "fadeIn",
history: function(path){
return !_.includes(path, "/level");
}
});
};
})();
pages/level/finishLevelLearnList/page.ls
(function(){
return function(page){
page.levelPath = page.params.levelPath;
page.listCode = page.levelPath.split("/")[2];
page.currentSublevelId = +page.levelPath.split("sublevel-")[1];
page.nextSublevelId = page.currentSublevelId + 1;
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.finishLevelEvent = inc("_shared/calcFinishLevelEvent/calc")();
return {
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("/../app01/pages/level/_shared/_urlDescriptionWithLevel/description")(page);
},
start: function(){
inc("/../app01/lib/util/soundEffectPlay/soundEffectPlay")("finish4");
return page.append(inc("text/text")(page), inc("bar/bar")(page), inc("buttons/buttons")(page));
}
};
};
})();
pages/level/finishLevelLearnList/text/_t.ls
(function(){
return {
singleFinish: {
de: "Geschafft!",
en: "Complete!",
fr: "Réussi !",
es: "¡Resuelto!",
pt: "Resolvido!"
},
multiFinish: {
de: "Teil $1 geschafft!",
en: "Part $1 completed!",
fr: "Partie $1 réussie !",
es: "Parte $1 resuelta!",
pt: "Parte $1 resolvida!"
}
};
})();
pages/level/finishLevelLearnList/text/text.ls
(function(){
return function(page){
return Div({
padding: "1em 0 0",
lineHeight: "1.5em"
}).html(page.learnListDescription.totalSublevels === 1
? T("singleFinish")
: T("multiFinish", page.currentSublevelId));
};
})();
pages/level/intro/_row/label/label.ls
(function(){
return function(p){
return Div({
flex: "1 1 auto",
textAlign: "left",
padding: "0.4em 0.2em",
overflow: "hidden",
textOverflow: "ellipsis"
}).html(p.label);
};
})();
pages/level/intro/_row/row.ls
(function(){
return function(p){
var selected, tap, div;
selected = undefined;
p.page = app.currentPage;
p.selected == null && (p.selected = false);
tap = function(){
p.selected = p.selected ? false : true;
selected.replaceWith(selected = inc("selected/selected")(p));
return p.submit(p.selected);
};
return div = Div({
flex: "1 1 auto",
display: "flex",
width: "100%",
padding: "0.4em 0"
}).html(inc("label/label")(p), selected = inc("selected/selected")(p)).tap(tap);
};
})();
pages/level/intro/_row/selected/selected.ls
(function(){
return function(p){
return Div({
flex: "0 0 auto",
width: "1.6em",
display: "flex",
paddingLeft: "0.2em",
alignSelf: "stretch"
}).html(SvgIcon({
color: Color.grey[600],
svg: p.selected
? path("/../app01/lib/svg/icon/check-on.svg")
: path("/../app01/lib/svg/icon/check-off.svg")
}));
};
})();
pages/level/intro/_rowDropdown/calcItems/calc.ls
(function(){
return function(p){
var items;
return items = _.map(p.items, function(item, i){
return {
label: item,
click: function(){
return p.submit(i);
}
};
});
};
})();
pages/level/intro/_rowDropdown/icon/icon.ls
(function(){
return function(){
return Div({
flex: "0 0 auto",
display: "flex",
paddingLeft: "0.2em",
alignSelf: "stretch"
}).html(SvgIcon({
color: Color.grey[600],
svg: path("/../app01/lib/svg/icon/arrow-down-small.svg"),
size: "0.8em"
}));
};
})();
pages/level/intro/_rowDropdown/labels/labels.ls
(function(){
return function(p){
var labelRight;
labelRight = p.items[p.selectedItemIndex];
if (labelRight.nodeType) {
if (typeof labelRight.findFirst == 'function') {
labelRight.findFirst(".arrowRight").setColor(Color.grey[600]);
}
labelRight = labelRight.clone();
}
return Div({
display: "flex",
flex: "1 1 auto",
textAlign: "left",
padding: "0.4em 0.2em",
overflow: "hidden",
textOverflow: "ellipsis"
}).html(Div({
flex: "0 1 auto"
}).html(p.labelLeft), Div({
flex: "1 1 auto"
}), Div({
flex: "0 1 auto",
color: Color.grey[600]
}).html(labelRight));
};
})();
pages/level/intro/_rowDropdown/row.ls
(function(){
return function(p){
var tap, icon;
p.page = app.currentPage;
tap = function(){
var items;
items = inc("calcItems/calc")(p);
return OverlayMenu({
referenceDiv: icon,
items: items,
direction: "down left"
});
};
return Div({
flex: "1 1 auto",
display: "flex",
width: "100%",
padding: "0.4em 0"
}).html(inc("labels/labels")(p), icon = inc("icon/icon")(p)).tap(tap);
};
})();
pages/level/intro/_topbar/abortIcon/icon.ls
(function(){
return function(page){
var tap;
tap = function(){
if (typeof vibrate == 'function') {
vibrate(VIBRATION_TYPES.impactMedium);
}
return startPage({
history: function(path){
return !_.includes(path, "/level");
},
animation: "fadeIn"
});
};
return Div({
flex: "0 0 2.5em",
display: "flex"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/icon/close-small.svg")
})).tap({
up: tap,
tapZone: "0 1em 1em 0",
animation: "hover"
}).addClass("keyManager-esc androidBack").bind("androidBack", tap).bind("keyManager", tap).attr({
"aria-label": T("cancelButton"),
role: "button"
});
};
})();
pages/level/intro/_topbar/topbar.ls
(function(){
return function(page){
var div;
div = Div().html(Div({
display: "flex",
alignItems: "stretch",
justifyContent: "flex-start",
textAlign: "center",
minHeight: "2.4em"
}).addClass("topBar").html(inc("abortIcon/icon")(page)));
return page.topbar = div;
};
})();
pages/level/intro/bar/bar.ls
(function(){
return function(page){
return Div({
display: "flex",
padding: "2.3em 1.5em 1.5em 1.5em"
}).append(page.bar = inc("/pages/_shared/sublevelBar/bar")({
totalSublevels: page.learnListDescription.totalSublevels,
levelPath: page.levelPath,
selectedSublevelId: page.currentSublevelId,
comingFromPage: "intro",
onSelect: function(sublevelId){
page.currentSublevelId = sublevelId;
page.bottomBar.refresh();
page.entryCount.refresh();
return inc("../cacheStartConfig/cache")(page);
}
}).css({
width: "15em",
height: "1.3em"
}));
};
})();
pages/level/intro/bottombar/bottombar.ls
(function(){
return function(page){
var div;
div = Div({
display: "flex"
}).html(inc("buttonStart/button")(page));
div.refresh = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return page.bottomBar = div;
};
})();
pages/level/intro/bottombar/buttonStart/_t.ls
(function(){
return {
start: {
de: "Start",
en: "Begin",
fr: "Commencer",
es: "Comenzar",
pt: "Iniciar"
},
startPart: {
de: "Start Teil $1",
en: "Begin part $1",
fr: "Commencer la partie $1",
es: "Comenzar parte $1",
pt: "Iniciar parte $1"
}
};
})();
pages/level/intro/bottombar/buttonStart/button.ls
(function(){
return function(page){
var lld, tap;
lld = page.learnListDescription;
tap = function(){
var levelPath, params;
levelPath = page.levelPath + "/sublevel-" + page.currentSublevelId;
params = {
context: "learnList",
levelPath: levelPath,
etag: lld.etag,
shuffleAtoms: page.startConfig.shuffleAtoms,
switchAB: page.startConfig.switchAB,
soundMode: inc("calcSoundMode/calc")(page)
};
if (_.startsWith(lld.type, "spell")) {
delete params.switchAB;
}
return startPage({
path: path("/../app01/pages/level/play/page"),
params: params
});
};
return Button({
label: lld.totalSublevels === 1
? T("start")
: T("startPart", page.currentSublevelId),
icon: path("/../app01/lib/svg/icon/arrow-right-small.svg"),
iconPosition: "right"
}).css({
margin: "0.8em",
minWidth: "5em",
textAlign: "center"
}).addClass("keyManager-enter").bind("keyManager", tap).tap(tap);
};
})();
pages/level/intro/bottombar/buttonStart/calcSoundMode/calc.ls
(function(){
return function(page){
if (_.startsWith(page.learnListDescription.type, "spell")) {
return "askSound";
} else {
return page.startConfig.sound;
}
};
})();
pages/level/intro/cacheStartConfig/cache.ls
(function(){
return function(page){
var config;
config = {
sound: page.startConfig.sound,
switchAB: page.startConfig.switchAB,
shuffleAtoms: page.startConfig.shuffleAtoms,
currentSublevelId: page.currentSublevelId
};
return inc("/../app01/lib/util/cache/set/set")("learnListIntroConfig", page.levelPath, config);
};
})();
pages/level/intro/calcStartConfig/calc.ls
(function(){
return function(page){
var cachedConfig, defaultConfig;
cachedConfig = inc("/../app01/lib/util/cache/get/get")("learnListIntroConfig", page.levelPath);
defaultConfig = {
sound: "ab",
switchAB: false,
shuffle: false
};
return cachedConfig || defaultConfig;
};
})();
pages/level/intro/entryCounter/_t.ls
(function(){
return {
entries: {
de: "Einträge:",
en: "Entries:",
fr: "Entrées:",
es: "Entradas:",
pt: "Entradas:"
}
};
})();
pages/level/intro/entryCounter/counter.ls
(function(){
return function(page){
var div, counter;
div = Div({
display: "flex",
padding: "0.8em 0 0.7em 0.2em"
}).html(Div({
flex: "0 1 auto"
}).html(T("entries")), Div({
flex: "1 1 auto"
}), counter = Div({
flex: "0 1 auto",
color: Color.grey[600]
}));
div.refresh = function(){
var currentSublevel;
currentSublevel = page.learnListDescription.sublevels[page.currentSublevelId - 1];
return counter.html(currentSublevel.from + " – " + currentSublevel.to);
};
div.refresh();
return div;
};
})();
pages/level/intro/line/line.ls
(function(){
return function(){
return Div({
height: "1px",
margin: "0 auto",
background: Color.grey[200]
});
};
})();
pages/level/intro/page.ls
(function(){
return function(page){
var ref$;
page.levelPath = page.params.levelPath;
page.listCode = page.levelPath.split("/")[2];
page.learnListDescription = inc("/data/calcLearnListDescription/calc")(page.listCode);
page.startConfig = inc("calcStartConfig/calc")(page);
page.currentSublevelId = (ref$ = page.startConfig.currentSublevelId) != null ? ref$ : 1;
return {
bottom: function(){
return inc("bottombar/bottombar")(page);
},
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("/../app01/pages/level/_shared/_urlDescriptionWithLevel/description")(page);
},
start: function(){
var line;
line = inc("line/line");
return page.css({
margin: "0 auto 0.5em",
width: "17em",
maxWidth: "95%"
}).append(inc("title/title")(page), line(), inc("bar/bar")(page), line(), page.entryCount = inc("entryCounter/counter")(page), !_.startsWith(page.learnListDescription.type, "spell") ? [line(), inc("switchAB/switchAB")(page), line(), inc("sound/sound")(page)] : void 8, line(), Div({
display: "flex"
}).html(inc("shuffle/shuffle")(page)), line());
}
};
};
})();
pages/level/intro/shuffle/_t.ls
(function(){
return {
mix: {
de: "Mischen:",
en: "Shuffle:",
fr: "Mélanger:",
es: "Mezclar:",
pt: "Misturar:"
}
};
})();
pages/level/intro/shuffle/shuffle.ls
(function(){
return function(page){
return page.shuffle = inc("../_row/row")({
id: "shuffle",
label: T("mix"),
submit: inc("submit/submit")(page),
selected: page.startConfig.shuffleAtoms
});
};
})();
pages/level/intro/shuffle/submit/submit.ls
(function(){
return function(page){
return function(selected){
page.startConfig.shuffleAtoms = selected;
return inc("../../cacheStartConfig/cache")(page);
};
};
})();
pages/level/intro/sound/_t.ls
(function(){
return {
sound: {
de: "Ton: ",
en: "Sound: ",
fr: "Son : ",
es: "Sonido: ",
pt: "Som: "
},
readAloud: {
de: "Vorlesen: ",
en: "Sound: ",
fr: "Entendre : ",
es: "Sonido: ",
pt: "Som: "
},
bothLanguages: {
de: "beide Sprachen",
en: "both languages",
fr: "Les 2 langues",
es: "ambos idiomas",
pt: "os dois idiomas"
},
both: {
de: "beide",
en: "both",
fr: "Les 2",
es: "ambas",
pt: "ambas"
},
turnedOff: {
de: "aus",
en: "off",
fr: "Aucun",
es: "desactivado",
pt: "desligado"
}
};
})();
pages/level/intro/sound/items/items.ls
(function(){
return function(type, labels){
var items;
return items = [
_.startsWith(type, "questions")
? T("both")
: T("bothLanguages"), labels.a, labels.b, T("turnedOff")
];
};
})();
pages/level/intro/sound/sound.ls
(function(){
return function(page){
var type, labels, index;
type = page.learnListDescription.type;
labels = inc("/pages/_shared/calcListColumns/calc")(type);
index = (function(){
switch (page.startConfig.sound) {
case "ab":
return 0;
case "b":
return 1;
case "a":
return 2;
case "":
return 3;
}
}());
return page.sound = inc("../_rowDropdown/row")({
items: inc("items/items")(type, labels),
labelLeft: T("sound"),
selectedItemIndex: index,
submit: inc("submit/submit")(page)
});
};
})();
pages/level/intro/sound/submit/submit.ls
(function(){
return function(page){
return function(i){
var config;
config = (function(){
switch (i) {
case 0:
return "ab";
case 1:
return "b";
case 2:
return "a";
case 3:
return "";
}
}());
page.startConfig.sound = config;
inc("../../cacheStartConfig/cache")(page);
return page.sound.replaceWith(page.sound = inc("../sound")(page));
};
};
})();
pages/level/intro/switchAB/_t.ls
(function(){
return {
direction: {
de: "Richtung: ",
en: "Direction: ",
fr: "Sens : ",
es: "Sentido: ",
pt: "Direção: "
}
};
})();
pages/level/intro/switchAB/items/items.ls
(function(){
return function(type, labels){
var items;
items = [inc("row/row")(labels.a, labels.b), inc("row/row")(labels.b, labels.a)];
if (_.startsWith(type, "vocab")) {
items.reverse();
}
return items;
};
})();
pages/level/intro/switchAB/items/row/row.ls
(function(){
return function(left, right){
return Div({
display: "inline-block"
}).html(left, SvgIcon({
svg: path("/../app01/lib/svg/shape/arrow-down-sort.svg")
}).addClass("arrowRight").css({
transform: "rotate(-90deg)",
margin: "0 0.1em",
verticalAlign: "-0.2em"
}), right);
};
})();
pages/level/intro/switchAB/submit/submit.ls
(function(){
return function(page){
return function(i){
var enabled;
enabled = i === 1;
page.startConfig.switchAB = enabled;
inc("../../cacheStartConfig/cache")(page);
return page.switchAB.replaceWith(page.switchAB = inc("../switchAB")(page));
};
};
})();
pages/level/intro/switchAB/switchAB.ls
(function(){
return function(page){
var type, labels, selectedItemIndex;
type = page.learnListDescription.type;
labels = inc("/pages/_shared/calcListColumns/calc")(type);
selectedItemIndex = page.startConfig.switchAB ? 1 : 0;
return page.switchAB = inc("../_rowDropdown/row")({
items: inc("items/items")(type, labels),
labelLeft: T("direction"),
selectedItemIndex: selectedItemIndex,
submit: inc("submit/submit")(page)
});
};
})();
pages/level/intro/title/title.ls
(function(){
return function(page){
var p, l;
p = page.params.levelPath;
l = inc("/pages/_shared/calcLevelTitle/calc")(p);
return Div({
padding: "0 0 1em",
fontWeight: "bold"
}).html(l);
};
})();
pages/scan/00_shared/bottomButtonProcess/_t.ls
(function(){
return {
errorNoDataFound: {
de: "Keine Textdaten gefunden.
Bitte wähle ein anderes Bild.",
en: "No text found.
Please choose another image.",
fr: "Aucun texte n'a été trouvé.
Merci de choisir une autre image.",
es: "No se encontró ningún texto.
Por favor, elige otra imagen.",
pt: "Nenhum dado de texto encontrado.
Por favor, escolha outra imagem."
},
scanning: {
de: "Scanvorgang läuft ...",
en: "Scanning in progress",
fr: "Scann en cours…",
es: "Escaneado en proceso ...",
pt: "Digitalização em andamento..."
}
};
})();
pages/scan/00_shared/bottomButtonProcess/button.ls
(function(){
return function(page, logSplit){
var tap;
tap = function(){
var ref$;
if (logSplit) {
inc("/_shared/logNewList/log")({
event: "splitImage",
position: page.params.splitPosition
});
}
if ((ref$ = page.findFirst(".splitter")) != null) {
ref$.css({
pointerEvents: "none"
});
}
inc("showSpinner/show")(page);
return inc("uploadAndScanImage/upload")(page);
};
return Div({
display: "flex",
padding: "0.8em",
height: "3.5em"
}).html(Button(T("continueButton")).tap(tap));
};
})();
pages/scan/00_shared/bottomButtonProcess/hideSpinner/hide.ls
(function(){
return function(page){
var ref$;
if ((ref$ = page.bottom.findFirst(".pageSpinner")) != null) {
ref$.remove();
}
return page.bottom.firstChild.show();
};
})();
pages/scan/00_shared/bottomButtonProcess/showSpinner/show.ls
(function(){
return function(page){
var button;
button = page.bottom.firstChild;
button.hide();
return page.bottom.append(Div({
display: "flex",
height: "3.5em"
}).addClass("pageSpinner").html(Div({
padding: "0.4em"
}).html(T("scanning")), inc("/../app01/lib/gui/spinner/spinner")({
color: Color.grey[600]
}).css({
fontSize: "0.7em"
})));
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/_apiUrl/url.ls
(function(){
return function(){
var url;
url = deviceLog['var']("useApisDbDebug") ? "https://apis-ocr-debug.solocode.com" : "https://apis-ocr-1.anton.app";
url += "/scanImage2/";
return url;
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/_onDone/onDone.ls
(function(){
return function(page, scanData){
var p;
scanData.splitPosition = page.params.splitPosition || 1;
app.scanData = scanData;
p = page.params;
return startPage({
path: path("../../../../04_editor/page"),
animation: "fadeIn",
params: {
context: p.context,
listType: p.listType,
listCode: p.listCode
}
});
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/_onError/onError.ls
(function(){
return function(page, label){
var ref$;
if ((ref$ = page.findFirst(".splitter")) != null) {
ref$.css({
pointerEvents: "auto"
});
}
inc("../../hideSpinner/hide")(page);
return inc("/../app01/lib/gui/errorPopup/popup")({
label: label
});
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/_onOffline/onOffline.ls
(function(){
return function(page){
var ref$;
if ((ref$ = page.findFirst(".splitter")) != null) {
ref$.css({
pointerEvents: "auto"
});
}
inc("../../hideSpinner/hide")(page);
return inc("/../app01/lib/offline/offlinePopup/popup")();
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/_onResult/onResult.ls
(function(){
return function(page, result){
var onError, ref$, ref1$, scanData;
onError = inc("../_onError/onError");
if (result.status !== "ok") {
return onError(page);
} else if (_.isEmpty(result.ocrData) || ((ref$ = result.ocrData) != null ? (ref1$ = ref$.lines) != null ? ref1$.length : void 8 : void 8) === 0) {
return onError(page, T("errorNoDataFound"));
} else {
scanData = result;
return inc("../_onDone/onDone")(page, scanData);
}
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/mobile/mobile.ls
(function(){
return function(page){
var fileTransfer, fileUrl, fileName, url, isDone, options, onDone, onError;
fileTransfer = new FileTransfer();
fileUrl = app.scanImage.originalImageUrl;
fileName = app.scanImage.originalImageFileName;
url = inc("../_apiUrl/url")();
isDone = false;
options = {
fileKey: "file",
fileName: "example.jpeg",
mimeType: "image/jpeg",
params: {
fileName: fileName,
cropParams: JSON.stringify(page.params.cropParams),
rotate: app.scanImage.rotate,
userLogId: log.id(),
deviceLogId: deviceLog.id(),
isDebug: engine.isDebug
}
};
onDone = function(result){
if (isDone) {
return;
}
isDone = true;
result = JSON.parse(result.response);
if (!inc("/../app01/lib/util/isOnline/isOnline")()) {
return inc("../_onOffline/onOffline")(page);
} else {
return inc("../_onResult/onResult")(page, result);
}
};
onError = function(error){
if (isDone) {
return;
}
isDone = true;
if ((error != null ? error.code : void 8) === 3) {
return inc("../_onOffline/onOffline")(page);
} else {
inc("../_onError/onError")(page);
throw error;
}
};
fileTransfer.upload(fileUrl, url, onDone, onError, options);
return setTimeout(function(){
return onError(Error("fileTransfer timeout"));
}, 20000);
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/upload.ls
(function(){
return function(page){
inc("/_shared/logNewList/log")({
event: "uploadImage"
});
if (_.startsWith(app.scanImage.src, "file")) {
return inc("mobile/mobile")(page);
} else {
return inc("web/web")(page);
}
};
})();
pages/scan/00_shared/bottomButtonProcess/uploadAndScanImage/web/web.ls
(function(){
return function(page, onDone){
var blobUrl, fileName, url, params, loadBlob, send;
blobUrl = app.scanImage.originalImageUrl;
fileName = app.scanImage.originalImageFileName;
url = inc("../_apiUrl/url")();
params = {
fileName: fileName,
cropParams: JSON.stringify(page.params.cropParams),
rotate: app.scanImage.rotate,
userLogId: log.id(),
deviceLogId: deviceLog.id(),
isDebug: engine.isDebug
};
loadBlob = function(){
var xhr;
xhr = new XMLHttpRequest();
xhr.open("GET", blobUrl, true);
xhr.responseType = "blob";
xhr.timeout = 20000;
xhr.send();
return xhr.onload = function(r){
var blob;
blob = xhr.response;
return send(blob);
};
};
send = function(blob){
var f, k, ref$, v, xhr;
f = new FormData();
f.append("file", blob);
for (k in ref$ = params) {
v = ref$[k];
f.append(k, v);
}
xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.responseType = "json";
xhr.send(f);
xhr.onerror = function(){
if (inc("/../app01/lib/util/isOnline/isOnline")()) {
return inc("../_onError/onError")(page);
} else {
return inc("../_onOffline/onOffline")(page);
}
};
return xhr.onload = function(){
var result;
result = xhr.response;
return inc("../_onResult/onResult")(page, result);
};
};
return loadBlob();
};
})();
pages/scan/00_shared/rotatedImage/image.ls
(function(){
return function(onChange){
var rotate, ref$, w, h, w2, div, image;
rotate = (ref$ = app.scanImage.rotate) != null ? ref$ : 0;
w = app.scanImage.originalWidth + "px";
h = app.scanImage.originalHeight + "px";
if (rotate === 90 || rotate === 270) {
w2 = w;
w = h;
h = w2;
}
return div = Div({
display: "flex",
width: w,
height: h
}).html(image = Img().attr({
src: app.scanImage.optimizedBase64,
crossOrigin: "anonymous"
}).css({
transform: "rotate(" + rotate + "deg)",
pointerEvents: "none"
}).bind("load", function(){
return requestAnimationFrame(onChange);
}).onWindowResize(onChange));
};
})();
pages/scan/00_shared/topZoom/button/button.ls
(function(){
return function(type, page){
var tap, c;
tap = function(){
var s;
s = type === "+"
? 1.2
: 1 / 1.2;
return page.zoomDiv.setScale(page.zoomDiv.getCurrentScale() * s);
};
return Div({
display: "flex",
width: "2em",
height: "2em",
pointerEvents: "auto"
}).html(Div({
position: "absolute",
fontWeight: "bold",
top: 0,
left: "0.4em",
color: c = Color.blue[600],
fontSize: "0.8em"
}).html(type), SvgIcon({
svg: path("/../app01/lib/svg/shape/search.svg"),
color: c
})).tap({
up: tap
});
};
})();
pages/scan/00_shared/topZoom/zoom.ls
(function(){
return function(page){
var b;
b = inc("button/button");
return Div({
display: "flex"
}).html(b("-", page), b("+", page));
};
})();
pages/scan/00_shared/topZoom/zoomButtons/button/button.ls
(function(){
return function(type, page){
var tap, c;
tap = function(){
var s;
s = type === "+"
? 1.2
: 1 / 1.2;
return page.zoomDiv.setScale(page.zoomDiv.getCurrentScale() * s);
};
return Div({
position: "absolute",
top: "30%",
marginTop: "-2em",
display: "flex",
background: Color.grey[150],
width: "2em",
height: "2em",
borderRadius: "0 50% 0 0",
pointerEvents: "auto"
}).css(type === "+" ? {
borderRadius: "50% 0 0 0",
right: "0",
paddingLeft: "0.4em"
} : void 8).html(Div({
position: "absolute",
fontWeight: "bold",
top: 0,
left: "0.4em",
color: c = Color.grey[600]
}).html(type), SvgIcon({
svg: path("/../app01/lib/svg/shape/search.svg"),
color: c
})).tap({
up: tap,
tapZone: "0.5em 0.5em 0.5em 0.5em"
});
};
})();
pages/scan/00_shared/topZoom/zoomButtons/buttons.ls
(function(){
return function(page){
var appType;
appType = inc("/../app01/lib/util/calcAppType/calc")().toLowerCase();
if (_.endsWith(appType, "ios") || _.endsWith(appType, "android")) {
return;
}
return Div({
position: "absolute",
left: 0,
right: 0,
top: 0,
bottom: 0,
pointerEvents: "none"
}).html(inc("button/button")("-", page), inc("button/button")("+", page));
};
})();
pages/scan/01_chooseImage/_t.ls
(function(){
return {
titleNewList: {
de: "Liste scannen",
en: "Scan list",
fr: "Scanner une liste",
es: "Escanear lista",
pt: "Escanear lista"
},
titleAddItems: {
de: "Neue Einträge einscannen",
en: "Scan new entries",
fr: "Scanner de nouvelles entrées",
es: "Escanear entradas nuevas",
pt: "Escanear novos itens"
},
text1NewList: {
de: "Erstelle superschnell eine Lernliste anhand einer fotografierten Vokabelliste, z.B. aus einem Schulbuch.",
en: "Create a study list quickly using an image of a vocabulary list, e.g. from a textbook.",
fr: "Tu peux créer une liste rapidement en photographiant par exemple une liste de vocabulaire dans un manuel.",
es: "Crear una lista rápidamente fotografiando una lista de palabras, por ejemplo, de un libro escolar. ",
pt: "Crie uma lista de estudo rapidamente, por exemplo, fotografando uma lista de palavras de um livro escolar."
},
text1AddItems: {
de: "Ergänze deine Liste einfach mit neuen Einträgen, die du hier von einem Bild einscannen kannst.",
en: "Complete your list with new entries, which you can scan in from the image.",
fr: "Tu peux facilement ajouter d'autres entrées à ta liste en scannant ici une image.",
es: "Completa tu lista fácilmente agregando entradas que puedes escanear aquí de una imagen. ",
pt: "Você pode facilmente adicionar mais itens à sua lista digitalizando uma imagem aqui."
},
dropInfo: {
de: "Du kannst auch ein Bild aus der Zwischenablage einfügen oder eine Datei hier hineinziehen.",
en: "You can also add an image from the clipboard or drag a file here.",
fr: "Tu peux aussi ajouter une image depuis le presse-papier ou faire glisser un fichier ici.",
es: "También puedes agregar una imagen del portapapeles o arrastrar un archivo hasta aquí. ",
pt: " Você também pode colar uma imagem da área de transferência ou arrastar um arquivo até aqui."
},
useWebcam: {
de: "Webcam verwenden",
en: "Use webcam",
fr: "Utiliser la webcam",
es: "Utilizar webcam",
pt: "Utilizar webcam"
},
chooseImage: {
de: "Bild auswählen",
en: "Select image",
fr: "Choisir une image",
es: "Elegir imagen",
pt: "Selecionar imagem"
},
useCamera: {
de: "Kamera verwenden",
en: "Use camera",
fr: "Utiliser la caméra",
es: "Utilizar cámara",
pt: "Utilizar câmera"
},
useImage: {
de: "Bild-Datei auswählen",
en: "Select image file",
fr: "Choisir un fichier",
es: "Elegir un archivo",
pt: "Selecionar arquivo"
},
demoImage: {
de: "Demo Beispielbild",
en: "Demo example image",
fr: "Voir une démo",
es: "Demo imagen-ejemplo",
pt: "Exemplo de imagem"
},
webcamTitle: {
de: "Webcam",
en: "Webcam",
fr: "Webcam",
es: "Webcam",
pt: "Webcam"
},
webcamError: {
de: "Die Webcam kann nicht aktiviert werden.",
en: "The webcam cannot be activated.",
fr: "La webcam ne peut pas être activé.",
es: "No se puede activar la webcam.",
pt: "A Webcam não pôde ser ativada"
}
};
})();
pages/scan/01_chooseImage/_topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: page.params.context === "newList"
? T("titleNewList")
: T("titleAddItems"),
back: page.params.context === "newList" ? function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
} : void 8
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/scan/01_chooseImage/buttons/_button/button.ls
(function(){
return function(label, svg){
return Div({
display: "flex",
background: Color.grey[300],
padding: "0.7em 0.7em",
margin: "0.6em",
justifyContent: "flex-start"
}).html(SvgIcon({
svg: svg,
color: Color.grey[700]
}).css({
marginRight: "0.6em"
}), label);
};
})();
pages/scan/01_chooseImage/buttons/_getMobilePicture/get.ls
(function(){
return function(page, sourceType){
var options, onError, onSuccess;
options = {
targetWidth: 1500,
targetHeight: 1500,
cameraDirection: 0,
encodingType: 0,
sourceType: sourceType,
destinationType: 1,
correctOrientation: true,
quality: 20
};
onError = function(error){
inc("/_shared/logNewList/log")({
event: "mobileScanError",
error: error,
sourceType: (function(){
switch (sourceType) {
case 0:
return "library";
case 1:
return "camera";
}
}())
});
if (error !== "No Image Selected") {
return inc("/../app01/lib/gui/errorPopup/popup")();
}
};
onSuccess = function(fileUrl){
return setTimeout(function(){
var fileName;
fileName = sourceType === 0 ? "mobile_library_" : "mobile_camera_";
fileName += _.last(fileUrl.split("/"));
return page.onDone(fileUrl, fileName);
});
};
return navigator.camera.getPicture(onSuccess, onError, options);
};
})();
pages/scan/01_chooseImage/buttons/buttons.ls
(function(){
return function(page){
var appType;
appType = inc("/../app01/lib/util/calcAppType/calc")().toLowerCase();
return Div({
display: "inline-block",
padding: "1em"
}).html(engine.isMobileApp
? [inc("mobileCamera/camera")(page), inc("mobileLibrary/library")(page)]
: [inc("file/file")(page), !_.endsWith(appType, "ios") && !_.endsWith(appType, "android") ? inc("webcam/webcam")(page) : void 8], inc("demo/demo")(page));
};
})();
pages/scan/01_chooseImage/buttons/demo/calcDemoImage/calc.ls
(function(){
return function(page){
return {
id: "solocode_" + page.params.listType
};
};
})();
pages/scan/01_chooseImage/buttons/demo/demo.ls
(function(){
return function(page){
var tap, button;
tap = function(){
var d, url;
inc("/_shared/logNewList/log")({
event: "startImage",
type: "demo"
});
button.css({
pointerEvents: "none"
});
d = inc("calcDemoImage/calc")(page);
url = "https://images.solocode.com/image/small?imageId=" + d.id;
return inc("getImageBlobUrl/get")({
url: url,
onDone: function(blobUrl){
var fileName;
fileName = "demo_" + d.id;
return page.onDone(blobUrl, fileName, d.cropParams);
},
onError: function(){
inc("/_shared/logNewList/log")({
event: "demoScanError",
url: url,
isOnline: inc("/../app01/lib/util/isOnline/isOnline")()
});
button.css({
pointerEvents: ""
});
return inc("/../app01/lib/gui/errorPopup/popup")();
}
});
};
return button = inc("../_button/button")(T("demoImage"), path("/../app01/lib/svg/shape/image.svg")).tap(tap);
};
})();
pages/scan/01_chooseImage/buttons/demo/getImageBlobUrl/get.ls
(function(){
return function(p){
var load, onLoaded;
load = function(){
var xhr;
xhr = new XMLHttpRequest();
xhr.responseType = "blob";
xhr.onload = function(){
return onLoaded(xhr.response);
};
xhr.onerror = p.onError;
xhr.open("get", p.url);
return xhr.send();
};
onLoaded = function(blob){
var blobUrl;
blobUrl = URL.createObjectURL(blob);
return p.onDone(blobUrl);
};
return load();
};
})();
pages/scan/01_chooseImage/buttons/file/file.ls
(function(){
return function(page){
var tap;
tap = function(){
inc("/_shared/logNewList/log")({
event: "startImage"
}, "file");
return page.findFirst(".fileInput").selectFile();
};
return inc("../_button/button")(T("useImage"), path("/../app01/lib/svg/shape/folder-open.svg")).tap(tap);
};
})();
pages/scan/01_chooseImage/buttons/mobileCamera/camera.ls
(function(){
return function(page){
var tap;
tap = function(){
inc("/_shared/logNewList/log")({
event: "startImage",
type: "mobileCamera"
});
return inc("../_getMobilePicture/get")(page, 1);
};
return inc("../_button/button")(T("useCamera"), path("/../app01/lib/svg/shape/camera.svg")).tap(tap);
};
})();
pages/scan/01_chooseImage/buttons/mobileLibrary/library.ls
(function(){
return function(page){
var tap;
tap = function(){
inc("/_shared/logNewList/log")({
event: "startImage",
type: "mobileLibrary"
});
return inc("../_getMobilePicture/get")(page, 0);
};
return inc("../_button/button")(T("chooseImage"), path("/../app01/lib/svg/shape/folder-open.svg")).tap(tap);
};
})();
pages/scan/01_chooseImage/buttons/webcam/start/start.ls
(function(){
return function(page){
var wrapperDiv, init, cleanup, onCancel, onError, onSuccess;
wrapperDiv = null;
init = function(){
var i$, ref$, len$, el, videoDiv;
for (i$ = 0, len$ = (ref$ = page.childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
el.hide();
}
page.append(wrapperDiv = Div().html(T("webcamTitle"), videoDiv = Div({
display: "flex",
width: "400px",
height: "400px",
margin: "1em auto 0",
background: Color.grey[400]
}).html(inc("/../app01/lib/gui/spinner/spinner")({
color: Color.grey[150]
}))).fadeIn());
return inc("/../gui-components/customImage/select/camera/webcam/webcam")({
div: videoDiv,
onError: onError,
onCancel: onCancel,
onSuccess: onSuccess,
svgPaths: {
close: path("/../app01/lib/svg/shape/cross.svg"),
camera: path("/../app01/lib/svg/shape/camera.svg")
}
});
};
cleanup = function(){
var i$, ref$, len$, el, results$ = [];
wrapperDiv.remove();
for (i$ = 0, len$ = (ref$ = page.childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
results$.push(el.fadeIn());
}
return results$;
};
onCancel = function(){
return cleanup();
};
onError = function(error){
inc("/_shared/logNewList/log")({
event: "webcamScanError",
error: error
});
inc("/../app01/lib/gui/errorPopup/popup")({
label: T("webcamError")
});
return cleanup();
};
onSuccess = function(base64, blobUrl){
var fileName;
wrapperDiv.empty();
fileName = "webcam_image";
return page.onDone(blobUrl, fileName);
};
return init();
};
})();
pages/scan/01_chooseImage/buttons/webcam/webcam.ls
(function(){
return function(page){
var tap;
tap = function(){
inc("/_shared/logNewList/log")({
event: "startImage",
type: "webcam"
});
return inc("start/start")(page);
};
return inc("../_button/button")(T("useWebcam"), path("/../app01/lib/svg/shape/camera.svg")).tap(tap);
};
})();
pages/scan/01_chooseImage/hiddenFields/dropZone/dropZone.ls
(function(){
return function(page, onSelected){
var div;
div = page.pageSpacer;
return inc("/../gui-components/fileInput/dropZone/dropZone")({
onSelected: onSelected,
imageOnly: true,
div: div,
onSetActive: function(){
if (!div.beforeActiveBackground) {
div.beforeActiveBackground = div.css("background");
}
return div.css({
background: Color.blue[50]
});
},
onSetInactive: function(){
return div.css({
background: div.beforeActiveBackground
});
}
});
};
})();
pages/scan/01_chooseImage/hiddenFields/fileInput/fileInput.ls
(function(){
return function(onSelected){
return inc("/../gui-components/fileInput/hiddenInput/hiddenInput")({
onSelected: onSelected,
imageOnly: true
}).addClass("fileInput");
};
})();
pages/scan/01_chooseImage/hiddenFields/hiddenFields.ls
(function(){
return function(page){
var onSelected;
onSelected = function(file){
var blobUrl, fileName;
if (!file) {
return;
}
blobUrl = URL.createObjectURL(file);
fileName = "desktop_file_" + file.name;
return page.onDone(blobUrl, fileName);
};
inc("dropZone/dropZone")(page, onSelected);
return Div().html(inc("fileInput/fileInput")(onSelected), inc("pasteDiv/pasteDiv")(onSelected));
};
})();
pages/scan/01_chooseImage/hiddenFields/pasteDiv/pasteDiv.ls
(function(){
return function(onSelected){
return inc("/../gui-components/fileInput/hiddenPasteDiv/hiddenPasteDiv")({
onSelected: onSelected
});
};
})();
pages/scan/01_chooseImage/onDone/calcBase64/calc.ls
(function(){
return function(image){
var c, ctx, imageData, d;
c = document.createElement("canvas");
c.width = image.width;
c.height = image.height;
ctx = c.getContext("2d");
ctx.drawImage(image, 0, 0, image.width, image.height);
imageData = ctx.getImageData(0, 0, c.width, c.height);
d = imageData.data;
inc("filters/grayscale")(d, 1);
inc("filters/contrast")(d, 1.4);
inc("filters/brightness")(d, 1.3);
ctx.putImageData(imageData, 0, 0);
return image.optimizedBase64 = c.toDataURL("image/png");
};
})();
pages/scan/01_chooseImage/onDone/calcBase64/filters/brightness.ls
(function(){
return function(d, amount){
var i$, to$, i, results$ = [];
for (i$ = 0, to$ = d.length; i$ < to$; i$ += 4) {
i = i$;
d[i + 0] *= amount;
d[i + 1] *= amount;
results$.push(d[i + 2] *= amount);
}
return results$;
};
})();
pages/scan/01_chooseImage/onDone/calcBase64/filters/contrast.ls
(function(){
return function(d, amount){
var i$, to$, i, results$ = [];
for (i$ = 0, to$ = d.length; i$ < to$; i$ += 4) {
i = i$;
d[i + 0] = ((d[i + 0] / 255 - 0.5) * amount + 0.5) * 255;
d[i + 1] = ((d[i + 1] / 255 - 0.5) * amount + 0.5) * 255;
results$.push(d[i + 2] = ((d[i + 2] / 255 - 0.5) * amount + 0.5) * 255);
}
return results$;
};
})();
pages/scan/01_chooseImage/onDone/calcBase64/filters/grayscale.ls
(function(){
return function(d, amount){
var i$, to$, i, luma, results$ = [];
for (i$ = 0, to$ = d.length; i$ < to$; i$ += 4) {
i = i$;
luma = d[i] * 0.2126 + d[i + 1] * 0.7152 + d[i + 2] * 0.0722;
d[i + 0] += (luma - d[i + 0]) * amount;
d[i + 1] += (luma - d[i + 1]) * amount;
results$.push(d[i + 2] += (luma - d[i + 2]) * amount);
}
return results$;
};
})();
pages/scan/01_chooseImage/onDone/onDone.ls
(function(){
return function(page, imageUrl, fileName, demoCropParams){
var i;
page.html(inc("/../app01/lib/gui/spinner/spinner")());
if (typeof page.resetLayout == 'function') {
page.resetLayout();
}
return i = Img().attr({
src: imageUrl,
crossOrigin: "anonymous"
}).bind("load", function(){
var p;
inc("calcBase64/calc")(i);
i.originalImageFileName = fileName;
i.originalImageUrl = imageUrl;
i.originalWidth = i.width;
i.originalHeight = i.height;
i.rotate = 0;
app.scanImage = i;
p = page.params;
inc("/_shared/logNewList/log")({
event: "continueImage",
width: i.width,
height: i.height
});
return startPage({
path: path("../../02_cropImage/page"),
animation: "none",
params: {
context: p.context,
listType: p.listType,
listCode: p.listCode,
cropParams: demoCropParams
}
});
});
};
})();
pages/scan/01_chooseImage/page.ls
(function(){
return function(page){
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
page.onDone = function(imageUrl, fileName, cropParams){
return inc("onDone/onDone")(page, imageUrl, fileName, cropParams);
};
page.css({
maxWidth: "90%",
width: "35em",
margin: "0 auto"
});
return page.html(inc("hiddenFields/hiddenFields")(page), inc("text1/text")(page), inc("buttons/buttons")(page), inc("text2/text")());
}
};
};
})();
pages/scan/01_chooseImage/text1/text.ls
(function(){
return function(page){
return Div({
lineHeight: "1.5em",
maxWidth: "22em",
margin: "0 auto"
}).html(page.params.context === "newList"
? T("text1NewList")
: T("text1AddItems"));
};
})();
pages/scan/01_chooseImage/text2/text.ls
(function(){
return function(){
if (!inc("/../app01/lib/util/isDesktop/isDesktop")()) {
return;
}
return Div({
width: "30em",
maxWidth: "90%",
margin: "0 auto",
lineHeight: "1.5em",
fontSize: "0.9em",
color: Color.grey[500]
}).html(T("dropInfo"));
};
})();
pages/scan/02_cropImage/_t.ls
(function(){
return {
selectArea: {
de: "Wähle den Bereich aus",
en: "Select an area",
fr: "Sélectionne une zone",
es: "Selecciona el área",
pt: "Selecione a área"
},
cropWarning: {
de: "Bitte wähle einen gültigen Bereich aus.",
en: "Please select a valid area.",
fr: "Tu dois sélectionner une zone valide.",
es: "Selecciona un área válida.",
pt: "Por favor, selecione uma área válida."
},
errorImageMinSize: {
de: "Das Bild muss mindestens 50x50 px groß sein.",
en: "The image must be at least 50x50 pixels.",
fr: "L'image doit faire au moins 50x50 pixels.",
es: "La imagen debe tener por lo menos 50x50 pixeles.",
pt: "A imagem deve ter pelo menos 50x50 pixels de tamanho."
}
};
})();
pages/scan/02_cropImage/_topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: T("selectArea"),
topRightCustom: function(){
return inc("../../00_shared/topZoom/zoom")(page);
},
back: function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
}
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/scan/02_cropImage/bottom/bottom.ls
(function(){
return function(page){
return Div({
display: "flex",
padding: "0.8em",
height: "3.5em"
}).html(_.startsWith(page.params.listType, "spell")
? inc("buttonProcess/button")(page)
: inc("buttonContinue/button")(page), inc("buttonRotate/button")(page));
};
})();
pages/scan/02_cropImage/bottom/buttonContinue/button.ls
(function(){
return function(page){
var tap;
tap = function(){
var p, cp;
p = page.params;
cp = p.cropParams;
if (cp.width < 50 || cp.height < 50) {
inc("/../app01/lib/gui/errorPopup/popup")({
label: T("errorImageMinSize")
});
return;
}
inc("/_shared/logNewList/log")({
event: "cropParams",
cropParams: _.clone(cp),
rotate: p.rotate
});
return startPage({
path: path("../../../03_splitImage/page"),
animation: "none",
params: {
cropParams: cp,
context: p.context,
listType: p.listType,
listCode: p.listCode
}
});
};
return Button(T("continueButton")).tap(tap);
};
})();
pages/scan/02_cropImage/bottom/buttonProcess/button.ls
(function(){
return function(page){
return inc("../../../00_shared/bottomButtonProcess/button")(page);
};
})();
pages/scan/02_cropImage/bottom/buttonRotate/button.ls
(function(){
return function(page){
var tap;
tap = function(){
return inc("rotate/rotate")(page);
};
return Div({
display: "flex",
position: "absolute",
right: 0,
top: 0,
bottom: 0,
padding: "0 1em 0.3em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/icon/rotate-right.svg"),
color: Color.blue[700],
size: "1.4em"
})).tap(tap);
};
})();
pages/scan/02_cropImage/bottom/buttonRotate/rotate/rotate.ls
(function(){
return function(page){
var r, h, cpOld, cp;
r = app.scanImage.rotate + 90;
if (r === 360) {
r = 0;
}
app.scanImage.rotate = r;
h = r === 90 || r === 270
? app.scanImage.originalHeight
: app.scanImage.originalWidth;
cpOld = page.params.cropParams;
cp = {};
cp.x1 = h - cpOld.y2;
cp.x2 = h - cpOld.y1;
cp.y1 = cpOld.x1;
cp.y2 = cpOld.x2;
cp.width = cp.x2 - cp.x1;
cp.height = cp.y2 - cp.y1;
page.params.cropParams = cp;
page.sourceImage.update();
return page.zoomDiv.setScale(page.zoomDiv.getCurrentScale());
};
})();
pages/scan/02_cropImage/cropPoints/corner/corner.ls
(function(){
return function(type, page){
var cp, cpStart, s, x, y, update, onDrag, div, icon, dragParams;
cp = page.params.cropParams;
cpStart = null;
s = page.zoomDiv.getCurrentScale();
x = 0;
y = 0;
update = function(){
x = type === 1 || type === 4
? cp.x1
: cp.x2;
y = type === 1 || type === 2
? cp.y1
: cp.y2;
div.css({
left: x * s + "px",
top: y * s + "px",
transform: ""
});
return icon.setColor(page.cropDragActive
? Color.blue[900]
: Color.blue[600]);
};
onDrag = function(o){
var t;
t = o.translation;
if (type === 1 || type === 4) {
cp.x1 = cpStart.x1 + t.x / s;
} else {
cp.x2 = cpStart.x2 + t.x / s;
}
if (type === 1 || type === 2) {
cp.y1 = cpStart.y1 + t.y / s;
} else {
cp.y2 = cpStart.y2 + t.y / s;
}
return page.cropUpdate();
};
div = Div({
position: "absolute",
pointerEvents: "auto",
opacity: "0.5",
zIndex: 1
}).addClass("update").html(icon = inc("icon/icon")(type)).drag(dragParams = {
tapZone: "1.5em",
onMove: onDrag,
onStart: function(){
cpStart = _.clone(cp);
page.cropDragActive = true;
return page.cropUpdate();
},
onEnd: function(o){
page.cropDragActive = false;
return page.cropUpdate();
}
}).css({
cursor: type === 1 || type === 3 ? "nwse-resize" : "nesw-resize"
}).onDomAppend(function(){
return dragParams.boundingDiv = div.parent();
}).bind("touchstart", function(e){
return e.preventDefault();
}).bind("touchmove", function(e){
return e.preventDefault();
});
div.update = update;
return div;
};
})();
pages/scan/02_cropImage/cropPoints/corner/icon/corner.svg
pages/scan/02_cropImage/cropPoints/corner/icon/icon.ls
(function(){
return function(type){
return SvgIcon({
svg: path("corner.svg"),
color: Color.grey[400],
size: "20px"
}).css({
position: "absolute",
top: "-10px",
left: "-10px",
transform: "rotate(" + (type - 1) * 90 + "deg)"
});
};
})();
pages/scan/02_cropImage/cropPoints/frame/frame.ls
(function(){
return function(page){
var cp, update, div, div2;
cp = page.params.cropParams;
update = function(){
var s, css;
s = page.zoomDiv.getCurrentScale();
return div2.css(css = {
left: cp.x1 * s + "px",
width: (cp.x2 - cp.x1) * s + "px",
top: cp.y1 * s + "px",
height: (cp.y2 - cp.y1) * s + "px"
});
};
div = Div({
position: "absolute",
left: 0,
right: 0,
top: 0,
bottom: 0,
overflow: "hidden"
}).addClass("update").html(div2 = Div({
position: "absolute",
opacity: "0.8",
outline: "1000px solid " + Color.grey[150]
}));
div.update = update;
return div;
};
})();
pages/scan/02_cropImage/cropPoints/line/line.ls
(function(){
return function(type, page){
var cp, cpStart, s, x, y, h, w, lineWidth, update, onDrag, div, dragParams;
cp = page.params.cropParams;
cpStart = null;
s = page.zoomDiv.getCurrentScale();
x = 0;
y = 0;
h = 0;
w = 0;
lineWidth = 3;
update = function(){
x = type === 1 || type === 3 || type === 4
? cp.x1 * s
: cp.x2 * s - lineWidth;
y = type === 1
? cp.y1 * s
: type === 2 || type === 4
? cp.y1 * s + lineWidth
: cp.y2 * s - lineWidth;
w = type === 1 || type === 3 ? cp.x2 * s - cp.x1 * s : lineWidth;
h = type === 2 || type === 4 ? cp.y2 * s - cp.y1 * s - lineWidth * 2 : lineWidth;
div.css({
left: x + "px",
top: y + "px",
width: w + "px",
height: h + "px",
transform: ""
});
return div.css({
background: page.cropDragActive
? Color.blue[900]
: Color.blue[600]
});
};
onDrag = function(o){
var t;
t = o.translation;
if (type === 1) {
cp.y1 = cpStart.y1 + t.y / s;
} else if (type === 2) {
cp.x2 = cpStart.x2 + t.x / s;
} else if (type === 3) {
cp.y2 = cpStart.y2 + t.y / s;
} else if (type === 4) {
cp.x1 = cpStart.x1 + t.x / s;
}
return page.cropUpdate();
};
div = Div({
position: "absolute",
pointerEvents: "auto",
opacity: "0.5"
}).addClass("update").drag(dragParams = {
tapZone: "1.5em",
onMove: onDrag,
onStart: function(){
cpStart = _.clone(cp);
page.cropDragActive = true;
return page.cropUpdate();
},
onEnd: function(o){
page.cropDragActive = false;
return page.cropUpdate();
}
}).css({
cursor: type === 1 || type === 3 ? "ns-resize" : "ew-resize"
}).onDomAppend(function(){
return dragParams.boundingDiv = div.parent();
}).bind("touchstart", function(e){
return e.preventDefault();
}).bind("touchmove", function(e){
return e.preventDefault();
});
div.update = update;
return div;
};
})();
pages/scan/02_cropImage/cropPoints/points.ls
(function(){
return function(page){
var ref$, div, i;
page.cropDragActive = false;
(ref$ = page.params).cropParams == null && (ref$.cropParams = {
x1: 0,
y1: 0,
x2: page.sourceImage.offsetWidth,
y2: page.sourceImage.offsetHeight
});
page.cropUpdate = function(){
var i$, ref$, len$, el, cp, n, v, results$ = [];
for (i$ = 0, len$ = (ref$ = div.findAll(".update")).length; i$ < len$; ++i$) {
el = ref$[i$];
el.update();
}
cp = page.params.cropParams;
cp.x = cp.x1;
cp.width = cp.x2 - cp.x1;
cp.y = cp.y1;
cp.height = cp.y2 - cp.y1;
for (n in cp) {
v = cp[n];
results$.push(cp[n] = _.round(v));
}
return results$;
};
div = Div({
position: "absolute",
width: "100%",
height: "100%",
pointerEvents: "none"
}).html(inc("frame/frame")(page), (function(){
var i$, results$ = [];
for (i$ = 1; i$ <= 4; ++i$) {
i = i$;
results$.push(inc("line/line")(i, page));
}
return results$;
}()), (function(){
var i$, results$ = [];
for (i$ = 1; i$ <= 4; ++i$) {
i = i$;
results$.push(inc("corner/corner")(i, page));
}
return results$;
}()));
page.cropUpdate();
return page.cropPoints = div;
};
})();
pages/scan/02_cropImage/image/image.ls
(function(){
return function(page){
var f, image;
f = function(){
page.zoomDiv.fitScale({
minMarginX: 25,
minMarginY: 25
});
return page.zoomDiv.fadeIn();
};
image = inc("../../00_shared/rotatedImage/image")(f);
image.update = function(){
return image.replaceWith(inc(THISFILE)(page));
};
return page.sourceImage = image;
};
})();
pages/scan/02_cropImage/page.ls
(function(){
return function(page){
return {
top: function(){
return inc("_topbar/topbar")(page);
},
bottom: function(){
return inc("bottom/bottom")(page);
},
start: function(){
var onZoom, z;
onZoom = function(){
return page.zoomDiv.overlayScaledDiv.html(inc("cropPoints/points")(page));
};
page.pageSpacer.css({
background: Color.grey[150]
});
z = ZoomDiv({
contentHtml: inc("image/image")(page),
onZoom: onZoom,
contentMargin: "1em",
scrollbarMode: "hide",
minScale: 0.1,
maxScale: 2
}).css({
height: "var(--centerHeight)",
width: "100%"
});
return page.html(page.zoomDiv = z);
}
};
};
})();
pages/scan/03_splitImage/_t.ls
(function(){
return {
title: {
de: "Positioniere den Spaltentrenner",
en: "Position the column divider",
fr: "Positionne le séparateur de colonne",
es: "Posiciona el separador de columnas",
pt: "Posicionar o divisor de coluna"
}
};
})();
pages/scan/03_splitImage/_topbar/buttonDone/button.ls
(function(){
return function(page){
return Div({
fontSize: "0.9em",
color: Color.blue[700],
padding: "0.3em 0.8em"
}).html(T("done"));
};
})();
pages/scan/03_splitImage/_topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: T("title"),
topRightCustom: function(){
return inc("../../00_shared/topZoom/zoom")(page);
},
back: function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
}
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/scan/03_splitImage/imageCropped/image.ls
(function(){
return function(page){
var cp, f;
cp = page.params.cropParams;
f = function(){
page.zoomDiv.fitScale({
minMarginX: 25,
minMarginY: 25
});
return page.zoomDiv.fadeIn();
};
return Div({
width: cp.width + "px",
height: cp.height + "px",
overflow: "hidden"
}).html(inc("../../00_shared/rotatedImage/image")(f).css({
left: -cp.x + "px",
top: -cp.y + "px"
}));
};
})();
pages/scan/03_splitImage/page.ls
(function(){
return function(page){
return {
top: function(){
return inc("_topbar/topbar")(page);
},
bottom: function(){
return inc("../00_shared/bottomButtonProcess/button")(page, true);
},
start: function(){
var onZoom, z;
onZoom = function(){
return page.zoomDiv.overlayScaledDiv.html(inc("splitter/splitter")(page));
};
page.pageSpacer.css({
background: Color.grey[150]
});
z = ZoomDiv({
contentHtml: inc("imageCropped/image")(page),
onZoom: onZoom,
contentMargin: "1em",
scrollbarMode: "hide",
minScale: 0.1,
maxScale: 2
}).css({
height: "var(--centerHeight)",
width: "100%"
}).fadeIn(800);
return page.html(page.zoomDiv = z);
}
};
};
})();
pages/scan/03_splitImage/splitter/bar/bar.ls
(function(){
return function(pos){
return Div({
position: "absolute",
left: "-11px",
width: "25px",
height: "12px",
background: Color.blue[700]
});
};
})();
pages/scan/03_splitImage/splitter/onMove/on.ls
(function(){
return function(e, div, page){
var x, o, pos, splitPos;
if (!div.parent()) {
return;
}
x = div.offset().left;
o = div.parent().offset();
pos = _.round((x - o.left) / o.width * 100);
splitPos = _.round((x - o.left) / o.width, 2);
return page.params.splitPosition = splitPos;
};
})();
pages/scan/03_splitImage/splitter/splitter.ls
(function(){
return function(page){
var ref$, setColor, div, b1, b2, dragParams;
(ref$ = page.params).splitPosition == null && (ref$.splitPosition = 0.5);
setColor = function(t){
var c;
c = t
? Color.blue[900]
: Color.blue[600];
div.css({
background: c
});
b1.css({
background: c
});
return b2.css({
background: c
});
};
div = Div({
position: "absolute",
top: 0,
bottom: 0,
height: "100%",
width: "4px",
marginLeft: "-2px",
left: page.params.splitPosition * 100 + "%",
opacity: "0.4",
pointerEvents: "auto"
}).addClass("splitter").html(b1 = inc("bar/bar")().css({
top: "-12px"
}), b2 = inc("bar/bar")().css({
bottom: "-12px"
})).drag(dragParams = {
dragDirection: "horizontal",
tapZone: "2em",
onStart: function(){
return setColor(true);
},
onEnd: function(){
return setColor(false);
},
onMove: function(e){
return inc("onMove/on")(e, div, page);
}
}).css({
cursor: "grab"
}).onDomAppend(function(){
return dragParams.boundingDiv = div.parent();
}).bind("touchstart", function(e){
return e.preventDefault();
}).bind("touchmove", function(e){
return e.preventDefault();
});
setColor();
return div;
};
})();
pages/scan/04_editor/_topbar/_t.ls
(function(){
return {
title: {
de: "Bearbeite die Einträge",
en: "Edit the entries",
fr: "Modifier les entrées",
es: "Edita las entradas",
pt: "Editar as entradas"
}
};
})();
pages/scan/04_editor/_topbar/onBack/_t.ls
(function(){
return {
confirmPopup: {
de: "Möchtest du zurückgehen?
Deine Änderungen gehen dann verloren.",
en: "Would you like to go back?
Your changes will be lost.",
fr: "Veux-tu vraiment revenir en arrière ?
Tes modifications seront alors perdues.",
es: "¿Quieres volver atrás?
Tus cambios se perderán.",
pt: "Tem certeza que deseja voltar?
Suas alterações serão perdidas."
},
cancelButton: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
},
backButton: {
de: "Zurückgehen",
en: "Go back",
fr: "Revenir en arrière",
es: "Volver atrás",
pt: "Voltar"
}
};
})();
pages/scan/04_editor/_topbar/onBack/on.ls
(function(){
return function(page){
var go, items;
go = function(){
inc("/_shared/logNewList/log")({
event: "back"
});
return startPage({
history: -1,
animation: "slideRight"
});
};
items = page.calcItems();
if (_.isEqual(items, page.itemsOriginal)) {
go();
return;
}
return inc("/../app01/lib/gui/confirmPopup/popup")({
label: T("confirmPopup"),
yesLabel: T("backButton"),
noLabel: T("cancelButton"),
onConfirm: go
});
};
})();
pages/scan/04_editor/_topbar/topRightCustom/buttonDone/button.ls
(function(){
return function(page){
var tap, div;
tap = function(){
page.items = page.calcItems();
inc("/../app01/lib/util/cache/set/set")("listItems", page.items);
return inc("/pages/learnList/editor/_shared/submitEditedItems/submit")(page);
};
div = Div({
fontSize: "0.9em",
color: Color.blue[700],
padding: "0.3em 0.8em"
}).html(T("continueButton")).tap(tap);
div.tapButton = tap;
return page.buttonDone = div;
};
})();
pages/scan/04_editor/_topbar/topRightCustom/custom.ls
(function(){
return function(page){
return Div().html(inc("topErrorCounter/counter")(page), inc("buttonDone/button")(page));
};
})();
pages/scan/04_editor/_topbar/topRightCustom/topErrorCounter/_t.ls
(function(){
return {
correctError: {
de: "Bitte korrigiere ((den Fehler | die $1 Fehler)).",
en: "Please correct ((the mistake | the $1 mistakes)).",
fr: "Merci de corriger ((l’erreur | les $1 erreurs)).",
es: "Por favor, corrige ((el error | los $1 errores)).",
pt: "Por favor, corrija ((o erro | os $1 erros))."
}
};
})();
pages/scan/04_editor/_topbar/topRightCustom/topErrorCounter/calcTotalErrors/calc.ls
(function(){
return function(page){
var items, ref$;
items = ((ref$ = page.list) != null ? ref$.o.data : void 8) || [];
return _.filter(items, function(i){
return i.error != null;
}).length;
};
})();
pages/scan/04_editor/_topbar/topRightCustom/topErrorCounter/counter.ls
(function(){
return function(page){
var totalErrors, tap, div, ref$, ref1$;
totalErrors = inc("calcTotalErrors/calc")(page);
tap = function(){
return page.buttonDone.tapButton();
};
div = Div({
fontSize: "0.9em",
color: Color.red[700],
padding: "0.3em 0.8em"
}).html(totalErrors >= 1 ? T("correctError", totalErrors) : void 8).tap({
up: tap,
tapZone: "0.5em"
});
if (totalErrors === 0) {
if ((ref$ = page.buttonDone) != null) {
ref$.show();
}
div.hide();
} else {
if ((ref1$ = page.buttonDone) != null) {
ref1$.hide();
}
div.show();
}
page.updateTopErrorCounter = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return div;
};
})();
pages/scan/04_editor/_topbar/topbar.ls
(function(){
return function(page){
return inc("/../app01/addons/topbar2/topbar")({
title: T("title"),
topRightCustom: function(){
return inc("topRightCustom/custom")(page);
},
back: function(){
return inc("onBack/on")(page);
}
}).prepend(inc("/pages/_shared/topbarAbortScan/bar")());
};
})();
pages/scan/04_editor/calcItems/calc.ls
(function(){
return function(page){
var items, res$, i$, ref$, len$, i, ref1$;
res$ = [];
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
i = ref$[i$];
if ((ref1$ = i.rowType) === "header" || ref1$ === "footer") {
continue;
} else if (_.startsWith(page.listType, "spell")) {
res$.push({
rowIndex: i.rowIndex,
a: i.a
});
} else {
res$.push({
rowIndex: i.rowIndex,
a: i.a,
b: i.b
});
}
}
items = res$;
for (i$ = 0, len$ = items.length; i$ < len$; ++i$) {
i = items[i$];
if ((ref$ = i.a) != null && ref$.text) {
i.a.text = i.a.text.trim();
}
if ((ref1$ = i.b) != null && ref1$.text) {
i.b.text = i.b.text.trim();
}
}
items = _.filter(items, function(i){
var ref$, ref1$, ref2$, ref3$;
return ((ref$ = i.a) != null ? (ref1$ = ref$.text) != null ? ref1$.length : void 8 : void 8) > 0 || ((ref2$ = i.b) != null ? (ref3$ = ref2$.text) != null ? ref3$.length : void 8 : void 8) > 0;
});
return items;
};
})();
pages/scan/04_editor/calcScanData/calc.ls
(function(){
return function(page){
var sd, items, res$, i$, ref$, len$, i;
sd = _.cloneDeep(app.scanData);
sd.gridRows = inc("calcGridRows/calc")(sd, page);
sd.itemsOriginal = inc("calcItems/calc")(sd.gridRows);
sd.items = _.cloneDeep(sd.itemsOriginal);
res$ = [];
for (i$ = 0, len$ = (ref$ = sd.itemsOriginal).length; i$ < len$; ++i$) {
i = ref$[i$];
if (i.rowType) {
continue;
}
res$.push(_.omit(i, "rowIndex"));
}
items = res$;
inc("/_shared/logNewList/log")({
event: "ocrItems",
imageHash: app.scanData.imageHash,
scanId: app.scanData.scanId,
items: items,
totalItems: items.length
});
return sd;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calc.ls
(function(){
return function(scanData, page){
var splitPosition, splitX, rows, i$, len$, r, j$, ref$, len1$, w, gridRows, res$, i;
splitPosition = scanData.splitPosition;
splitX = scanData.cropParams.width * splitPosition;
rows = inc("calcRowsScan2/calc")(scanData);
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
r = rows[i$];
r.wordsLeft = [];
r.wordsRight = [];
for (j$ = 0, len1$ = (ref$ = r.words).length; j$ < len1$; ++j$) {
w = ref$[j$];
if (w.x < splitX) {
w.columnIndex = 0;
r.wordsLeft.push(w);
} else {
w.columnIndex = 1;
r.wordsRight.push(w);
}
}
}
if (!_.startsWith(page.params.listType, "spell")) {
rows = inc("mergeSingleColumnRows/merge")(rows);
}
res$ = [];
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
i = i$;
r = rows[i$];
res$.push({
rowIndex: i,
rowType: "newItem",
words: _.concat(r.wordsLeft, r.wordsRight),
cells: [
{
columnIndex: 0,
value: _.map(r.wordsLeft, "value").join(" "),
words: r.wordsLeft
}, {
columnIndex: 1,
value: _.map(r.wordsRight, "value").join(" "),
words: r.wordsRight
}
]
});
}
gridRows = res$;
gridRows = _.filter(gridRows, function(r){
return r.words.length > 0;
});
for (i$ = 0, len$ = gridRows.length; i$ < len$; ++i$) {
r = gridRows[i$];
r.x = _.minBy(r.words, "x").x;
r.x2 = _.maxBy(r.words, "x2").x2;
r.y = _.minBy(r.words, "y").y;
r.y2 = _.maxBy(r.words, "y2").y2;
r.width = r.x2 - r.x;
r.height = r.y2 - r.y;
}
gridRows = inc("mergeIndentedRows/merge")(gridRows);
inc("cleanupValues/cleanup")(gridRows);
return gridRows;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calcRowsScan2/calc.ls
(function(){
return function(scanData){
var lines, prevLine, i$, len$, i, l, rows, currentRow, line, row, j$, ref$, len1$, k$, ref1$, len2$, word;
lines = scanData.ocrData.lines;
prevLine = undefined;
for (i$ = 0, len$ = lines.length; i$ < len$; ++i$) {
i = i$;
l = lines[i$];
inc("calcRotatedBoundingBox/calc")(l.boundingBox, scanData);
inc("calcPositionFromBoundingBox/calc")(l);
if (i === 0) {
l.isRight = false;
l.overlapY = false;
prevLine = l;
continue;
}
l.overlapY = inc("calcOverlapY/calc")(l, prevLine);
l.overlapX = inc("calcOverlapX/calc")(l, prevLine);
prevLine = l;
}
rows = [];
currentRow = {
rowIndex: 0,
lines: []
};
rows.push(currentRow);
for (i$ = 0, len$ = lines.length; i$ < len$; ++i$) {
i = i$;
line = lines[i$];
if (i === 0) {
currentRow.lines.push(line);
} else if (line.overlapY && !line.overlapX) {
currentRow.lines.push(line);
} else {
currentRow = {
rowIndex: currentRow.rowIndex + 1,
lines: [line]
};
rows.push(currentRow);
}
}
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
i = i$;
row = rows[i$];
row.words = [];
for (j$ = 0, len1$ = (ref$ = row.lines).length; j$ < len1$; ++j$) {
line = ref$[j$];
for (k$ = 0, len2$ = (ref1$ = line.words).length; k$ < len2$; ++k$) {
word = ref1$[k$];
inc("calcPositionFromBoundingBox/calc")(word);
word.rowIndex = i;
word.value = word.text;
row.words.push(word);
}
}
}
return rows;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calcRowsScan2/calcOverlapX/calc.ls
(function(){
return function(l1, l2){
var left, right;
if (l2.x > l1.x) {
left = l1;
right = l2;
} else {
left = l2;
right = l1;
}
if (left.b.x >= right.a.x && left.b.x <= right.b.x) {
return true;
}
if (right.a.x >= left.a.x && right.a.x <= left.b.x) {
return true;
}
return false;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calcRowsScan2/calcOverlapY/calc.ls
(function(){
return function(l1, l2){
var left, right;
if (l2.x > l1.x) {
left = l1;
right = l2;
} else {
left = l2;
right = l1;
}
if (left.b.y >= right.a.y && left.b.y <= right.d.y) {
return true;
}
if (right.a.y >= left.b.y && right.a.y <= left.c.y) {
return true;
}
return false;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calcRowsScan2/calcPositionFromBoundingBox/calc.ls
(function(){
return function(o){
var b, position, k, v;
b = o.boundingBox;
position = {
x: b[0],
x2: b[2],
y: b[1],
y2: b[5],
width: b[2] - b[0],
height: b[5] - b[1],
a: {
x: b[0],
y: b[1]
},
b: {
x: b[2],
y: b[3]
},
c: {
x: b[4],
y: b[5]
},
d: {
x: b[6],
y: b[7]
}
};
for (k in position) {
v = position[k];
o[k] = v;
}
delete o.boundingBox;
return o;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/calcRowsScan2/calcRotatedBoundingBox/calc.ls
(function(){
return function(boundingBox, scanData){
var angle, width, height, angleRad, rotate, b, r;
angle = -scanData.ocrData.angle;
width = scanData.ocrData.width;
height = scanData.ocrData.height;
angleRad = angle * Math.PI / 180;
rotate = function(x, y){
var x2, y2;
x = x - width / 2;
y = y - height / 2;
x2 = _.round(x * Math.cos(angleRad) - y * Math.sin(angleRad));
y2 = _.round(y * Math.cos(angleRad) + x * Math.sin(angleRad));
x = x2 + width / 2;
y = y2 + height / 2;
return {
x: x,
y: y
};
};
b = boundingBox;
r = rotate(b[0], b[1]);
b[0] = r.x;
b[1] = r.y;
r = rotate(b[2], b[3]);
b[2] = r.x;
b[3] = r.y;
r = rotate(b[4], b[5]);
b[4] = r.x;
b[5] = r.y;
r = rotate(b[6], b[7]);
b[6] = r.x;
return b[7] = r.y;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/cleanupValues/cleanup.ls
(function(){
return function(gridRows){
var i$, len$, r, lresult$, j$, ref$, len1$, cell, v, results$ = [];
for (i$ = 0, len$ = gridRows.length; i$ < len$; ++i$) {
r = gridRows[i$];
lresult$ = [];
for (j$ = 0, len1$ = (ref$ = r.cells).length; j$ < len1$; ++j$) {
cell = ref$[j$];
v = cell.value;
v = inc("cleanupBrackets/cleanup")(v);
v = inc("cleanupDoubleSlash/cleanup")(v);
v = inc("cleanupIgnoreChar/cleanup")(v);
v = _.trim(v);
cell.valueClean = v;
if (v !== cell.value) {
lresult$.push(r.isCleaned = true);
}
}
results$.push(lresult$);
}
return results$;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/cleanupValues/cleanupBrackets/cleanup.ls
(function(){
return function(value){
var t, v, i$, len$, s, a, a2, i, v2;
t = "|";
v = value;
for (i$ = 0, len$ = ("([{").length; i$ < len$; ++i$) {
s = ("([{")[i$];
v = v.split(s).join(t + s);
}
for (i$ = 0, len$ = (")]}").length; i$ < len$; ++i$) {
s = (")]}")[i$];
v = v.split(s).join(s + t);
}
a = v.split(t);
if (a.length === 1) {
return value;
}
a2 = [];
for (i$ = 0, len$ = a.length; i$ < len$; ++i$) {
i = i$;
s = a[i$];
if (_.first(s) === "(" && _.last(s) === ")") {
a2.push(s);
} else if (s.length > 0 && !in$(_.first(s), "([{") && !in$(_.last(s), ")]}")) {
a2.push(s);
} else {
a2.push("");
}
}
v2 = a2.join(" ");
v2 = v2.replace(/ +(?= )/g, '');
return v2 = v2.trim();
};
})();
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
pages/scan/04_editor/calcScanData/calcGridRows/cleanupValues/cleanupDoubleSlash/cleanup.ls
(function(){
return function(value){
var a, totalSlashs, v2;
if (!_.endsWith(value, "/")) {
return value;
}
a = value.split("/");
totalSlashs = a.length - 1;
if (totalSlashs % 2 !== 0) {
return value;
}
a[a.length - 2] = "";
v2 = a.join(" ");
v2 = v2.replace(/ +(?= )/g, '');
return v2 = v2.trim();
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/cleanupValues/cleanupIgnoreChar/cleanup.ls
(function(){
return function(v){
return v = _.replaceAll(v, "→", "");
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/mergeIndentedRows/isIndented/is.ls
(function(){
return function(cell, prevCell){
var hPrev, minYPrev, minY, isNearBelow, minXPrev, minX, isIndented;
if (cell.words.length === 0 || prevCell.words.length === 0) {
return;
}
hPrev = _.maxBy(prevCell.words, "height").height;
minYPrev = _.minBy(prevCell.words, "y").y;
minY = _.minBy(cell.words, "y").y;
isNearBelow = minY < minYPrev + hPrev * 2;
if (!isNearBelow) {
return false;
}
minXPrev = _.minBy(prevCell.words, "x").x;
minX = _.minBy(cell.words, "x").x;
isIndented = minX > minXPrev + hPrev * 1;
if (!isIndented) {
return false;
}
return true;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/mergeIndentedRows/merge.ls
(function(){
return function(gridRows){
var i$, len$, i, row, prevRow, isIndentedLeft, isIndentedRight;
for (i$ = 0, len$ = gridRows.length; i$ < len$; ++i$) {
i = i$;
row = gridRows[i$];
if (i === 0) {
prevRow = row;
continue;
}
isIndentedLeft = inc("isIndented/is")(row.cells[0], prevRow.cells[0]);
isIndentedRight = inc("isIndented/is")(row.cells[1], prevRow.cells[1]);
if (!isIndentedLeft && !isIndentedRight) {
prevRow = row;
continue;
}
inc("mergeRows/merge")(row, prevRow);
delete gridRows[i];
}
return _.compact(gridRows);
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/mergeIndentedRows/mergeRows/merge.ls
(function(){
return function(row, prevRow){
var c, c1;
c = prevRow.cells[0];
c1 = row.cells[0];
c.words = _.concat(c.words, c1.words);
c.value = _.map(c.words, "value").join(" ");
c = prevRow.cells[1];
c1 = row.cells[1];
c.words = _.concat(c.words, c1.words);
c.value = _.map(c.words, "value").join(" ");
return prevRow.isMerged = true;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/mergeSingleColumnRows/merge.ls
(function(){
return function(rows){
var i$, len$, i, r, rLast;
for (i$ = 0, len$ = rows.length; i$ < len$; ++i$) {
i = i$;
r = rows[i$];
if (i === 0) {
continue;
}
rLast = rows[i - 1];
if (r.wordsLeft.length === 0 && r.wordsRight.length > 0) {
inc("mergeRows/merge")(rLast, r);
}
if (r.wordsRight.length === 0 && r.wordsLeft.length > 0) {
inc("mergeRows/merge")(rLast, r);
}
}
return rows;
};
})();
pages/scan/04_editor/calcScanData/calcGridRows/mergeSingleColumnRows/mergeRows/merge.ls
(function(){
return function(rLast, r){
rLast.wordsLeft = _.concat(rLast.wordsLeft, r.wordsLeft);
rLast.wordsRight = _.concat(rLast.wordsRight, r.wordsRight);
r.wordsLeft = [];
return r.wordsRight = [];
};
})();
pages/scan/04_editor/calcScanData/calcItems/calc.ls
(function(){
return function(gridRows){
var items, r;
return items = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = gridRows).length; i$ < len$; ++i$) {
r = ref$[i$];
results$.push({
rowIndex: r.rowIndex,
a: {
text: r.cells[0].valueClean
},
b: {
text: r.cells[1].valueClean
}
});
}
return results$;
}());
};
})();
pages/scan/04_editor/image/image.ls
(function(){
return function(page){
var cp, setScale;
cp = page.scanData.cropParams;
setScale = function(){
var w;
w = page.list.findFirst(".listRow").offsetWidth;
return page.zoomDiv.fitScale({
maxWidth: w,
minMarginX: 0,
minMarginY: "ignore"
});
};
return page.sourceImage = Div({
width: cp.width + "px",
height: cp.height + "px",
overflow: "hidden"
}).html(inc("../../00_shared/rotatedImage/image")(setScale).css({
position: "absolute",
left: -cp.x + "px",
top: -cp.y + "px",
pointerEvents: "none"
}));
};
})();
pages/scan/04_editor/list/list.ls
(function(){
return function(page){
var data, list;
data = _.concat({
rowType: "header"
}, page.items, {
rowType: "footer"
});
list = ListDiv({
data: data,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
}
}).css({
height: "calc(var(--centerHeight)*0.7)",
background: "white",
borderTop: "1px solid " + Color.grey[300]
});
list.selectRow = function(i){
return inc("selectRow/select")(i, list, page);
};
return page.list = list;
};
})();
pages/scan/04_editor/list/row/_t.ls
(function(){
return {
emptyLineBefore: {
de: "Leere Zeile darüber einfügen",
en: "Add new entry above",
fr: "Ajouter une ligne vide ci-dessus",
es: "Agregar fila vacía en la parte superior",
pt: "Adicionar linha em branco na parte superior"
},
emptyLineAfter: {
de: "Leere Zeile darunter einfügen",
en: "Add new entry below",
fr: "Ajouter une ligne vide ci-dessous",
es: "Agregar fila vacía en la parte inferior",
pt: "Adicionar linha em branco na parte inferior"
},
deleteRow: {
de: "Zeile löschen",
en: "Delete entry",
fr: "Effacer la ligne",
es: "Borrar fila",
pt: "Apagar linha"
},
combineWithPrev: {
de: "Mit Vorgängerzeile kombinieren",
en: "Combine with previous entry",
fr: "Combiner avec la ligne précédente",
es: "Combinar con la fila anterior",
pt: "Combinar com a linha anterior"
},
numEntriesDetected: {
de: "(($1 Eintrag | $1 Einträge)) erkannt, ",
en_gb: "(($1 entry | $1 entries)) recognised, ",
en: "(($1 entry | $1 entries)) recognized, ",
fr: "(($1 entrée reconnue | $1 entrées reconnues)), ",
es: "(($1 entrada reconocida | $1 entradas reconocidas)), ",
pt: "(($1 entrada reconhecida | $1 entradas reconhecidas)), "
},
numEntriesOptimized: {
de: "(($1 optimiert | $1 optimiert))",
en_gb: "(($1 optimised | $1 optimised))",
en: "(($1 optimized | $1 optimized))",
fr: "((0 optimisée | $1 optimisée | $1 optimisées))",
es: "(($1 optimizada | $1 optimizadas))",
pt: "(($1 otimizada | $1 otimizadas))"
}
};
})();
pages/scan/04_editor/list/row/footer/row.ls
(function(){
return function(page){
return Div({
height: "15em"
});
};
})();
pages/scan/04_editor/list/row/header/row.ls
(function(){
return function(page){
var total, totalCleaned;
total = page.scanData.gridRows.length;
totalCleaned = _.filter(page.scanData.gridRows, function(r){
return r.isCleaned;
}).length;
return Div({
display: "flex",
textAlign: "center",
padding: "1em 0.6em 1em",
background: "white",
borderBottom: "1px solid " + Color.grey[200],
fontSize: "0.9em",
color: Color.grey[600]
}).html(T("numEntriesDetected", total), SvgIcon({
svg: path("/../app01/lib/svg/shape/broom.svg"),
color: Color.grey[500],
size: "1em"
}).css({
margin: "0 0.3em"
}), T("numEntriesOptimized", totalCleaned));
};
})();
pages/scan/04_editor/list/row/row.ls
(function(){
return function(page){
return function(rowData){
return Div().html(Div({
width: "35em",
maxWidth: "99%",
margin: "0 auto"
}).addClass("listRow").html(rowData.rowType === "header"
? inc("header/row")(page)
: rowData.rowType === "footer"
? inc("footer/row")(page)
: inc("row/row")(page, rowData)));
};
};
})();
pages/scan/04_editor/list/row/row/actions/actions.ls
(function(){
return function(page, row){
var div;
div = Div({
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
pointerEvents: "none",
display: "flex",
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "flex-end",
fontSize: "0.9em"
}).html(inc("top/top")(page, row), inc("bottom/bottom")(page, row)).hide();
return row.actions = div;
};
})();
pages/scan/04_editor/list/row/row/actions/bottom/bottom.ls
(function(){
return function(page, row){
return Div({
position: "absolute",
left: 0,
bottom: 0,
right: 0,
display: "flex",
justifyContent: "flex-end"
}).html(inc("delete/delete")(page, row));
};
})();
pages/scan/04_editor/list/row/row/actions/bottom/delete/delete.ls
(function(){
return function(page, row){
var tap;
tap = function(){
row.fadeOut(150);
return setTimeout(function(){
var index;
index = _.indexOf(page.list.o.data, row.rowData);
page.list.removeRow(index);
page.updateTopErrorCounter();
return page.list.repositionCurrentRows();
}, 150);
};
return Div({
fontSize: "0.8em",
color: Color.blue[600],
padding: "0.2em 0.4em 0.2em 0.2em",
pointerEvents: "auto"
}).html(T("deleteRow")).tap(tap);
};
})();
pages/scan/04_editor/list/row/row/actions/top/menu/items/combine/combine.ls
(function(){
return function(page, row){
var i, prevRow, tap;
i = _.indexOf(page.list.o.data, row.rowData);
prevRow = page.list.o.rowsByIndex[i - 1];
prevRow = prevRow != null ? prevRow.firstChild.firstChild : void 8;
if (!(prevRow != null && prevRow.text1)) {
return;
}
tap = function(){
var d1, d2;
d1 = prevRow.rowData;
d2 = row.rowData;
if (d1.a.text.length > 0) {
d1.a.text += " " + d2.a.text;
} else {
d1.a.text = d2.a.text;
}
if (d1.b.text.length) {
d1.b.text += " " + d2.b.text;
} else {
d1.b.text = d2.b.text;
}
page.list.setListPosition(void 8, {
resetRows: true
});
page.list.removeRow(i);
return page.updateTopErrorCounter();
};
return {
label: T("combineWithPrev"),
click: tap
};
};
})();
pages/scan/04_editor/list/row/row/actions/top/menu/items/items.ls
(function(){
return function(page, row){
var items;
return items = [inc("combine/combine")(page, row), inc("newRow/new")(page, row, true), inc("newRow/new")(page, row, false)];
};
})();
pages/scan/04_editor/list/row/row/actions/top/menu/items/newRow/new.ls
(function(){
return function(page, row, before){
var tap;
tap = function(){
var pos, rowId, rowDataNew;
pos = _.indexOf(page.list.o.data, row.rowData);
if (before) {
pos = pos;
} else {
pos = pos + 1;
}
rowId = _.random(0, 50000);
rowDataNew = {
rowIndex: rowId,
a: {
text: ""
},
b: {
text: ""
}
};
page.list.insertRow({
data: rowDataNew,
position: pos
});
return page.selectRow(rowId);
};
return {
label: before
? T("emptyLineBefore")
: T("emptyLineAfter"),
click: tap
};
};
})();
pages/scan/04_editor/list/row/row/actions/top/menu/menu.ls
(function(){
return function(page, row){
var tap, div;
tap = function(){
var items, ref$;
items = inc("items/items")(page, row);
if ((ref$ = app.lastInput) != null) {
ref$.stop();
}
return inc("/../app01/lib/util/waitFrames/wait")(4, function(){
OverlayMenu({
referenceDiv: div,
items: items,
direction: "down left",
adjustXY: "-3 -5"
});
return page.list.repositionCurrentRows();
});
};
return div = Div({
display: "flex",
padding: "0em 0.5em",
pointerEvents: "auto"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/icon/menu-dots-small.svg"),
color: Color.blue[700]
})).tap({
up: tap,
tapZone: "0.6em 0em 0em 0.6em"
});
};
})();
pages/scan/04_editor/list/row/row/actions/top/top.ls
(function(){
return function(page, row){
return Div({
position: "absolute",
left: 0,
top: 0,
right: 0,
display: "flex",
justifyContent: "flex-end"
}).html(inc("menu/menu")(page, row));
};
})();
pages/scan/04_editor/list/row/row/error/error.ls
(function(){
return function(page, row){
var error, div;
error = row.rowData.error;
if (!error) {
return;
}
div = Div({
position: "absolute",
left: 0,
bottom: 0,
color: Color.red[600],
fontSize: "0.8em",
padding: "0.2em 0.4em 0.2em 0.6em"
}).html(error);
return row.error = div;
};
})();
pages/scan/04_editor/list/row/row/labels/label/label.ls
(function(){
return function(page, column){
var l;
l = inc("/pages/_shared/calcListColumns/calc")(page.listType);
return Div({
flex: "1 1 auto",
width: "50%",
fontSize: "0.7em",
textAlign: "left",
color: Color.blue[700],
paddingLeft: "0.3em"
}).html(l[column]);
};
})();
pages/scan/04_editor/list/row/row/labels/labels.ls
(function(){
return function(page, row){
var div;
div = Div({
display: "flex",
top: 0,
position: "absolute",
width: "100%",
pointerEvents: "none"
}).html(page.activeRow === row ? [
inc("label/label")(page, "a"), Div().css({
width: "1em"
}), inc("label/label")(page, "b")
] : void 8);
div.updateLabels = function(){
return div.replaceWith(inc(THISFILE)(page, row));
};
return row.labels = div;
};
})();
pages/scan/04_editor/list/row/row/main/main.ls
(function(){
return function(page, row){
return Div({
display: "flex",
alignItems: "stretch"
}).html(row.text1 = inc("textField/textField")(page, row, "a"), !_.startsWith(page.params.listType, "spell") ? row.text2 = inc("textField/textField")(page, row, "b").css({
borderLeft: "1px solid " + Color.grey[150]
}) : void 8);
};
})();
pages/scan/04_editor/list/row/row/main/textField/onPaste/onPaste.ls
(function(){
return function(e, div){
var text, ref$, ref1$, a;
text = ((ref$ = e.clipboardData) != null ? ref$.getData("text/plain") : void 8) || ((ref1$ = e.clipboardData) != null ? ref1$.getData("Text") : void 8) || "";
a = text.split("\n");
if (a.length > 1) {
div.insertAtCursor(a.join(""));
e.preventDefault();
return e.stopImmediatePropagation();
}
};
})();
pages/scan/04_editor/list/row/row/main/textField/textField.ls
(function(){
return function(page, row, column){
var rowData, scrollTo, onChange, onStop, onStart, div;
rowData = row.rowData;
scrollTo = function(){
return page.list.scrollElementIntoView(div, {
instant: true,
padding: 20
});
};
onChange = function(){
rowData[column].text = div.getValue();
page.list.repositionCurrentRows();
if (row.error) {
row.error.remove();
delete row.rowData.error;
row.css({
background: Color.blue[50]
});
return page.updateTopErrorCounter();
}
};
onStop = function(){
return setTimeout(function(){
var ref$;
if (!((ref$ = document.activeElement) != null && ref$.isDivEditable)) {
return page.setInstantEdit(false);
}
});
};
onStart = function(){
page.selectRow(row.rowData.rowIndex);
return page.setInstantEdit(true);
};
return div = inc("/../app01/lib/gui/divEditable/div")({
cssId: "learnListTextField",
value: rowData[column].text,
parseMode: "learnListCell",
onSoftKeyboardHeightChange: scrollTo,
onCursorChange: scrollTo,
onChange: onChange,
enabled: page.instantEdit,
onStop: onStop,
onStart: onStart
}).css({
flex: "1 1 auto",
width: "50%",
padding: "1.2em 0.3em",
justifyContent: ""
}).tap({
animation: "none",
up: function(){}
}).css(!page.instantEdit
? {
pointerEvents: "none",
cursor: "default"
}
: {
pointerEvents: "auto",
cursor: "text"
}).bind("paste", function(e){
return inc("onPaste/onPaste")(e, div);
}).bind("keydown", function(e){
if (e.keyCode === 27 || e.keyCode === 13) {
e.preventDefault();
e.stopImmediatePropagation();
page.lockLayout = true;
setTimeout(function(){
return page.lockLayout = false;
}, 200);
return div.blur();
}
});
};
})();
pages/scan/04_editor/list/row/row/row.ls
(function(){
return function(page, rowData){
var row, b;
row = Div({
borderTop: b = "1px solid " + Color.grey[200],
borderBottom: b,
margin: "-2px 0 0",
display: "flex",
flexDirection: "column",
alignItems: "stretch",
minHeight: "4.5em",
background: rowData.error ? Color.red[50] : "white"
});
row.rowData = rowData;
row.html(inc("main/main")(page, row), inc("labels/labels")(page, row), inc("actions/actions")(page, row), inc("error/error")(page, row)).tap({
animation: "none",
up: function(){
return page.selectRow(rowData.rowIndex);
}
}).css({
cursor: "default"
});
row.selectRow = function(){
var i$, ref$, len$, el, results$ = [];
if (row.isSelected) {
return;
}
row.isSelected = true;
page.activeRow = row;
row.actions.show();
row.labels.updateLabels();
row.css({
background: rowData.error
? Color.red[100]
: Color.blue[50]
});
for (i$ = 0, len$ = (ref$ = [row.text1, row.text2]).length; i$ < len$; ++i$) {
el = ref$[i$];
if (el) {
el.enable();
results$.push(el.css({
pointerEvents: "auto",
cursor: "text"
}));
}
}
return results$;
};
row.unselectRow = function(){
var i$, ref$, len$, el, results$ = [];
if (!row.isSelected) {
return;
}
row.isSelected = false;
row.actions.hide();
delete page.activeRow;
row.labels.updateLabels();
row.css({
background: rowData.error ? Color.red[50] : "white"
});
if (!page.instantEdit) {
for (i$ = 0, len$ = (ref$ = [row.text1, row.text2]).length; i$ < len$; ++i$) {
el = ref$[i$];
if (el) {
el.disable();
results$.push(el.css({
pointerEvents: "none",
cursor: "default"
}));
}
}
return results$;
}
};
return row;
};
})();
pages/scan/04_editor/list/selectRow/select.ls
(function(){
return function(rowIndex, list, page){
var lastRow, ref$, rowData, listIndex, rowDiv;
lastRow = (ref$ = list.selectedRowDiv) != null ? ref$.firstChild.firstChild : void 8;
if ((lastRow != null ? lastRow.rowData.rowIndex : void 8) === rowIndex) {
return;
}
if (lastRow != null) {
lastRow.unselectRow();
}
rowData = _.find(page.list.o.data, {
rowIndex: rowIndex
});
listIndex = _.indexOf(page.list.o.data, rowData);
if (listIndex === -1) {
return;
}
list.scrollRowIntoView(listIndex, {
padding: 80
});
rowDiv = list.o.rowsByIndex[listIndex];
rowDiv.firstChild.firstChild.selectRow();
return list.selectedRowDiv = rowDiv;
};
})();
pages/scan/04_editor/onValidateErrors/on.ls
(function(){
return function(page, errorLines){
inc("setRowErrors/set")(errorLines, page);
page.list.setListPosition(void 8, {
resetRows: true
});
page.updateTopErrorCounter();
return page.scrollToFirstError();
};
})();
pages/scan/04_editor/onValidateErrors/setRowErrors/set.ls
(function(){
return function(errorLines, page){
var errors, i$, len$, l, index, ref$, r, ref1$, ref2$, that, ref3$, results$ = [];
errors = {};
for (i$ = 0, len$ = errorLines.length; i$ < len$; ++i$) {
l = errorLines[i$];
errors[l.lineIndex] = l;
}
index = 0;
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
r = ref$[i$];
if (((ref1$ = r.a) != null ? ref1$.text.length : void 8) > 0 || ((ref2$ = r.b) != null ? ref2$.text.length : void 8) > 0) {
index++;
}
if (that = errors[index]) {
r.error = that.errorText;
} else {
delete r.error;
}
results$.push((ref3$ = errors[index], delete errors[index], ref3$));
}
return results$;
};
})();
pages/scan/04_editor/overlayRows/overlay.ls
(function(){
return function(page){
var div, i, row, rowNext, rowPrev;
div = Div({
position: "absolute",
left: 0,
right: 0,
top: 0,
bottom: 0
}).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = page.scanData.gridRows).length; i$ < len$; ++i$) {
i = i$;
row = ref$[i$];
rowNext = page.scanData.gridRows[i + 1];
rowPrev = page.scanData.gridRows[i - 1];
results$.push(inc("row/row")(row, rowNext, rowPrev, page));
}
return results$;
}()));
div.selectRow = function(rowIndex){
return inc("selectRow/select")(page, div, rowIndex);
};
return page.overlayRows = div;
};
})();
pages/scan/04_editor/overlayRows/row/row.ls
(function(){
return function(row, rowNext, rowPrev, page){
var y3, y4, tap, selectRow, unselectRow, div, word;
y3 = !rowPrev
? row.y - row.height
: row.y - (row.y - rowPrev.y2) / 2;
y4 = !rowNext
? row.y2 + row.height
: row.y2 + (rowNext.y - row.y2) / 2;
tap = function(){
return page.selectRow(row.rowIndex);
};
selectRow = function(){
var i$, ref$, len$, el, results$ = [];
div.addClass("overlayRowSelected");
for (i$ = 0, len$ = (ref$ = div.childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
results$.push(el.css({
background: Color.blue[500]
}));
}
return results$;
};
unselectRow = function(){
var i$, ref$, len$, el, results$ = [];
div.removeClass("overlayRowSelected");
for (i$ = 0, len$ = (ref$ = div.childrenAll()).length; i$ < len$; ++i$) {
el = ref$[i$];
results$.push(el.css({
background: Color.grey[300]
}));
}
return results$;
};
div = Div({
position: "absolute",
top: y3 + "px",
height: y4 - y3 + "px",
left: 0,
right: 0,
opacity: 0.3
}).addClass("overlayRow_" + row.rowIndex).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = row.words).length; i$ < len$; ++i$) {
word = ref$[i$];
results$.push(inc("word/word")(word, y3));
}
return results$;
}())).tap({
animation: "none",
up: tap
}).css({
cursor: "default",
pointerEvents: "auto"
});
div.selectRow = selectRow;
div.unselectRow = unselectRow;
return div;
};
})();
pages/scan/04_editor/overlayRows/row/word/word.ls
(function(){
return function(w, y){
return Div({
position: "absolute",
left: w.x + "px",
top: w.y - y + "px",
width: w.width + "px",
height: w.height + "px",
pointerEvents: "auto",
opacity: "0.7",
background: w.rowIndex % 2 === 1
? Color.brown[100]
: Color.brown[300]
});
};
})();
pages/scan/04_editor/overlayRows/selectRow/select.ls
(function(){
return function(page, div, rowIndex){
var ref$, row, s;
if ((ref$ = div.findFirst(".overlayRowSelected")) != null) {
ref$.unselectRow();
}
row = div.findFirst(".overlayRow_" + rowIndex);
if (!row) {
return;
}
row.selectRow();
s = page.zoomDiv.getCurrentScale();
div = Div({
position: "absolute",
left: 0,
right: 0,
top: row.offsetTop * s + "px",
height: row.offsetHeight * s + "px",
pointerEvents: "none",
background: "yellow"
}).appendTo(page.zoomDiv.overlayScaledDiv);
page.zoomDiv.scrollElementIntoView(div, {
instant: false,
padding: 40
});
return requestAnimationFrame(function(){
return div.remove();
});
};
})();
pages/scan/04_editor/page.ls
(function(){
return function(page){
page.context = page.params.context;
page.listType = page.params.listType;
page.listCode = page.params.listCode;
page.scanData = inc("calcScanData/calc")(page);
page.instantEdit = false;
page.itemsOriginal = page.scanData.items;
page.items = page.params.history < 0
? inc("/../app01/lib/util/cache/get/get")("listItems")
: _.cloneDeep(page.scanData.items);
page.calcItems = function(){
return inc("calcItems/calc")(page);
};
page.selectRow = function(i){
return inc("selectRow/select")(i, page);
};
page.setInstantEdit = function(v){
return inc("setInstantEdit/set")(v, page);
};
page.onValidateErrors = function(errorLines){
return inc("onValidateErrors/on")(page, errorLines);
};
page.scrollToFirstError = function(){
return inc("scrollToFirstError/scroll")(page);
};
return {
top: function(){
return inc("_topbar/topbar")(page);
},
start: function(){
var z;
page.pageSpacer.css({
background: Color.grey[150]
});
z = ZoomDiv({
contentHtml: inc("image/image")(page),
overlayOriginalHtml: inc("overlayRows/overlay")(page),
scrollbarMode: "hide",
minScale: 0.1,
maxScale: 2
}).css({
width: "100%",
height: "calc(var(--centerHeight)*0.3)"
});
return page.html(page.zoomDiv = z, page.list = inc("list/list")(page));
}
};
};
})();
pages/scan/04_editor/scrollToFirstError/scroll.ls
(function(){
return function(page){
var i$, ref$, len$, index, d;
for (i$ = 0, len$ = (ref$ = page.list.o.data).length; i$ < len$; ++i$) {
index = i$;
d = ref$[i$];
if (d.error) {
break;
}
}
return page.list.scrollRowIntoView(index, {
padding: 30
});
};
})();
pages/scan/04_editor/selectRow/select.ls
(function(){
return function(rowIndex, page){
page.overlayRows.selectRow(rowIndex);
return page.list.selectRow(rowIndex);
};
})();
pages/scan/04_editor/setInstantEdit/set.ls
(function(){
return function(enable, page){
var i$, ref$, r, lresult$, row, j$, ref1$, len$, el, results$ = [];
if (page.instantEdit === enable) {
return;
}
page.instantEdit = enable;
for (i$ in ref$ = page.list.o.rowsByIndex) {
r = ref$[i$];
lresult$ = [];
row = r.firstChild.firstChild;
for (j$ = 0, len$ = (ref1$ = [row.text1, row.text2]).length; j$ < len$; ++j$) {
el = ref1$[j$];
if (el) {
if (enable) {
el.enable();
lresult$.push(el.css({
pointerEvents: "auto",
cursor: "text"
}));
} else if (!row.isSelected) {
el.disable();
lresult$.push(el.css({
pointerEvents: "none",
cursor: "default"
}));
}
}
}
results$.push(lresult$);
}
return results$;
};
})();
start/start.ls
(function(){
return function(p){
var userDescription, startLastPage, startFreshPage;
p == null && (p = {});
if (!log.findLast("firstStartLearnList")) {
userDescription = inc("/../app01/data/user/calcUserDescription/calc")();
log.log({
event: "firstStartLearnList",
isPupil: !userDescription.isDirTeacher
});
}
startLastPage = function(){
return startPage({
navCategory: "learnList",
onNavCategoryNotFound: startFreshPage
});
};
startFreshPage = function(){
var ref$;
return startPage({
path: path("../pages/learnLists/myLists/page"),
history: (ref$ = p.history) != null ? ref$ : 1
});
};
if (p.schoolCode || p.history != null) {
return startFreshPage();
} else {
return startLastPage();
}
};
})();