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