Friday, May 22, 2015

What can the Eurovision Song Contest? – Klikk.no

“).css(“width”, “440px”); // fbs_shareResult text var shareScore = “”; if(data.scoreTotal == 0) shareScore = data.nrOfCorrect + ” av ” + parseInt(data.nrOfCorrect + data.nrOfWrong) + ” rette – “; // $ ().hmi(“initFbShare”, { // fbShareTitle: encodeURI($ (‘.quiz .header a’).html()), // fbShareCaption: encodeURI(“Jeg fikk: ” + shareScore + (data.title || “”)), // fbSharePicture: $ (“.resultPicture img”).attr(“src”) || “” // }); } }); if(jsonQuiz.newsletterItem) { var subscribeBox = $ (‘.quizEmailsubscribe’), subscribeForm = $ (‘form’, subscribeBox), subscribeInput = $ (‘[name="pf_Email"]‘, subscribeForm), emailValidator = /^([A-Za-z0-9_-.])+@([A-Za-z0-9_-.])+.([A-Za-z]{2,10})$ /, testInput = document.createElement(‘input’), placeholderSupport = ‘placeholder’ in testInput, inited = subscribeBox.data(‘isinited’); if(!inited) { subscribeForm.attr(‘action’, subscribeForm.attr(‘action’) + jsonQuiz.newsletterItem.formID); $ (‘[name="pf_AccountId"]‘, subscribeForm).val(jsonQuiz.newsletterItem.accountID); $ (‘[name="pf_MailinglistName1"]‘, subscribeForm).val(jsonQuiz.newsletterItem.listValue); $ (‘.quizEmailSubscribeText’, subscribeBox).text(jsonQuiz.newsletterName ? jsonQuiz.newsletterName : jsonQuiz.newsletterItem.name); subscribeForm.submit(function(e) { var val = subscribeInput.val(); if(!emailValidator.test(val)) { e.preventDefault(); alert(‘Din e-postadresse er ikke korrekt. Vennligst prøv igjen.’); return false; } return true; }); $ (‘.subscribeSubmit’, subscribeForm).click(function(e) { e.preventDefault(); subscribeForm.submit(); }); if(!placeholderSupport) { var inputPlaceholder = subscribeInput.attr(‘placeholder’); subscribeInput.focus(function() { var val = subscribeInput.val(); if(val == inputPlaceholder) { subscribeInput.val(”); } }).blur(function() { var val = subscribeInput.val(); if(val == ”) { subscribeInput.val(inputPlaceholder); } }).triggerHandler(‘blur’); } subscribeBox.show(); subscribeBox.data(‘isinited’, true); } } // Blueprint if(jsonQuiz.type === “classic”){ $ (“.showBluePrint”).show(); $ .each(jsonQuiz.questions, function(xid1){ var correct = false; var useText = true; var useQuestionPicture = true; var html = $ (“”, { class: “BPElement clearfix”, html: “

” + (xid1+1) + “. ” + this.question + “

” }); var BPAnswers = $ (“”, { class: “BPAnswers” }); $ .each(this.alternatives, function(xid2){ if(xid2 == 0 && this.alternative.length == 0){ useText = false; } if(this.correct){ if(useText){ if(this.picture == null && this.alternative.length > 0){ BPAnswers.append(“

Riktig svar: ” + this.alternative + “

“); if(parseInt(answers[xid1]) == xid2){ BPAnswers.append(“

Du svarte riktig!

“); html.find(“.BPQuestion”).addClass(“correct”); correct = true; } } else if(this.picture != null && this.alternative.length > 0){ BPAnswers.append(“”); if(parseInt(answers[xid1]) == xid2){ BPAnswers.append(“

Du svarte riktig!

“); html.find(“.BPQuestion”).addClass(“correct”); correct = true; } useQuestionPicture = false; } } else if(this.picture != null){ BPAnswers.append(“”); if(parseInt(answers[xid1]) == xid2){ BPAnswers.append(“

Du svarte riktig!

“); html.find(“.BPQuestion”).addClass(“correct”); correct = true; } useQuestionPicture = false; } } }); if(!correct){ if(useText){ if(this.alternatives[answers[xid1]].picture == null && this.alternatives[answers[xid1]].alternative.length > 0) BPAnswers.append(“

Du svarte: ” + this.alternatives[answers[xid1]].alternative + “

“); else if(this.alternatives[answers[xid1]].picture != null && this.alternatives[answers[xid1]].alternative.length > 0) BPAnswers.append(“

Du svarte:

” + this.alternatives[answers[xid1]].alternative + “

“); } else if(this.alternatives[answers[xid1]].picture != null) BPAnswers.append(“”); } if(useQuestionPicture && this.picture != null){ BPAnswers.prepend(“”); } BPAnswers.append(“”); html.append(BPAnswers); $ (“.bluePrint”).append(html); }); $ (“.showBluePrint”).click(function(){ $ (“.bluePrint”).slideToggle(function(){ if($ (“.bluePrint”).is(“:visible”)){ $ (“.showBluePrint .btnSign”).html(“-”); $ (“.showBluePrint .text”).html(“Skjul fasit”); } else { $ (“.showBluePrint .btnSign”).html(“+”); $ (“.showBluePrint .text”).html(“Vis fasit”); } }); }); } } // Show question else{ if($ (“[name='quizObj']“).val() != “”){ var jsonQuiz = jQuery.parseJSON($ (“[name='quizObj']“).html()); var question = jsonQuiz["questions"][-1]; $ (“.quiz .header”).html(“”); $ (“.question”).html(“0/0 ” + question.question + “

LikeTweet

No comments:

Post a Comment