Minor fixes

This commit is contained in:
YourFriendlyNeighborhoodDealer 2018-12-16 10:55:05 +01:00
parent 29e92a1220
commit c832b75e60

33
main.js
View file

@ -1136,8 +1136,6 @@ function SaveQuiz(quiz, questionData) {
var allQ = 0;
var addedQ = 0;
var newQuestions = [];
console.log("QUIZ:");
console.log(quiz);
for (var i = 0; i < quiz.length; i++) // going though quiz
{
// searching for same questions in questionData
@ -1527,22 +1525,24 @@ function ShowMessage(msgItem, timeout, funct) {
}
var buttonMargin = "2px 2px 2px 2px"; // uniform button margin
// PREV SUGG BUTTON ------------------------------------------------------------------------------------------------------------
var prevSuggButton = CreateNodeWithText(prevSuggestionCell, "<", "button");
prevSuggButton.style.margin = buttonMargin; // fancy margin
if (msgItem[currItem].length == 0) { // TODO: test this
// PREV SUGG BUTTON ------------------------------------------------------------------------------------------------------------
var prevSuggButton = CreateNodeWithText(prevSuggestionCell, "<", "button");
prevSuggButton.style.margin = buttonMargin; // fancy margin
prevSuggButton.addEventListener("click", function() {
ChangeCurrRelevantQuestionIndex(-1);
SetQuestionText();
});
// NEXT SUGG BUTTON ------------------------------------------------------------------------------------------------------------
var nextSuggButton = CreateNodeWithText(nextSuggestionCell, ">", "button");
nextSuggButton.style.margin = buttonMargin; // fancy margin
prevSuggButton.addEventListener("click", function() {
ChangeCurrRelevantQuestionIndex(-1);
SetQuestionText();
});
// NEXT SUGG BUTTON ------------------------------------------------------------------------------------------------------------
var nextSuggButton = CreateNodeWithText(nextSuggestionCell, ">", "button");
nextSuggButton.style.margin = buttonMargin; // fancy margin
nextSuggButton.addEventListener("click", function() {
ChangeCurrRelevantQuestionIndex(1);
SetQuestionText();
});
nextSuggButton.addEventListener("click", function() {
ChangeCurrRelevantQuestionIndex(1);
SetQuestionText();
});
}
// deciding if has multiple questions ------------------------------------------------------------------------------------------------
if (msgItem.length == 1) {
SetQuestionText();
@ -1960,6 +1960,7 @@ function NormalizeSpaces(input) {
}
function SendXHRMessage(message) {
console.log("HAAAAAAAAAAAAAAAAAAAAAAAAAAA");
var url = serverAdress + "isAdding";
GM_xmlhttpRequest({