Skip to content

Commit

Permalink
temp页未完成
Browse files Browse the repository at this point in the history
  • Loading branch information
LimitW committed May 24, 2015
1 parent 564ae4c commit 04fb608
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
12 changes: 4 additions & 8 deletions Print/Home/View/File/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<BLOCK name='content'>
<div class="container-fluid">
<div>
<h2>设置打印信息<button type="button" class="btn btn-primary btn-normal" data-toggle="modal" data-target="#printhelp">
打印帮助</button></h2>
<h2>设置打印信息<!--button type="button" class="btn btn-primary btn-normal" data-toggle="modal" data-target="#printhelp">
打印帮助</button--></h2>
</div>
<br/>
<form id="print" method="post" action="__URL__/uploadOne" onsubmit="return checkform();" enctype="multipart/form-data">
Expand Down Expand Up @@ -104,7 +104,7 @@ <h4 class="text-info">该店价格信息</h4>
</form>


<!-- Modal -->
<!-- Modal>
<div class="modal fade" id="printhelp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Expand All @@ -128,7 +128,7 @@ <h4 class="modal-title">打印帮助</h4>
</div>
</div>
</div>
</div>
</div-->


</div>
Expand All @@ -141,10 +141,6 @@ <h4 class="modal-title">打印帮助</h4>
$(function(){
$("[type='checkbox']").bootstrapSwitch();
$('.setting').hide();

$("#helpView").click(function(){
$('#helpView').toggleClass('btn-warning');
$('#help-info').toggle(100);});

$('#wait').on('switchChange.bootstrapSwitch',function(){
var fn = $('#upload-file').val();
Expand Down
46 changes: 21 additions & 25 deletions Print/Home/View/File/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<div class="container-fluid">
<div>
<h2>设置打印信息<button type="button" class="btn btn-primary btn-normal" data-toggle="modal" data-target="#printhelp">
打印帮助</button></h2>
<h2>设置打印信息<!--button type="button" class="btn btn-primary btn-normal" data-toggle="modal" data-target="#printhelp">
打印帮助</button--></h2>
</div>
<br/>
<form id="print" method="post" action="__URL__/uploadOne" enctype="multipart/form-data">
Expand Down Expand Up @@ -106,7 +106,7 @@ <h4 class="text-info">该店价格信息</h4>
</div>
</form>

<!-- Modal -->
<!-- Modal>
<div class="modal fade" id="printhelp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Expand All @@ -130,7 +130,7 @@ <h4 class="modal-title">打印帮助</h4>
</div>
</div>
</div>
</div>
</div-->


</div>
Expand All @@ -150,7 +150,7 @@ <h4 class="modal-title">打印帮助</h4>
};

Files.prototype.addFile = function(file) {
var legal = (file instanceof PDF)||(file instanceof DOC)||(file instanceof PPT)
var legal = (file instanceof PDF)||(file instanceof DOC)||(file instanceof PPT);
if (legal) {
this.files.push(file);
};
Expand All @@ -171,7 +171,7 @@ <h4 class="modal-title">打印帮助</h4>
} else {
alert(data.info);
}
});
});
}
else
{
Expand Down Expand Up @@ -242,15 +242,15 @@ <h4 class="modal-title">打印帮助</h4>
if (this.readyState==4) {
var file_view = $('#file_'+this.id);
var span = file_view.find('span');
if (this.status==200) {
if (this.status==200){
file_queue.files[this.id].uploadStatus = true;
file_queue.length++;
span.html('uploaded');
span.append('<button type="button" class="btn btn-danger btn-xs delete" onclick="deleteFile(this)">delete</button>');
span.html('<span class="glyphicon glyphicon-ok"></span>');
span.append('<button class="glyphicon glyphicon-remove delete" onclick="deleteFile(this)"></button>');
}
else {
span.html('upload failed');
span.append('<button type="button" class="btn btn-primary btn-xs re-upload" onclick="reUpload(this)">reUpload</button><button type="button" class="btn btn-danger btn-xs delete" onclick="deleteFile(this)">delete</button>');
span.html('上传失败');
span.append('<button class="glyphicon glyphicon-repeat re-upload" onclick="reUpload(this)"></button><button class="glyphicon glyphicon-remove delete" onclick="deleteFile(this)"></button>');
}
}
}
Expand All @@ -275,34 +275,30 @@ <h4 class="modal-title">打印帮助</h4>
};
var temp = function() {};
temp.prototype = File.prototype;

var PDF = function(id,name,suffix) {
File.apply(this,arguments);
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'<span style="color:red">uploading</span></li>');
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'<span><span class="btn btn-xs btn-success">上传中..</span></span></li>');
}
PDF.prototype = new temp();

var DOC = function(id,name,suffix) {
File.apply(this,arguments);
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'(支持的格式,但更推荐pdf)<span style="color:red">uploading</span></li>');
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'(支持的格式,但更推荐pdf)<span class="btn btn-xs btn-success">上传中..</span>');
}
DOC.prototype = new temp();

var PPT = function(id,name,suffix) {
File.apply(this,arguments);
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'<span style="color:red">uploading</span></li>');
$("#upload-list").append('<li class="list-group-item" id="file_'+id+'">当前文件:'+name +'<span class="btn btn-xs btn-success">上传中..</span>');
}
PPT.prototype = new temp();

var UNKNOWN = function(name,error_type) {
if(error_type=='big')
{
$("#upload-list").append('<li class="list-group-item">当前文件:'+filename +'<span style="color:red">文件太大了</span></li>');
}else if(error_typle =='suffix')
{
$("#upload-list").append('<li class="list-group-item">当前文件:'+name +'<span style="color:red">后缀名不对</span></li>');
}else{
}
if(error_type=='big') {
$("#upload-list").append('<li class="list-group-item">当前文件:'+filename +'<span class="btn btn-xs btn-danger">文件过大</span>');
} else if(error_typle =='suffix') {
$("#upload-list").append('<li class="list-group-item">当前文件:'+name +'<span class="btn btn-xs btn-danger">不支持的格式</span>');
} else{}
}

var file_queue = new Files();
Expand Down Expand Up @@ -460,7 +456,7 @@ <h4 class="modal-title">打印帮助</h4>
var span = file_view.find('span');
file_queue.files[this.id].uploadStatus = true;
file_queue.length++;
span.html('uploading');
span.html('上传中..');
}

function priceChange(n){
Expand Down Expand Up @@ -507,4 +503,4 @@ <h4 class="modal-title">打印帮助</h4>
});

</script>
</BLOCK>
</BLOCK>

0 comments on commit 04fb608

Please sign in to comment.