1
0

added diffrent cameras,param cape_compatible, toolbar improofments

This commit is contained in:
adrido 2014-02-28 08:51:39 +01:00
parent dc3ab60d3c
commit 662b6a390c
6 changed files with 182 additions and 120 deletions

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
img/invalid_skin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -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>
&nbsp; 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>
<!--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>
<viewpoint DEF='CA_Camera' position='0 0 40' fieldOfView='0.5'></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>

View File

@ -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'>&nbsp;Download</button> " + "<button onclick='shareSkin.show(" + answer.data[i].id + ")' class='permalink'>&nbsp;Share</button>" + "<button onclick='report(" + answer.data[i].id + ")' class='report'>&nbsp;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> &nbsp;" + "<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,7 +417,7 @@ function gotSkins(http) {
/* ==========================================================================
read the anchor
========================================================================== */
oldhash = '';
oldhash = 'something';
delay = 500;
checkAnchor = null;
hashobj = {
@ -444,7 +453,9 @@ function gotSkins(http) {
console.log("kein befehl gefunden,verwende default hash");
hashobj = defaulthash;
};
if(hashobj.filtertype =='all') {hashobj.filter= '';}
if (hashobj.filtertype == 'all') {
hashobj.filter = '';
}
oldhash = newhash;
onAnchorChange();
};
@ -511,6 +522,7 @@ function gotSkins(http) {
}
return str;
}
/* ==========================================================================
skinlist buttons
========================================================================== */
@ -566,10 +578,13 @@ function dateFormat(mysqldate) {
}
function goPage(page) {
if (Number(page) >= 1) {
hashobj.page = page;
hashmodified();
}
}
Date.createFromMysql = function(mysql_string) {
if ( typeof mysql_string === 'string') {
var t = mysql_string.split(/[- :]/);
@ -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,
@ -731,3 +746,19 @@ 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);
}
}

View File

@ -3,6 +3,12 @@
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{
@ -10,7 +16,7 @@ $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
}