Commit 64acc8b0 authored by Curtis Adam's avatar Curtis Adam

Adjust some chimp tests

parent 3a0b23fb
......@@ -88,15 +88,10 @@
</div>
</div>
{{isTextCentered}}
<div class="hidden-lg">
{{> btnCard}}
</div>
<div id="preview" class="col-xs-12 {{#unless fullscreenActive}}col-lg-6{{/unless}} cardtext">
<h5 class="editorElement">{{_ "previewEdit"}}</h5>
{{> flashcards cardset=this}}
</div>
</div>
<div class="row visible-lg">
{{> btnCard}}
</div>
</template>
......@@ -299,36 +294,37 @@
</template>
<template name="btnCard">
<div class="col-xs-12 col-sm-9 col-md-6">
<div class="actionButtons editorElement">
<div id="button-row" class="col-xs-12 actionButtons editorElement">
<div class="col-xs-12 col-sm-9 col-md-6">
<br>
<button class="btn btn-success btn-raised saveFirst col-xs-12 col-sm-4 cardSave" {{disableIfOffline}}
<button id="cardSave"
class="btn btn-success btn-raised saveFirst col-xs-12 col-sm-4" {{disableIfOffline}}
tabindex="13">
{{_ "savecard"}}
</button>
<button class="btn btn-default btn-raised save col-xs-12 col-sm-4 cardSaveReturn" {{disableIfOffline}}
<button id="cardSaveReturn"
class="btn btn-default btn-raised save col-xs-12 col-sm-4" {{disableIfOffline}}
tabindex="14">
{{_ "savecardReturn"}}
</button>
<button class="btn btn-danger btn-raised cancel col-xs-12 col-sm-3 cardCancel pull-right"
<button id="cardCancel" class="btn btn-danger btn-raised cancel col-xs-12 col-sm-3 pull-right"
tabindex="15" data-toggle="modal"
data-target="#cancelEditModal">{{_
"declinecard"}}</button>
</div>
</div>
{{#if isEditMode}}
{{#if isCardsetOwner this.cardset_id}}
<div class="col-xs-12 col-sm-3 col-md-6">
<div class="actionButtons editorElement">
{{#if isEditMode}}
{{#if isCardsetOwner this.cardset_id}}
<div class="col-xs-12 col-sm-3 col-md-6">
<br>
<button class="btn btn-danger btn-raised col-xs-12 col-md-3 pull-right cardDelete" {{isDisabled}}
<button id="cardDelete"
class="btn btn-danger btn-raised col-xs-12 col-md-3 pull-right" {{isDisabled}}
tabindex="16" data-toggle="modal"
data-target="#deleteCardModal">{{_
"deletecard"}}</button>
</div>
</div>
{{/if}}
{{/if}}
{{/if}}
</div>
</template>
<template name="flashcards">
......@@ -499,7 +495,7 @@
{{/if}}
{{#if isLecturePreview}}
<span class="{{#if gotLecturePreview}}{{#if isCentered
3}}center-align{{/if}}{{else}}placeholder{{/if}}">
3}}center-align{{/if}}{{else}}placeholder{{/if}}">
{{#if gotLecturePreview}}
{{#mathjax}}{{lecture}}{{/mathjax}}
{{else}}
......@@ -534,7 +530,8 @@
{{#unless gotNotesForDifficultyLevel}}
<div class="collapsed collapse"
id="collapseLecture-{{_id}}" style="{{#if isEditMode}}display: none{{/if}}">
<div class="cardContent {{#if gotDictionary}}cardContentDictionary{{/if}} centered cardlecture {{#if
<div class="cardContent {{#if
gotDictionary}}cardContentDictionary{{/if}} centered cardlecture {{#if
gotLecture}}lectureContent{{/if}} detaillecture{{@index}}">
{{#if gotLecture}}
......
......@@ -80,7 +80,7 @@ function prepareFront() {
$('#editFront').removeClass('btn-default').addClass('btn-primary');
$('#editBack').removeClass('btn-primary').addClass('btn-default');
$('#editHint').removeClass('btn-primary').addClass('btn-default');
if (Session.get('cardType') === 0) {
if (gotLecture(Session.get('cardType'))) {
$('#editLecture').removeClass('btn-primary').addClass('btn-default');
}
}
......@@ -764,10 +764,10 @@ Template.btnCard.helpers({
});
Template.btnCard.events({
"click .cardSave": function () {
"click #cardSave": function () {
saveCard(Router.current().params.card_id, false);
},
"click .cardSaveReturn": function () {
"click #cardSaveReturn": function () {
saveCard(Router.current().params.card_id, true);
}
});
......@@ -829,6 +829,7 @@ Template.editor.helpers({
getContent: function () {
if (Router.current().route.getName() === "newCard") {
resetSessionData(true);
Session.set('cardType', Cardsets.findOne({_id: Router.current().params._id}).cardType);
} else if (Router.current().route.getName() === "editCard") {
let difficulty;
if (this.difficulty === 0 || gotDifficultyLevel(this.cardType)) {
......@@ -889,6 +890,16 @@ Template.editor.onCreated(function () {
resetSessionData(true);
});
Template.editor.onRendered(function () {
$(window).resize(function () {
if ($(window).width() <= 1200) {
$("#button-row").insertBefore($("#preview"));
} else {
$("#button-row").insertAfter($("#preview"));
}
});
});
/*
* ############################################################################
* contentEditor
......
import * as global from "./global.js";
import * as navigation from "./navigation";
module.exports = {
......@@ -42,14 +43,14 @@ module.exports = {
browser.waitForExist('#newCardBtn', global.threshold);
if (click) {
browser.click('#newCardBtn');
browser.waitForExist('#cardType0', global.threshold);
browser.click('#cardType0');
browser.waitForExist('#subjectEditor', global.threshold);
browser.click('#subjectEditor');
}
},
saveCard: function (click = true) {
browser.waitForExist('#cardSave', global.threshold);
browser.waitForExist('.cardSave', global.threshold);
if (click) {
browser.click('#cardSave');
browser.click('.cardSave');
}
},
saveCardReturn: function (click = true) {
......@@ -61,8 +62,7 @@ module.exports = {
cancelCardEdit: function (click = true) {
browser.waitForVisible('#cardCancel', global.threshold);
if (click) {
browser.click('#cardCancel');
browser.waitForVisible('#cancelEditConfirm', global.threshold);
navigation.contentVisible('#cancelEditConfirm');
browser.click('#cancelEditConfirm');
}
},
......@@ -80,7 +80,7 @@ module.exports = {
}
},
deleteCardConfirm: function (click = true) {
browser.waitForVisible('#deleteCardConfirm', global.threshold);
navigation.contentVisible('#deleteCardConfirm');
if (click) {
browser.click('#deleteCardConfirm');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment