update jquery and some functions

This commit is contained in:
Felix Schulze 2019-09-25 19:12:15 +02:00
parent a934e14f66
commit d8e81c07b6
4 changed files with 22 additions and 21 deletions

View File

@ -25,11 +25,11 @@ $(document).ready(function() {
$('form').change(function() {
raknaUtMeritvarde();
});
$('.add_row').live('click', function() {
$('.add_row').on('click', function() {
$('div.sample_row > div').clone().appendTo('form.courses');
raknaUtMeritvarde();
});
$('.delete_row').live('click', function() {
$('.delete_row').on('click', function() {
$(this).parent().slideUp(function() {
$(this).remove();
raknaUtMeritvarde();
@ -65,9 +65,9 @@ function raknaUtMeritvarde() {
}
$('.score_span').html('');
if (totalPoints > 2400) {
$('.score_span').append('<div class="demo-card-square mdl-card mdl-shadow--16dp" style="text-align:left;width:260px; height:auto;margin:50px auto 0;"><div class="mdl-card__title"><h2 class="mdl-card__title-text" style="font-size:28px;">Ditt meritvärde är ' + totalScore + '</h2></div><div class="mdl-card__supporting-text">Ditt Snittbetyg av ' + totalPoints + ' Poäng (+100 poäng för Gymnasiearbete) ger meritvärdet: ' + totalScore + '<p style="color:#d50000;text-align:unset;font-weight:unset;">Du har över 2400 poäng och måste därför välja bort ' + (totalPoints - 2400) + ' poäng</p></div><div class="mdl-card__actions mdl-card--border"><a class="sparaBetyg mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--primary">Spara</a><a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent" href="/">Till Startsidan</a></div></div>');
$('.score_span').append('<div class="demo-card-square mdl-card mdl-shadow--16dp" style="text-align:left;width:260px; height:auto;margin:50px auto 0;"><div class="mdl-card__title"><h2 class="mdl-card__title-text" style="font-size:28px;">Ditt meritvärde är ' + totalScore + '</h2></div><div class="mdl-card__supporting-text">Ditt Snittbetyg av ' + totalPoints + ' Poäng (+100 poäng för Gymnasiearbete) ger meritvärdet: ' + totalScore + '<p style="color:#d50000;text-align:unset;font-weight:unset;">Du har över 2400 poäng och måste därför välja bort ' + (totalPoints - 2400) + ' poäng</p></div><div class="mdl-card__actions mdl-card--border"><a onClick="sparaBetyg()" class="sparaBetyg mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--primary">Spara</a><a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent" href="/">Till Startsidan</a></div></div>');
} else {
$('.score_span').append('<div class="demo-card-square mdl-card mdl-shadow--16dp" style="text-align:left;width:260px; height:auto;margin:50px auto 0;"><div class="mdl-card__title"><h2 class="mdl-card__title-text" style="font-size:28px;">Ditt meritvärde är ' + totalScore + '</h2></div><div class="mdl-card__supporting-text">Ditt Snittbetyg av ' + totalPoints + ' Poäng (+100 poäng för Gymnasiearbete) ger meritvärdet: ' + totalScore + '</div><div class="mdl-card__actions mdl-card--border"><a class="sparaBetyg mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--primary">Spara</a><a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent" href="/">Till Startsidan</a></div></div>');
$('.score_span').append('<div class="demo-card-square mdl-card mdl-shadow--16dp" style="text-align:left;width:260px; height:auto;margin:50px auto 0;"><div class="mdl-card__title"><h2 class="mdl-card__title-text" style="font-size:28px;">Ditt meritvärde är ' + totalScore + '</h2></div><div class="mdl-card__supporting-text">Ditt Snittbetyg av ' + totalPoints + ' Poäng (+100 poäng för Gymnasiearbete) ger meritvärdet: ' + totalScore + '</div><div class="mdl-card__actions mdl-card--border"><a onClick="sparaBetyg()" class="sparaBetyg mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--primary">Spara</a><a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent" href="/">Till Startsidan</a></div></div>');
}
//title set
if (courseTitle === false) {

View File

@ -1,4 +1,4 @@
$('.changeall').live('click', function(){
$('.changeall').on('click', function(){
var grade;
var val;
if (document.getElementById('option-1').checked) {

View File

@ -1,6 +1,7 @@
// JavaScript Document
$('.sparaBetyg').live('click', function(){
$('.sparaBetyg').on('click', function() {
sparaBetyg();
console.log("lol")
});
function sparaBetyg() {
var urlLink = "?";

View File

@ -1,12 +1,12 @@
<?php
echo "
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script>
<script src='https://code.getmdl.io/1.3.0/material.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/js/materialize.min.js'></script>
<script src='assets/js/loader.min.js?v=1.6'></script>
<script src='assets/js/calcscript.js?v=1.6'></script>
<script src='assets/js/changeall.js?v=1.6'></script>
<script src='assets/js/sparabetyg.js?v=1.6'></script>
<script src='assets/js/calcscript.js?v=1.8'></script>
<script src='assets/js/changeall.js?v=1.8'></script>
<script src='assets/js/sparabetyg.js?v=1.10'></script>
<script>
$(document).ready(function() {