added diffrent cameras,param cape_compatible, toolbar improofments
This commit is contained in:
parent
dc3ab60d3c
commit
662b6a390c
BIN
img/camera-photo-6.png
Normal file
BIN
img/camera-photo-6.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
img/camera-video-2.png
Normal file
BIN
img/camera-video-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
img/invalid_skin.png
Normal file
BIN
img/invalid_skin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
41
index.html
41
index.html
@ -18,18 +18,27 @@
|
||||
<body>
|
||||
|
||||
<div id="toolbarleft" class="toolbar">
|
||||
|
||||
<button onclick="resetView();">
|
||||
<button class="toolbarelem" onclick="resetView();">
|
||||
Reset View
|
||||
</button>
|
||||
<button onclick="getScreenshot();">
|
||||
Create Screenshot
|
||||
<button title="create screenshot" onclick="getScreenshot();">
|
||||
<img src="/img/camera-photo-6.png" />
|
||||
</button>
|
||||
Background:
|
||||
<select id="background" disabled="">
|
||||
<option>blank</option>
|
||||
<option>---</option>
|
||||
</select>
|
||||
<label class="toolbarelem"><img src="/img/camera-video-2.png" />
|
||||
<select class="styled-select" id="camselect" onchange="document.getElementById('cam_'+this.value).setAttribute('set_bind','true');">
|
||||
<option selected="selected">default</option>
|
||||
<option disabled="disabled" class="seperator">-----</option>
|
||||
<option>back</option>
|
||||
<option>front</option>
|
||||
<option disabled="disabled" class="seperator">-----</option>
|
||||
<option>bottom</option>
|
||||
<option>top</option>
|
||||
<option disabled="disabled" class="seperator">-----</option>
|
||||
<option>left</option>
|
||||
<option>right</option>
|
||||
<option disabled="disabled" class="seperator">-----</option>
|
||||
<option value="invalid">cape (0.4.10)</option>
|
||||
</select></label>
|
||||
|
||||
</div>
|
||||
<div id="toolbarright" class="toolbar">
|
||||
@ -99,13 +108,21 @@
|
||||
</transform>
|
||||
</transform>
|
||||
</transform>
|
||||
|
||||
<viewpoint DEF='CA_Camera' position='0 0 40' fieldOfView='0.5'></viewpoint>
|
||||
<!--position="x y z"-->
|
||||
<viewpoint id="cam_default" position='0 0 40' orientation="0 0 1 0" ></viewpoint>
|
||||
<viewpoint id="cam_invalid" position="-15 0 -10" fieldOfView='0.5' orientation="0 4.14 0 4.1415927410125732" ></viewpoint>
|
||||
<viewpoint id="cam_back" position="0 0 -30" orientation="0 1 0 3.1415927410125732" ></viewpoint>
|
||||
<viewpoint id="cam_front" position="0 0 30" orientation="0 0 1 0" ></viewpoint>
|
||||
<viewpoint id="cam_bottom" position="0 -23 0" orientation="1 0 0.00017263348854612559 1.5707962512969971"></viewpoint>
|
||||
<viewpoint id="cam_top" position="0 23 0" orientation="0 0.7071068286895752 0.70710676908493042 3.1413483619689941"></viewpoint>
|
||||
<viewpoint id="cam_left" position="-30 0 0" orientation="0 -0.99999994039535522 0.00017263348854612559 1.5707962512969971"></viewpoint>
|
||||
<viewpoint id="cam_right" position="30 0 0" orientation="0 0.99999994039535522 -0.00017263348854612559 1.5707962512969971"></viewpoint>
|
||||
|
||||
|
||||
</scene>
|
||||
</x3d>
|
||||
|
||||
<div id="skinlist" class="select" >
|
||||
<div id="skinlist" class="select" onscroll="nextElements()">
|
||||
<div id="dnd" class="option">
|
||||
<img src="img/addskin.png" class="thumb" style="cursor:default;">
|
||||
<h2>Here could be your skin!</h2>
|
||||
|
233
js/main.js
233
js/main.js
@ -21,7 +21,7 @@ function mysql2Date(timestamp) {
|
||||
return new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);
|
||||
}
|
||||
|
||||
function Skin(id, name, img, type, author, license, uploaded) {
|
||||
function Skin(id, name, img, type, author, license, uploaded, cape_compatible) {
|
||||
this.id = Number(id);
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
@ -39,6 +39,7 @@ function Skin(id, name, img, type, author, license, uploaded) {
|
||||
this.img = img;
|
||||
this.license = license;
|
||||
this.uploaded = mysql2Date(uploaded);
|
||||
this.cape_compatible = (cape_compatible == 1) ? true : false;
|
||||
};
|
||||
Skinlist = new Array();
|
||||
function License(id, name, url, text, imgurl) {
|
||||
@ -318,7 +319,7 @@ function gotSkins(http) {
|
||||
while (answer.data[i]) {
|
||||
var skin = answer.data[i];
|
||||
var license = Licenses[skin.license_id];
|
||||
Skinlist[Number(skin.id)] = new Skin(skin.id, skin.name, skin.img, skin.type, skin.author, license, skin.uploaded);
|
||||
Skinlist[Number(skin.id)] = new Skin(skin.id, skin.name, skin.img, skin.type, skin.author, license, skin.uploaded, skin.cape_compatible);
|
||||
var block = document.createElement('div');
|
||||
block.className = "option";
|
||||
var img = new Image();
|
||||
@ -352,6 +353,12 @@ function gotSkins(http) {
|
||||
//titel Ende
|
||||
var eigenschaften = document.createElement('span');
|
||||
eigenschaften.innerHTML = "<span class='rightbuttons'><button onclick='download(" + answer.data[i].id + ")' class='download'> Download</button> " + "<button onclick='shareSkin.show(" + answer.data[i].id + ")' class='permalink'> Share</button>" + "<button onclick='report(" + answer.data[i].id + ")' class='report'> Report</button></span> <br>" + "Author: <a href='#!page:1,filtertype:Author,filter:" + answer.data[i].author + "'>" + answer.data[i].author + "</a> <br>" + "License: <a href='#!page:1,filtertype:License,filter:" + answer.data[i].license + "'>" + answer.data[i].license + "</a> " + "<a href='" + getLicenseById(answer.data[i].license_id).url + "' onclick='showLicenseInfo(" + answer.data[i].license_id + ");return false;'><img src=" + getLicenseById(answer.data[i].license_id).imgurl + "></a> <br>" + "Uploaded at: " + dateFormat(answer.data[i].uploaded) + "<br>";
|
||||
var warning = document.createElement('span');
|
||||
if (Skinlist[Number(skin.id)].cape_compatible == false) {//if the skin is not compatible
|
||||
block.className += " invalid";
|
||||
warning.className = "warning";
|
||||
warning.innerHTML = "This skin is maybe not compatible with the upcomming minetest 0.4.10 <a class='actionlink' href='/helpfiles/cape_compatible.html' onclick='showHelp(\"cape_compatible\");return false;'>What does this message mean</a>";
|
||||
}
|
||||
|
||||
//Eigenschaften ende
|
||||
block.insertBefore(img, null);
|
||||
@ -359,6 +366,8 @@ function gotSkins(http) {
|
||||
block.insertBefore(titel, null);
|
||||
block.insertBefore(eigenschaften, null);
|
||||
//zu guter letzt die Eigenschaften
|
||||
block.insertBefore(warning, null);
|
||||
|
||||
document.getElementById('skinlist').insertBefore(block, null);
|
||||
//anschliesend den block einfuegen
|
||||
i++;
|
||||
@ -408,109 +417,112 @@ function gotSkins(http) {
|
||||
/* ==========================================================================
|
||||
read the anchor
|
||||
========================================================================== */
|
||||
oldhash = '';
|
||||
delay = 500;
|
||||
checkAnchor = null;
|
||||
hashobj = {
|
||||
page : 1,
|
||||
filter : "",
|
||||
filtertype : "all"
|
||||
};
|
||||
defaulthash = {
|
||||
page : 1,
|
||||
filter : "",
|
||||
filtertype : "all"
|
||||
oldhash = 'something';
|
||||
delay = 500;
|
||||
checkAnchor = null;
|
||||
hashobj = {
|
||||
page : 1,
|
||||
filter : "",
|
||||
filtertype : "all"
|
||||
};
|
||||
defaulthash = {
|
||||
page : 1,
|
||||
filter : "",
|
||||
filtertype : "all"
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
function anchor() {
|
||||
var newhash = location.hash;
|
||||
if (oldhash != newhash) {
|
||||
console.log("hash wurde veraendert");
|
||||
if (newhash.indexOf('#!') != -1) {
|
||||
console.log("kopiere neue daten in den hash");
|
||||
cmd = newhash.split('!');
|
||||
obj = parseQuery(cmd[1]);
|
||||
for (var i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
if (hashobj[i] != undefined)//wert existiert
|
||||
{
|
||||
hashobj[i] = obj[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log("kein befehl gefunden,verwende default hash");
|
||||
hashobj = defaulthash;
|
||||
};
|
||||
if(hashobj.filtertype =='all') {hashobj.filter= '';}
|
||||
oldhash = newhash;
|
||||
onAnchorChange();
|
||||
};
|
||||
checkAnchor = setTimeout(anchor, delay);
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", anchor, false);
|
||||
|
||||
function hashmodified() {
|
||||
var str = decodeQuery(hashobj);
|
||||
location.hash = "#!" + str;
|
||||
}
|
||||
|
||||
function onAnchorChange() {
|
||||
console.debug(hashobj);
|
||||
obj = hashobj;
|
||||
clearList();
|
||||
var get = "page=" + obj.page;
|
||||
document.getElementById('filtertype').selectedIndex = 0;
|
||||
//document.getElementById('filter').value = '';
|
||||
//document.getElementById('filter').disabled = true;
|
||||
if (obj.filtertype !=undefined && obj.filter != undefined) {
|
||||
get += "&filtertype=" + obj.filtertype + "&filter=" + obj.filter + "";
|
||||
document.getElementById('filter').value = obj.filter;
|
||||
document.getElementById('filter').disabled = false;
|
||||
switch(obj.filtertype) {
|
||||
case "Author":
|
||||
document.getElementById('filtertype').selectedIndex = 1;
|
||||
break;
|
||||
case "License":
|
||||
document.getElementById('filtertype').selectedIndex = 2;
|
||||
break;
|
||||
case "Id":
|
||||
document.getElementById('filtertype').selectedIndex = 3;
|
||||
break;
|
||||
case "Name":
|
||||
document.getElementById('filtertype').selectedIndex = 4;
|
||||
break;
|
||||
default:
|
||||
document.getElementById('filtertype').selectedIndex = 0;
|
||||
break;
|
||||
function anchor() {
|
||||
var newhash = location.hash;
|
||||
if (oldhash != newhash) {
|
||||
console.log("hash wurde veraendert");
|
||||
if (newhash.indexOf('#!') != -1) {
|
||||
console.log("kopiere neue daten in den hash");
|
||||
cmd = newhash.split('!');
|
||||
obj = parseQuery(cmd[1]);
|
||||
for (var i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
if (hashobj[i] != undefined)//wert existiert
|
||||
{
|
||||
hashobj[i] = obj[i];
|
||||
}
|
||||
}
|
||||
getSkins(get);
|
||||
|
||||
}
|
||||
|
||||
function parseQuery(qstr) {
|
||||
var query = {};
|
||||
var a = qstr.split(',');
|
||||
for (var i in a) {
|
||||
var b = a[i].split(':');
|
||||
if (b[0] != '')
|
||||
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
||||
}
|
||||
} else {
|
||||
console.log("kein befehl gefunden,verwende default hash");
|
||||
hashobj = defaulthash;
|
||||
};
|
||||
if (hashobj.filtertype == 'all') {
|
||||
hashobj.filter = '';
|
||||
}
|
||||
oldhash = newhash;
|
||||
onAnchorChange();
|
||||
};
|
||||
checkAnchor = setTimeout(anchor, delay);
|
||||
};
|
||||
|
||||
return query;
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", anchor, false);
|
||||
|
||||
function hashmodified() {
|
||||
var str = decodeQuery(hashobj);
|
||||
location.hash = "#!" + str;
|
||||
}
|
||||
|
||||
function onAnchorChange() {
|
||||
console.debug(hashobj);
|
||||
obj = hashobj;
|
||||
clearList();
|
||||
var get = "page=" + obj.page;
|
||||
document.getElementById('filtertype').selectedIndex = 0;
|
||||
//document.getElementById('filter').value = '';
|
||||
//document.getElementById('filter').disabled = true;
|
||||
if (obj.filtertype != undefined && obj.filter != undefined) {
|
||||
get += "&filtertype=" + obj.filtertype + "&filter=" + obj.filter + "";
|
||||
document.getElementById('filter').value = obj.filter;
|
||||
document.getElementById('filter').disabled = false;
|
||||
switch(obj.filtertype) {
|
||||
case "Author":
|
||||
document.getElementById('filtertype').selectedIndex = 1;
|
||||
break;
|
||||
case "License":
|
||||
document.getElementById('filtertype').selectedIndex = 2;
|
||||
break;
|
||||
case "Id":
|
||||
document.getElementById('filtertype').selectedIndex = 3;
|
||||
break;
|
||||
case "Name":
|
||||
document.getElementById('filtertype').selectedIndex = 4;
|
||||
break;
|
||||
default:
|
||||
document.getElementById('filtertype').selectedIndex = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
getSkins(get);
|
||||
|
||||
}
|
||||
|
||||
function parseQuery(qstr) {
|
||||
var query = {};
|
||||
var a = qstr.split(',');
|
||||
for (var i in a) {
|
||||
var b = a[i].split(':');
|
||||
if (b[0] != '')
|
||||
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
function decodeQuery(qobj) {
|
||||
var str = "";
|
||||
for (var attr in qobj) {
|
||||
str += attr + ':' + qobj[attr] + ",";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function decodeQuery(qobj) {
|
||||
var str = "";
|
||||
for (var attr in qobj) {
|
||||
str += attr + ':' + qobj[attr] + ",";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
/* ==========================================================================
|
||||
skinlist buttons
|
||||
========================================================================== */
|
||||
@ -566,8 +578,11 @@ function dateFormat(mysqldate) {
|
||||
}
|
||||
|
||||
function goPage(page) {
|
||||
hashobj.page = page;
|
||||
hashmodified();
|
||||
if (Number(page) >= 1) {
|
||||
hashobj.page = page;
|
||||
hashmodified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Date.createFromMysql = function(mysql_string) {
|
||||
@ -645,7 +660,7 @@ function getHelpUrl(about) {
|
||||
|
||||
function showHelp(about) {
|
||||
TINY.box.show({
|
||||
url : getHelpUrl(about),
|
||||
iframe : getHelpUrl(about),
|
||||
boxid : 'frameless',
|
||||
width : 800,
|
||||
height : 600,
|
||||
@ -730,4 +745,20 @@ function vollbild() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var global_laden = false;
|
||||
function nextElements() {
|
||||
var element = document.getElementById('skinlist');
|
||||
var height = element.scrollTopMax;
|
||||
var scroll = element.scrollTop;
|
||||
var diff = height - scroll;
|
||||
if (diff <= 200 && global_laden == false) {
|
||||
global_laden = true;
|
||||
console.log("runtergescrollt zu "+diff);
|
||||
}
|
||||
else if(element.scrollTopMax-diff <=200 && global_laden == false){
|
||||
global_laden = true;
|
||||
console.log("hochgescrollt zu "+diff);
|
||||
}
|
||||
}
|
@ -3,14 +3,20 @@
|
||||
include("connectsql.php");
|
||||
|
||||
if (isset($_POST[id],$_POST[topic],$_POST[text])) {
|
||||
|
||||
|
||||
if ($_POST[topic] == "123") {
|
||||
$sql = "UPDATE `fensta`.`mt_skins` SET `cape_compatible` = '0' WHERE `mt_skins`.`id` = $_POST[id];";
|
||||
mysql_query($sql);
|
||||
//echo $sql;
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
|
||||
$empfaenger = $report_mail; //Mailadresse
|
||||
//$absender = "ich@versuchsratte.de";
|
||||
$betreff = "report Skin # $_POST[id]";
|
||||
$mailtext = <<<TXT
|
||||
somebody reported $_POST[topic] to skin $_POST[id] with the following comment:
|
||||
$_POST[email] reported $_POST[topic] to skin $_POST[id] with the following comment:
|
||||
-----------------
|
||||
$_POST[text]
|
||||
------------------
|
||||
@ -22,8 +28,12 @@ TXT;
|
||||
mail( $empfaenger,
|
||||
$betreff,
|
||||
$mailtext);
|
||||
|
||||
echo "thanks for reporting the skin #$_POST[id] , ill look at it asap.";
|
||||
}
|
||||
echo "thanks for reporting the skin #$_POST[id] , <br>
|
||||
ill look at it asap.<br>
|
||||
<hr><br>
|
||||
<button type='button' onclick='oldhash=123;TINY.box.hide();'>Proceed</button>
|
||||
";
|
||||
|
||||
|
||||
|
||||
@ -33,16 +43,20 @@ echo "thanks for reporting the skin #$_POST[id] , ill look at it asap.";
|
||||
<form action="reportSkin.php" method="post" onsubmit="return submitReport(this);" onreset="return resetReport(this);">
|
||||
<input name="id" type="hidden" value="<?=$_POST[id]?>"/>
|
||||
<h1>Report Skin #<?=$_POST[id]?></h1>
|
||||
<div>enter your e-mail address (for the reason if i have questions)<input type="email" name="email" required="required"/></div><br>
|
||||
<div><fieldset style="display: inline-block;float: left;"><legend>What do you want to report?</legend>
|
||||
<select name="topic" size="5" style="height: 100px; width: 170px" required>
|
||||
<select name="topic" size="5" style="height: 100px; width: 220px" required>
|
||||
<option>Stolen Skin</option>
|
||||
<option>Invalid Skin file</option>
|
||||
<option value="123">incompatible with minetest 0.4.10</option>
|
||||
<option>Wrong Skin Information</option>
|
||||
<option>Something other</option>
|
||||
|
||||
</select></fieldset>
|
||||
<fieldset style="display: inline-block;"><legend>Please write a short comment!</legend>
|
||||
<textarea name="text" style="height: 100px; width: 300px" required></textarea></fieldset></div>
|
||||
<button type="submit">Send it!</button><button type="reset" class="abort">Abort!</button><br>
|
||||
<hr>
|
||||
<button class="ok" type="submit">Send it!</button><button type="reset" class="abort">Abort!</button><br><br>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user