mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-06 07:05:14 +01:00
Initiale Version
This commit is contained in:
1312
Kapitel_5/Lektion_9/javascript/css/jquery-ui.css
vendored
Executable file
1312
Kapitel_5/Lektion_9/javascript/css/jquery-ui.css
vendored
Executable file
File diff suppressed because it is too large
Load Diff
11
Kapitel_5/Lektion_9/javascript/css/style.css
Executable file
11
Kapitel_5/Lektion_9/javascript/css/style.css
Executable file
@@ -0,0 +1,11 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.ui-draggable, .ui-droppable {
|
||||
background-position: top;
|
||||
}
|
||||
BIN
Kapitel_5/Lektion_9/javascript/img/ui-anim_basic_16x16.gif
Executable file
BIN
Kapitel_5/Lektion_9/javascript/img/ui-anim_basic_16x16.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
55
Kapitel_5/Lektion_9/javascript/index.php
Executable file
55
Kapitel_5/Lektion_9/javascript/index.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Suche</title>
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<style>
|
||||
.ui-autocomplete-loading {
|
||||
background: white url("img/ui-anim_basic_16x16.gif") right center no-repeat;
|
||||
}
|
||||
</style>
|
||||
<script src="js/jquery-1.12.4.js"></script>
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
function log(message) {
|
||||
$("<div>").text(message).prependTo("#log");
|
||||
$("#log").scrollTop(0);
|
||||
}
|
||||
|
||||
$("#suchbegriff").autocomplete({
|
||||
source: function (request, response) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'suche.php',
|
||||
data: JSON.stringify({"suchbegriff": request.term}),
|
||||
success: response,
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
minLength: 2,
|
||||
select: function (event, ui) {
|
||||
log(ui.item ?
|
||||
"Gewählt: " + ui.item.value :
|
||||
"Nichts gewählt, Eingabe war " + this.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="ui-widget">
|
||||
<label for="suchbegriff">Suchbegriff Land:</label>
|
||||
<input id="suchbegriff">
|
||||
</div>
|
||||
|
||||
<div class="ui-widget" style="margin-top:2em; font-family:sans-serif">
|
||||
Protokoll:
|
||||
<div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
11008
Kapitel_5/Lektion_9/javascript/js/jquery-1.12.4.js
vendored
Executable file
11008
Kapitel_5/Lektion_9/javascript/js/jquery-1.12.4.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
18686
Kapitel_5/Lektion_9/javascript/js/jquery-ui.js
vendored
Executable file
18686
Kapitel_5/Lektion_9/javascript/js/jquery-ui.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
51
Kapitel_5/Lektion_9/javascript/suche.php
Executable file
51
Kapitel_5/Lektion_9/javascript/suche.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
$laender = [
|
||||
'Albanien',
|
||||
'Andorra',
|
||||
'Belgien',
|
||||
'Bosnien und Herzegowina',
|
||||
'Bulgarien',
|
||||
'Dänemark',
|
||||
'Deutschland',
|
||||
'Estland',
|
||||
'Finnland',
|
||||
'Frankreich',
|
||||
'Griechenland',
|
||||
'Irland',
|
||||
'Island',
|
||||
'Italien',
|
||||
'Kasachstan',
|
||||
'Kosovo',
|
||||
'Kroatien',
|
||||
'Lettland',
|
||||
'Liechtenstein',
|
||||
'Litauen',
|
||||
'Luxemburg',
|
||||
'Malta',
|
||||
'Mazedonien',
|
||||
'Moldawien',
|
||||
'Monaco',
|
||||
'Montenegro',
|
||||
'Niederlande',
|
||||
'Norwegen',
|
||||
'Österreich',
|
||||
'Polen',
|
||||
'Portugal',
|
||||
'Rumänien',
|
||||
'Russland',
|
||||
'San Marino',
|
||||
'Schweden',
|
||||
'Schweiz',
|
||||
'Serbien',
|
||||
'Slowakei',
|
||||
'Slowenien',
|
||||
'Spanien',
|
||||
'Tschechien',
|
||||
'Türkei',
|
||||
'Ukraine',
|
||||
'Ungarn',
|
||||
'Vatikanstadt',
|
||||
'Vereinigtes Königreich',
|
||||
'Weißrussland'
|
||||
];
|
||||
1312
Kapitel_5/Lektion_9/javascript_loesung/css/jquery-ui.css
vendored
Executable file
1312
Kapitel_5/Lektion_9/javascript_loesung/css/jquery-ui.css
vendored
Executable file
File diff suppressed because it is too large
Load Diff
11
Kapitel_5/Lektion_9/javascript_loesung/css/style.css
Executable file
11
Kapitel_5/Lektion_9/javascript_loesung/css/style.css
Executable file
@@ -0,0 +1,11 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.ui-draggable, .ui-droppable {
|
||||
background-position: top;
|
||||
}
|
||||
BIN
Kapitel_5/Lektion_9/javascript_loesung/img/ui-anim_basic_16x16.gif
Executable file
BIN
Kapitel_5/Lektion_9/javascript_loesung/img/ui-anim_basic_16x16.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
55
Kapitel_5/Lektion_9/javascript_loesung/index.php
Executable file
55
Kapitel_5/Lektion_9/javascript_loesung/index.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Suche</title>
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<style>
|
||||
.ui-autocomplete-loading {
|
||||
background: white url("img/ui-anim_basic_16x16.gif") right center no-repeat;
|
||||
}
|
||||
</style>
|
||||
<script src="js/jquery-1.12.4.js"></script>
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
function log(message) {
|
||||
$("<div>").text(message).prependTo("#log");
|
||||
$("#log").scrollTop(0);
|
||||
}
|
||||
|
||||
$("#suchbegriff").autocomplete({
|
||||
source: function (request, response) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'suche.php',
|
||||
data: JSON.stringify({"suchbegriff": request.term}),
|
||||
success: response,
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
minLength: 2,
|
||||
select: function (event, ui) {
|
||||
log(ui.item ?
|
||||
"Gewählt: " + ui.item.value :
|
||||
"Nichts gewählt, Eingabe war " + this.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="ui-widget">
|
||||
<label for="suchbegriff">Suchbegriff Land:</label>
|
||||
<input id="suchbegriff">
|
||||
</div>
|
||||
|
||||
<div class="ui-widget" style="margin-top:2em; font-family:sans-serif">
|
||||
Protokoll:
|
||||
<div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
11008
Kapitel_5/Lektion_9/javascript_loesung/js/jquery-1.12.4.js
vendored
Executable file
11008
Kapitel_5/Lektion_9/javascript_loesung/js/jquery-1.12.4.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
18686
Kapitel_5/Lektion_9/javascript_loesung/js/jquery-ui.js
vendored
Executable file
18686
Kapitel_5/Lektion_9/javascript_loesung/js/jquery-ui.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
66
Kapitel_5/Lektion_9/javascript_loesung/suche.php
Executable file
66
Kapitel_5/Lektion_9/javascript_loesung/suche.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
$body = file_get_contents('php://input');
|
||||
$eingabe = json_decode($body, true);
|
||||
|
||||
$suchbegriff = $eingabe['suchbegriff'];
|
||||
|
||||
$laender = [
|
||||
'Albanien',
|
||||
'Andorra',
|
||||
'Belgien',
|
||||
'Bosnien und Herzegowina',
|
||||
'Bulgarien',
|
||||
'Dänemark',
|
||||
'Deutschland',
|
||||
'Estland',
|
||||
'Finnland',
|
||||
'Frankreich',
|
||||
'Griechenland',
|
||||
'Irland',
|
||||
'Island',
|
||||
'Italien',
|
||||
'Kasachstan',
|
||||
'Kosovo',
|
||||
'Kroatien',
|
||||
'Lettland',
|
||||
'Liechtenstein',
|
||||
'Litauen',
|
||||
'Luxemburg',
|
||||
'Malta',
|
||||
'Mazedonien',
|
||||
'Moldawien',
|
||||
'Monaco',
|
||||
'Montenegro',
|
||||
'Niederlande',
|
||||
'Norwegen',
|
||||
'Österreich',
|
||||
'Polen',
|
||||
'Portugal',
|
||||
'Rumänien',
|
||||
'Russland',
|
||||
'San Marino',
|
||||
'Schweden',
|
||||
'Schweiz',
|
||||
'Serbien',
|
||||
'Slowakei',
|
||||
'Slowenien',
|
||||
'Spanien',
|
||||
'Tschechien',
|
||||
'Türkei',
|
||||
'Ukraine',
|
||||
'Ungarn',
|
||||
'Vatikanstadt',
|
||||
'Vereinigtes Königreich',
|
||||
'Weißrussland'
|
||||
];
|
||||
|
||||
$ergebnisliste = [];
|
||||
foreach ($laender as $land) {
|
||||
if (false !== stripos($land, $suchbegriff)) {
|
||||
$ergebnisliste[] = $land;
|
||||
}
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($ergebnisliste);
|
||||
Reference in New Issue
Block a user