consolidate all repos to one for archive
This commit is contained in:
67
semester_1/uvod_v_svetovni_splet/Vaja_5/Naloga/index.html
Normal file
67
semester_1/uvod_v_svetovni_splet/Vaja_5/Naloga/index.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="bg-primary text-dark pb-2 text-center h1">
|
||||
Opravila
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="btn-group">
|
||||
<input class="m-1" id="prviVpis" type="text">
|
||||
<button class="m-1 btn btn-primary rounded" id="dodaj1">
|
||||
Dodaj
|
||||
</button>
|
||||
<button class="m-1 btn btn-primary rounded" id="brisi">
|
||||
Briši
|
||||
</button>
|
||||
</div>
|
||||
<ul id="listl" class="list-group">
|
||||
<li class="list-group-item">Vaje</li>
|
||||
<li class="list-group-item">Treningi</li>
|
||||
<li class="list-group-item">Projekt</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="drugiVpis" type="text">
|
||||
<button id="dodaj2" class="mb-1 btn btn-primary">
|
||||
Dodaj
|
||||
</button>
|
||||
<table id="table1" class="table table-striped">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Opis</th>
|
||||
<th scope="col">Kategorija</th>
|
||||
<th scope="col">Datum vnosa</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<button id="brisi2" class="btn btn-danger mb-1">
|
||||
Briši
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex justify-content-center bg-secondary">
|
||||
<footer>
|
||||
<p class="col-md-12 h4 p-2">OSS Vaja 5 - JQuery in Bootstrap</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
61
semester_1/uvod_v_svetovni_splet/Vaja_5/Naloga/script.js
Normal file
61
semester_1/uvod_v_svetovni_splet/Vaja_5/Naloga/script.js
Normal file
@@ -0,0 +1,61 @@
|
||||
let st = 0;
|
||||
var deleted = false;
|
||||
var today = new Date();
|
||||
var date =
|
||||
today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
|
||||
var time =
|
||||
today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||
var dateTime = date + ", " + time;
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("li").click(function () {
|
||||
$("li").removeClass( "active");
|
||||
$("li").removeAttr("id");
|
||||
$(this).addClass("active");
|
||||
$(this).attr("id", "selected");
|
||||
});
|
||||
|
||||
$("#brisi").click(function(){
|
||||
$("#selected").remove();
|
||||
});
|
||||
|
||||
$(document).on("click", ".appended", function(){
|
||||
$("li").removeClass("active");
|
||||
$("li").removeAttr("id");
|
||||
$(this).addClass("active");
|
||||
$(this).attr("id", "selected");
|
||||
});
|
||||
|
||||
$("#dodaj2").click(function(){
|
||||
st++;
|
||||
$("tbody").append(
|
||||
"<tr scope='row'><td>" + st + "</td><td>" + document.getElementById("drugiVpis").value + "</td><td>" + $("#selected").text() + "</td><td>" + dateTime + "</td></tr>"
|
||||
);
|
||||
|
||||
$("tr").click(function(){
|
||||
$(this).addClass("table-danger");
|
||||
});
|
||||
|
||||
$(document).on("click", ".appended2", function(){
|
||||
$(this).addClass("active");
|
||||
$(this).addClass("selected2");
|
||||
});
|
||||
|
||||
$("#brisi").click(function(){
|
||||
$(".selected").remove();
|
||||
});
|
||||
|
||||
$("#brisi2").click (function(){
|
||||
$(".table-danger").remove();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#dodaj1").click(function(){
|
||||
$("#listl").append(
|
||||
"<li class='appended list-group-item'>" + document.getElementById("prviVpis").value + "</li>"
|
||||
);
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user