better uploading

This commit is contained in:
printempw 2016-02-05 11:22:35 +08:00
parent d41f2d88aa
commit 68283049bc
3 changed files with 7 additions and 13 deletions

View File

@ -2,7 +2,7 @@
* @Author: prpr
* @Date: 2016-01-21 19:12:06
* @Last Modified by: prpr
* @Last Modified time: 2016-02-04 22:57:13
* @Last Modified time: 2016-02-05 11:16:53
*/
.home-menu-blur {
@ -84,7 +84,7 @@ span {
display: inline !important;
}
.alert {
margin: 20px 0 0;
margin: 20px 0 10px;
}
input[type=radio] {
margin: 20px 0 0;

View File

@ -2,7 +2,7 @@
* @Author: prpr
* @Date: 2016-01-21 13:56:40
* @Last Modified by: prpr
* @Last Modified time: 2016-02-05 11:08:02
* @Last Modified time: 2016-02-05 11:16:43
*/
'use strict';
@ -71,15 +71,9 @@ $("[title='Rotation']").click(function(){
$("#upload").click(function(){
var skin_file = $("#skininput").get(0).files[0];
var cape_file = $("#capeinput").get(0).files[0];
var form_data = new FormData();
if (skin_file) {
form_data.append('skin_file', skin_file);
}
if (cape_file) {
form_data.append('cape_file', cape_file);
}
form_data.append('uname', docCookies.getItem('uname'));
if (skin_file) form_data.append('skin_file', skin_file);
if (cape_file) form_data.append('cape_file', cape_file);
if (skin_file || cape_file) {
$.ajax({
type: 'POST',

View File

@ -76,7 +76,7 @@ if (isset($_SESSION['uname'])) {
<input type="radio" id="model" name="model" />My skin fits on the new Alex player model.
<br /><br />
<button id="upload" class="pure-button pure-button-primary">Upload</button>
<a href="?action=preview" class="pure-button">Preview</a>
<a href="javascript:show2dPreview();" class="pure-button">2D Preview</a>
</div>
<div id="msg" class="alert hide" role="alert"></div>
</div>
@ -84,7 +84,7 @@ if (isset($_SESSION['uname'])) {
</div>
<div class="pure-u-md-1-2 pure-u-1">
<div class="panel panel-default">
<div class="panel-heading">Preview
<div class="panel-heading">3D Preview
<div class="operations">
<span title="Movements" class="glyphicon glyphicon-pause"></span>
<span title="Running" class="glyphicon glyphicon-forward"></span>