Initial commit
This commit is contained in:
commit
e0afabe358
12 files changed
+2504
No files matched your search
@@ -0,0 +1,4 @@
|
|||||||
|
pic/
|
||||||
|
fbox.arm
|
||||||
|
.vscode/
|
||||||
|
config.json
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
echo "Build Linux/arm..."
|
||||||
|
$env:GOOS="linux"; $env:GOARCH="arm"; go build -ldflags="-s -w" -o ./fbox.arm
|
||||||
|
|
||||||
|
#echo "UPX - Compress Static Binaries"
|
||||||
|
#..\upx-3.95-win64\upx.exe -9 ./fbox.arm
|
||||||
|
|
||||||
|
pause
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# GoFotoBox
|
||||||
|
|
||||||
|
Zum kompilieren folgende Go-Abhängigkeiten installieren:
|
||||||
|
- `go get github.com/gorilla/mux`
|
||||||
|
|
||||||
|
Kompilieren:
|
||||||
|
`$env:GOOS="linux"; $env:GOARCH="arm"; go build -o fbox.arm`
|
||||||
|
|
||||||
|
Beispiel config.json:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"Host":"http://127.0.0.1",
|
||||||
|
"Port":"8000",
|
||||||
|
"Template":"default",
|
||||||
|
"MQTTServer": "127.0.0.1",
|
||||||
|
"MQTTPort": 8080
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"path"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
)
|
||||||
|
|
||||||
|
var config = readConfig("")
|
||||||
|
|
||||||
|
// our main function
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
// Ausgeben der Config-Optionen
|
||||||
|
fmt.Println("Host: " + config.Host)
|
||||||
|
fmt.Println("Post: " + config.Port)
|
||||||
|
fmt.Println("Template: " + config.Template)
|
||||||
|
fmt.Println("MQTTServer: " + config.MQTTServer)
|
||||||
|
fmt.Println("MQTTPort: " + strconv.Itoa(config.MQTTPort))
|
||||||
|
fmt.Println("OS: " + config.OS)
|
||||||
|
|
||||||
|
router := mux.NewRouter()
|
||||||
|
//router.HandleFunc("/_api/md/{pagename:.*}", getRawPage).Methods("GET")
|
||||||
|
router.HandleFunc("/_api/config", getConfig).Methods("GET")
|
||||||
|
router.HandleFunc("/_api/aufnahme", getAufnahme).Methods("GET")
|
||||||
|
router.HandleFunc("/_api/aufnahme", postAufnahme).Methods("POST")
|
||||||
|
router.HandleFunc("/_api/kamerabild", getKamerabild).Methods("GET")
|
||||||
|
router.HandleFunc("/_api/fotoliste", getFotoliste).Methods("GET")
|
||||||
|
router.PathPrefix("/pic/").Handler(http.StripPrefix("/pic/", http.FileServer(http.Dir("pic")))).Methods("GET")
|
||||||
|
router.PathPrefix("/").Handler(http.FileServer(http.Dir("web"))).Methods("GET")
|
||||||
|
|
||||||
|
log.Fatal(http.ListenAndServe(":"+config.Port, router))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func getConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
|
json.NewEncoder(w).Encode(config)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAufnahme(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
// raspistill -t 99999999 -p '100,140,800,600'
|
||||||
|
if config.OS == "linux" {
|
||||||
|
cmd := exec.Command("killall", "raspistill")
|
||||||
|
err := cmd.Run()
|
||||||
|
check(err)
|
||||||
|
|
||||||
|
//cmd = exec.Command("/usr/bin/raspistill", "-t 1 -o /home/pi/fbox/pic/tmp.jpg")
|
||||||
|
//cmd = exec.Command("bash", "-c", `/usr/bin/raspistill -p '100,140,800,600' -t 1 -o /home/pi/fbox/pic/tmp.jpg`)
|
||||||
|
cmd = exec.Command("bash", "-c", `/usr/bin/raspistill -op 0 -p '100,140,800,600' -t 1 -o /home/pi/fbox/pic/tmp.jpg`)
|
||||||
|
err = cmd.Run()
|
||||||
|
check(err)
|
||||||
|
} else {
|
||||||
|
copyfile("./pic/Testbild.jpg", "./pic/tmp.jpg")
|
||||||
|
}
|
||||||
|
|
||||||
|
json.NewEncoder(w).Encode("tmp.jpg")
|
||||||
|
}
|
||||||
|
|
||||||
|
func postAufnahme(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
//fmt.Println("YYYY-MM-DD : ", currentTime.Format("2006-01-02"))
|
||||||
|
currentTime := time.Now()
|
||||||
|
Ordner := currentTime.Format("2006-01-02")
|
||||||
|
if !directoryExists(Ordner) {
|
||||||
|
os.MkdirAll(path.Join("/home/pi/fbox/pic", Ordner), os.ModePerm)
|
||||||
|
}
|
||||||
|
|
||||||
|
//fmt.Println("YYYY-MM-DD hh:mm:ss : ", currentTime.Format("2006-01-02 15:04:05"))
|
||||||
|
Foto := currentTime.Format("150405")
|
||||||
|
copyfile("./pic/tmp.jpg", path.Join("/home/pi/fbox/pic", Ordner, Foto+".jpg"))
|
||||||
|
|
||||||
|
json.NewEncoder(w).Encode(path.Join(Ordner, Foto+".jpg"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func getKamerabild(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if config.OS == "linux" {
|
||||||
|
//cmd := exec.Command("/usr/bin/raspistill", "-t 99999999 -p '100,140,800,600'")
|
||||||
|
cmd := exec.Command("bash", "-c", `/usr/bin/raspistill -t 99999999 -p '100,140,800,600'`)
|
||||||
|
err := cmd.Run()
|
||||||
|
check(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
json.NewEncoder(w).Encode("OK")
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFotoliste(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
//Livestream der Kamera beenden
|
||||||
|
if config.OS == "linux" {
|
||||||
|
cmd := exec.Command("killall", "raspistill")
|
||||||
|
err := cmd.Run()
|
||||||
|
check(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Datum der config auslesen
|
||||||
|
f, err := os.Open("./config.json")
|
||||||
|
check(err)
|
||||||
|
statinfo, err := f.Stat()
|
||||||
|
check(err)
|
||||||
|
ConfigTime := statinfo.ModTime()
|
||||||
|
//fmt.Println(ConfigTime)
|
||||||
|
|
||||||
|
// Dateien herausfinden die neuer als das Config-Datm sind
|
||||||
|
//picfiles, err := ioutil.ReadDir("./pic")
|
||||||
|
//check(err)
|
||||||
|
var files []string
|
||||||
|
|
||||||
|
filepath.Walk("./pic", func(filepath string, file os.FileInfo, err error) error {
|
||||||
|
tmpPath := strings.Replace(filepath, "\\", "/", -1)
|
||||||
|
|
||||||
|
if file.Mode().IsRegular() {
|
||||||
|
//if file.ModTime() > ConfigTime {
|
||||||
|
//fmt.Print(file.Name() + ": ")
|
||||||
|
//fmt.Println(file.ModTime())
|
||||||
|
if file.Name() != "Testbild.jpg" && file.Name() != "TestbildKamera.jpg" && file.Name() != "tmp.jpg" {
|
||||||
|
if inTimeSpan(ConfigTime, time.Now(), file.ModTime()) {
|
||||||
|
files = append(files, tmpPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
for _, file := range picfiles {
|
||||||
|
if file.Mode().IsRegular() {
|
||||||
|
//if file.ModTime() > ConfigTime {
|
||||||
|
fmt.Print(file.Name() + ": ")
|
||||||
|
fmt.Println(file.ModTime())
|
||||||
|
if inTimeSpan(ConfigTime, time.Now(), file.ModTime()) {
|
||||||
|
files = append(files, file.Name())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
json.NewEncoder(w).Encode(files)
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Typen
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
type Configuration struct {
|
||||||
|
Host string
|
||||||
|
Port string
|
||||||
|
Template string
|
||||||
|
MQTTServer string
|
||||||
|
MQTTPort int
|
||||||
|
OS string
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Hilfsfunktionen
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
func check(e error) {
|
||||||
|
if e != nil {
|
||||||
|
fmt.Println(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func fileExists(filename string) bool {
|
||||||
|
info, err := os.Stat(filename)
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return !info.IsDir()
|
||||||
|
}
|
||||||
|
|
||||||
|
func directoryExists(filename string) bool {
|
||||||
|
info, err := os.Stat(filename)
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return info.IsDir()
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyfile(source string, destination string) {
|
||||||
|
input, err := ioutil.ReadFile(source)
|
||||||
|
check(err)
|
||||||
|
err = ioutil.WriteFile(destination, input, 0644)
|
||||||
|
check(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func readConfig(filename string) *Configuration {
|
||||||
|
// initialize conf with default values.
|
||||||
|
conf := &Configuration{
|
||||||
|
Host: "http://127.0.0.1",
|
||||||
|
Port: "8000",
|
||||||
|
Template: "default",
|
||||||
|
MQTTServer: "127.0.0.1",
|
||||||
|
MQTTPort: 8080,
|
||||||
|
OS: runtime.GOOS,
|
||||||
|
}
|
||||||
|
|
||||||
|
b, err := ioutil.ReadFile("./config.json")
|
||||||
|
if err != nil {
|
||||||
|
return conf
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(b, conf); err != nil {
|
||||||
|
return conf
|
||||||
|
}
|
||||||
|
return conf
|
||||||
|
}
|
||||||
|
|
||||||
|
func inTimeSpan(start, end, check time.Time) bool {
|
||||||
|
return check.After(start) && check.Before(end)
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
+278
@@ -0,0 +1,278 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<link rel=stylesheet href="/misc/bootstrap.min.css">
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="TemplateTextHeader" style="position:fixed;top:0px;left:100px">
|
||||||
|
<center>
|
||||||
|
<p id="TemplateHeaderText" style="font-size:35px">
|
||||||
|
Herzlich Willkommen zur Fotobox!<br>
|
||||||
|
Drücke einfach auf "Aufnahme" und los geht es!
|
||||||
|
</p>
|
||||||
|
</center>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Template Bild Oben rechts / 1.png-->
|
||||||
|
<div id="TemplatePicOR" style="position:fixed;top:0px;right:0px">
|
||||||
|
<img src="/bilder/geburtstag/1.png">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Template Bilder rechts / 2.png-->
|
||||||
|
<div id="TemplatePicR1" style="position:fixed;top:300px;right:0px">
|
||||||
|
<img src="/bilder/geburtstag/2.png">
|
||||||
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||||
|
<font size="12"><p id="TemplatePicR1Text">Aufnehmen</p></font>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="TemplatePicR2" style="position:fixed;top:450px;right:0px">
|
||||||
|
<img src="/bilder/geburtstag/2.png">
|
||||||
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||||
|
<font size="12"><p id="TemplatePicR2Text">Ansehen</p></font>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="TemplatePicR3" style="position:fixed;top:600px;right:0px">
|
||||||
|
<img src="/bilder/geburtstag/2.png">
|
||||||
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||||
|
<font size="12"><p id="TemplatePicR3Text"> - </p></font>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Template Bild unten / 3.png-->
|
||||||
|
<div id="TemplatePicUN" style="position:fixed;bottom:0px;left:0px">
|
||||||
|
<img src="/bilder/geburtstag/3.png">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Bild Kamera / TestbildKamera.jpg-->
|
||||||
|
<div id="TemplateKameraBild" style="position:fixed;top:140px;left:100px">
|
||||||
|
<img id="TemplateKameraTestBild" src="/pic/TestbildKamera.jpg">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script language=javascript src="/misc/jquery.min.js"></script>
|
||||||
|
<script language=javascript src="/misc/mqttws31.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var PageMode = "start";
|
||||||
|
var AnzeigeFoto = "";
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// Laden der Config
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
contentType:'application/json; charset=utf-8',
|
||||||
|
url: '/_api/config',
|
||||||
|
dataType: "json",
|
||||||
|
data: "",
|
||||||
|
success: function(content){
|
||||||
|
LoadTemplate(content.Template);
|
||||||
|
MakeMQTTConnection(content.MQTTServer, content.MQTTPort);
|
||||||
|
|
||||||
|
// Wenn auf dem Pi ausgeführt wird, soll das Testbild nicht angezeigt werden
|
||||||
|
if(content.OS!="windows") {
|
||||||
|
$("#TemplateKameraTestBild").remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function LoadTemplate(TemplateName) {
|
||||||
|
$("#TemplatePicOR").html('<img src="/bilder/'+TemplateName+'/1.png">');
|
||||||
|
$("#TemplatePicR1").html(LoadTemplateButtonRechts(TemplateName,"TemplatePicR1Text","2.png","Aufnehmen"));
|
||||||
|
$("#TemplatePicR2").html(LoadTemplateButtonRechts(TemplateName,"TemplatePicR2Text","2.png","Ansehen"));
|
||||||
|
$("#TemplatePicR3").html(LoadTemplateButtonRechts(TemplateName,"TemplatePicR3Text","2.png","- - - - - "));
|
||||||
|
$("#TemplatePicUN").html('<img src="/bilder/'+TemplateName+'/3.png">');
|
||||||
|
}
|
||||||
|
|
||||||
|
function LoadTemplateButtonRechts(TemplateName, Pid, Bild, Text) {
|
||||||
|
var html_ButtonRechts = '<img src="/bilder/'+TemplateName+'/'+Bild+'">'+
|
||||||
|
'<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">'+
|
||||||
|
'<font size="12"><p id="'+Pid+'">'+Text+'</p></font>'+
|
||||||
|
'</div>';
|
||||||
|
return html_ButtonRechts;
|
||||||
|
}
|
||||||
|
|
||||||
|
function MakeMQTTConnection(MQTTServer, MQTTPort) {
|
||||||
|
var MQTTClient = new Messaging.Client(MQTTServer, MQTTPort, "myclientid_" + parseInt(Math.random() * 100, 10));
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
timeout: 3,
|
||||||
|
onSuccess: function () {
|
||||||
|
console.log("MQTT Client Connected!");
|
||||||
|
MQTTClient.subscribe('/pin'+'/#', {qos: 2});
|
||||||
|
},
|
||||||
|
onFailure: function (message) {
|
||||||
|
console.log("Connection failed: " + message.errorMessage);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
MQTTClient.connect(options);
|
||||||
|
|
||||||
|
MQTTClient.onConnectionLost = function (responseObject) {
|
||||||
|
console.log("connection lost: " + responseObject.errorMessage);
|
||||||
|
};
|
||||||
|
|
||||||
|
MQTTClient.onMessageArrived = function (message) {
|
||||||
|
console.log('Payload: Topic: ' + message.destinationName + ' | ' + message.payloadString);
|
||||||
|
if(message.destinationName=="/pin/17") {
|
||||||
|
if(message.payloadString=="1") {
|
||||||
|
if(PageMode=="vorschau") {
|
||||||
|
Fotospeichern();
|
||||||
|
} else if(PageMode=="FotosAnschauen") {
|
||||||
|
FotosAnschauen("vor");
|
||||||
|
} else {
|
||||||
|
Aufnahme();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(message.destinationName=="/pin/21") {
|
||||||
|
if(message.payloadString=="1") {
|
||||||
|
if(PageMode=="start") {
|
||||||
|
FotosAnschauen("start");
|
||||||
|
} else if(PageMode=="vorschau") {
|
||||||
|
Abbrechen();
|
||||||
|
} else if(PageMode=="FotosAnschauen") {
|
||||||
|
FotosAnschauen("zurueck");
|
||||||
|
}else {
|
||||||
|
//Aufnahme();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(message.destinationName=="/pin/22") {
|
||||||
|
if(message.payloadString=="1") {
|
||||||
|
if(PageMode=="FotosAnschauen") {
|
||||||
|
Abbrechen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function Aufnahme() {
|
||||||
|
// x sec warten vor Aufnahme
|
||||||
|
for (i = 5; i >0 ; i--) {
|
||||||
|
console.log(i);
|
||||||
|
$("#TemplateHeaderText").html('Foto wird in '+i+' sec aufgenommen.<br>Bitte lächeln!');
|
||||||
|
await new Promise(r => setTimeout(r, 1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aufnahme starten
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
contentType:'application/json; charset=utf-8',
|
||||||
|
url: '/_api/aufnahme',
|
||||||
|
dataType: "json",
|
||||||
|
data: "",
|
||||||
|
success: function(content){
|
||||||
|
$("#TemplateKameraBild").html('<img width="800px" src="/pic/'+content+'?'+parseInt(Math.random() * 100, 10)+'">');
|
||||||
|
$("#TemplatePicR1Text").html('Speichern');
|
||||||
|
$("#TemplatePicR2Text").html('Abbrechen');
|
||||||
|
//$("#TemplatePicR3Text").html('<img src="/pic/'+content+'">');
|
||||||
|
PageMode = "vorschau";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function Fotospeichern() {
|
||||||
|
$.ajax({
|
||||||
|
method: "POST",
|
||||||
|
contentType:'application/json; charset=utf-8',
|
||||||
|
url: '/_api/aufnahme',
|
||||||
|
dataType: "json",
|
||||||
|
data: "",
|
||||||
|
success: function(content){
|
||||||
|
SetTemplateStart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function FotosAnschauen(voroderzurueck) {
|
||||||
|
console.log("FotosAnschauen");
|
||||||
|
PageMode="FotosAnschauen";
|
||||||
|
|
||||||
|
$("#TemplatePicR1Text").html('Vor');
|
||||||
|
$("#TemplatePicR2Text").html('Zurück');
|
||||||
|
$("#TemplatePicR3Text").html('Abbrechen');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
contentType:'application/json; charset=utf-8',
|
||||||
|
url: '/_api/fotoliste',
|
||||||
|
dataType: "json",
|
||||||
|
data: "",
|
||||||
|
success: function(content){
|
||||||
|
|
||||||
|
console.log("voroderzurueck: "+voroderzurueck);
|
||||||
|
|
||||||
|
// Wenn der Menüpunkt "Anschauen" ausgewöhlt wird, muss as letzte Bild angezeigt werden
|
||||||
|
if(voroderzurueck=="start") {
|
||||||
|
var Foto = content[content.length-1];
|
||||||
|
AnzeigeFoto=Foto;
|
||||||
|
$("#TemplateKameraBild").html('<img id="TemplateKameraTestBild" width="800px" height="600px" src="/'+Foto+'">');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(voroderzurueck=="vor") {
|
||||||
|
var Foto = content[content.indexOf(AnzeigeFoto)+1]
|
||||||
|
if(Foto!==undefined) {
|
||||||
|
AnzeigeFoto=Foto;
|
||||||
|
$("#TemplateKameraBild").html('<img id="TemplateKameraTestBild" width="800px" height="600px" src="/'+Foto+'">');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(voroderzurueck=="zurueck") {
|
||||||
|
var Foto = content[content.indexOf(AnzeigeFoto)-1]
|
||||||
|
if(Foto!==undefined) {
|
||||||
|
AnzeigeFoto=Foto;
|
||||||
|
$("#TemplateKameraBild").html('<img id="TemplateKameraTestBild" width="800px" height="600px" src="/'+Foto+'">');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(AnzeigeFoto);
|
||||||
|
console.log("PageMode: "+PageMode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function Abbrechen() {
|
||||||
|
SetTemplateStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// Hilsfunktionen
|
||||||
|
function sleep(milliseconds) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetTemplateStart() {
|
||||||
|
$("#TemplateHeaderText").html('Herzlich Willkommen zur Fotobox!<br>Drücke einfach auf "Aufnahme" und los geht es!');
|
||||||
|
$("#TemplateKameraBild").html('<img src="/pic/TestbildKamera.jpg">');
|
||||||
|
$("#TemplatePicR1Text").html('Aufnehmen');
|
||||||
|
$("#TemplatePicR2Text").html('Ansehen');
|
||||||
|
$("#TemplateKameraTestBild").remove();
|
||||||
|
PageMode = "start";
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
contentType:'application/json; charset=utf-8',
|
||||||
|
url: '/_api/kamerabild',
|
||||||
|
dataType: "json",
|
||||||
|
data: "",
|
||||||
|
success: function(content){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||||
|
* Copyright 2011-2015 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(/misc/glyphicons-halflings-regular.woff2) format('woff2'),url(/misc/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyLine truncated
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||||
|
* Copyright 2011-2015 Twitter, Inc.
|
||||||
|
* Licensed under the MIT license
|
||||||
|
*/
|
||||||
|
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&cLine truncated
|
||||||
|
d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
|
||||||
|
//@ sourceMappingURL=jquery.min.map
|
||||||
|
*/
|
||||||
|
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(eLine truncated
|
||||||
|
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])whilLine truncated
|
||||||
|
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(iLine truncated
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user