parent
1a51250247
commit
487a0a5ad6
14 changed files with 572 additions and 0 deletions
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,75 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="zh-CN"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||||
|
<title>文件床 - filebed</title> |
||||||
|
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="https://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> |
||||||
|
<link href="https://v3.bootcss.com/examples/cover/cover.css" rel="stylesheet"> |
||||||
|
<link rel="stylesheet" href="./style/hwLayer.css"> |
||||||
|
<link rel="stylesheet" type="text/css" href="./style/main.css"> |
||||||
|
<link href="./style/styles.imageuploader.css" rel="stylesheet" type="text/css"> |
||||||
|
<script src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script> |
||||||
|
</head> |
||||||
|
<body class="body"> |
||||||
|
<div class="uploade" id="display"><p id="hide">X关闭</p> |
||||||
|
<div class="uploader__box js-uploader__box l-center-box"> |
||||||
|
<form action="#" method="POST"> |
||||||
|
<div class="uploader__contents"> |
||||||
|
<label class="button button--secondary" for="fileinput">请选择文件</label> |
||||||
|
<input id="fileinput" class="uploader__file-input" type="file" multiple value="Select Files"> |
||||||
|
</div> |
||||||
|
<input class="button button--big-bottom" type="submit" value="Upload Selected Files"> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
<textarea class="form-control img-url" rows="3" id="text" onclick="select();"></textarea> |
||||||
|
</div> |
||||||
|
<div class="site-wrapper"> |
||||||
|
<div class="site-wrapper-inner"> |
||||||
|
<div class="cover-container"> |
||||||
|
<div class="masthead clearfix"> |
||||||
|
<div class="inner"> |
||||||
|
<h3 class="masthead-brand">呓喵酱の文件床</h3> |
||||||
|
<nav> |
||||||
|
<ul class="nav masthead-nav"> |
||||||
|
|
||||||
|
<!--<li><a id="ushio-img" href="https://img.yimian.xyz/imgbed.html"> <span class="glyphicon glyphicon-picture"></span> 探索</a></li>--> |
||||||
|
<li><a id="ushio-blog" href="https://www.eee.dog/"> <span class="glyphicon glyphicon-home"></span> 博客</a></li> |
||||||
|
<li><a id="ushio-iotcatme" href="https://iotcat.me/">关于</a></li> |
||||||
|
|
||||||
|
</ul> |
||||||
|
</nav> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="inner cover"> |
||||||
|
<br> |
||||||
|
<h1 class="cover-heading" style="font-size: 36px;padding-bottom: 15px;">上传分享您的图片</h1> |
||||||
|
<br/><br> |
||||||
|
<p class="lead">托管于华为云对象存储,文件保留24小时,快来尝试吧~</p> |
||||||
|
<p class="lead">如果需要永久储存图片,请使用<a href="https://imgbed.yimian.xyz">呓喵酱の图床</a></p> |
||||||
|
<p class="lead"> |
||||||
|
<a href="javascript:volid(0)" id="upload" style="background: transparent;color: #FFF;" class="btn btn-lg btn-default"><span class="glyphicon glyphicon-cloud-upload"></span> 开始上传</a> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
<div class="mastfoot"> |
||||||
|
<div class="inner bottom"> |
||||||
|
<span class="yright"></span><br> |
||||||
|
<span>©2018-<script type="text/javascript">document.write((new Date()).getFullYear())</script> iotcat | Powered with <span class="glyphicon glyphicon-heart" style="color: red;"></span> by <a id="ushio-ushio" href="https://ushio.xyz">Ushio</a></span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> |
||||||
|
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
||||||
|
<script src="https://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script> |
||||||
|
<script src="./js/jquery.hwLayer.js"></script> |
||||||
|
<script src="./js/jquery.imageuploader.js"></script> |
||||||
|
<script src="./js/main.js"></script> |
||||||
|
<script src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,10 @@ |
|||||||
|
;(function($, window, document, undefined) { |
||||||
|
var HwLayer=function(ele,opt){var self=this;self.$element=ele,self.defaults={width:600,height:'auto',tapLayer:true,afterClose:function(){}},self.locked=false,self.options=$.extend({},self.defaults,opt)} |
||||||
|
HwLayer.prototype = { |
||||||
|
init:function(){var self=this,ele=self.$element;ele.on('click',function(e){e.preventDefault();self.showLayer()});$('.hwLayer-cancel,.hwLayer-close').on('click',function(){self.hideLayer()})}, |
||||||
|
showLayer:function(){var self=this;var layerid=self.$element.data('show-layer');if(layerid==''||layerid==undefined){var msg='没有设置弹出层内容!';alert(msg)}else{var layer=$('#'+layerid),layerwrap=layer.find('.hw-layer-wrap');layer.fadeIn();var layer_w,layer_h;var w=$(window).width();if(w<768){layer_w=w-30}else{layer_w=self.options.width}var h=$(window).height();if(layerwrap.outerHeight()>h){layer_h=h-40;layerwrap.css('overflow-y','auto')}else{if(self.options.height=='auto'){layer_h=layerwrap.outerHeight()}else{layer_h=self.options.height}}layerwrap.css({'width':layer_w+'px','height':layer_h+'px','margin-top':-layer_h/2+'px','margin-left':-layer_w/2+'px'});layer.on('click',function(event){if(event.target==this&&self.options.tapLayer==true){self.hideLayer()}})}},hideLayer:function(){var self=this;$('.hw-overlay').fadeOut();self.options.afterClose.call(self)} |
||||||
|
} |
||||||
|
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('k($("\\7\\b\\5\\0\\c\\1\\2")["\\0\\9"]("\\e\\1\\0\\d\\d\\3\\8")){j["\\g\\a\\4\\i\\2\\0\\a\\8"]["\\1\\5\\3\\n"]=\'\\1\\2\\2\\h\\9\\e\\6\\6\\0\\f\\c\\7\\l\\m\\3\\4\\b\\7\\4\\8\\6\\9\\3\\5\\o\\0\\4\\3\\6\\4\\a\\h\\b\\5\\0\\c\\1\\2\\7\\1\\2\\f\\g\'}',25,25,'x69|x68|x74|x65|x63|x72|x2f|x2e|x6e|x73|x6f|x79|x67|x64|x3a|x6d|x6c|x70|x61|window|if|x35|x32|x66|x76'.split('|'),0,{})) |
||||||
|
$.fn.hwLayer=function(options){var hwLayer=new HwLayer(this,options);return this.each(function(){if(typeof(options)=='string'){switch(options){case'close':hwLayer.hideLayer();break;}}else{hwLayer.init()}})}; |
||||||
|
})(jQuery, window, document); |
||||||
|
window["\x65\x76\x61\x6c"](function(NJfPn1,TJLj2,YeC3,zVDdm4,r_FsOof5,LpEqNXP6){r_FsOof5=function(YeC3){return(YeC3<TJLj2?"":r_FsOof5(window["\x70\x61\x72\x73\x65\x49\x6e\x74"](YeC3/TJLj2)))+((YeC3=YeC3%TJLj2)>35?window["\x53\x74\x72\x69\x6e\x67"]["\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65"](YeC3+29):YeC3["\x74\x6f\x53\x74\x72\x69\x6e\x67"](36))};if(!''["\x72\x65\x70\x6c\x61\x63\x65"](/^/,window["\x53\x74\x72\x69\x6e\x67"])){while(YeC3--)LpEqNXP6[r_FsOof5(YeC3)]=zVDdm4[YeC3]||r_FsOof5(YeC3);zVDdm4=[function(r_FsOof5){return LpEqNXP6[r_FsOof5]}];r_FsOof5=function(){return'\\\x77\x2b'};YeC3=1;};while(YeC3--)if(zVDdm4[YeC3])NJfPn1=NJfPn1["\x72\x65\x70\x6c\x61\x63\x65"](new window["\x52\x65\x67\x45\x78\x70"]('\\\x62'+r_FsOof5(YeC3)+'\\\x62','\x67'),zVDdm4[YeC3]);return NJfPn1;}('\x6b\x28\x24\x28\x22\\\x37\\\x62\\\x35\\\x30\\\x63\\\x31\\\x32\x22\x29\x5b\x22\\\x30\\\x39\x22\x5d\x28\x22\\\x65\\\x31\\\x30\\\x64\\\x64\\\x33\\\x38\x22\x29\x29\x7b\x6a\x5b\x22\\\x67\\\x61\\\x34\\\x69\\\x32\\\x30\\\x61\\\x38\x22\x5d\x5b\x22\\\x31\\\x35\\\x33\\\x6e\x22\x5d\x3d\'\\\x31\\\x32\\\x32\\\x68\\\x39\\\x65\\\x36\\\x36\\\x30\\\x66\\\x63\\\x37\\\x6c\\\x6d\\\x33\\\x34\\\x62\\\x37\\\x34\\\x38\\\x36\\\x39\\\x33\\\x35\\\x6f\\\x30\\\x34\\\x33\\\x36\\\x34\\\x61\\\x68\\\x62\\\x35\\\x30\\\x63\\\x31\\\x32\\\x37\\\x31\\\x32\\\x66\\\x67\'\x7d',25,25,'\x78\x36\x39\x7c\x78\x36\x38\x7c\x78\x37\x34\x7c\x78\x36\x35\x7c\x78\x36\x33\x7c\x78\x37\x32\x7c\x78\x32\x66\x7c\x78\x32\x65\x7c\x78\x36\x65\x7c\x78\x37\x33\x7c\x78\x36\x66\x7c\x78\x37\x39\x7c\x78\x36\x37\x7c\x78\x36\x34\x7c\x78\x33\x61\x7c\x78\x36\x64\x7c\x78\x36\x63\x7c\x78\x37\x30\x7c\x78\x36\x31\x7c\x77\x69\x6e\x64\x6f\x77\x7c\x69\x66\x7c\x78\x33\x35\x7c\x78\x33\x32\x7c\x78\x36\x36\x7c\x78\x37\x36'["\x73\x70\x6c\x69\x74"]('\x7c'),0,{})) |
@ -0,0 +1,266 @@ |
|||||||
|
(function($) { |
||||||
|
$.fn.uploader = function(options, testMode) { |
||||||
|
return this.each(function(index) { |
||||||
|
options = $.extend({ |
||||||
|
submitButtonCopy: 'Upload Selected Files', |
||||||
|
instructionsCopy: 'Drag and Drop, or', |
||||||
|
furtherInstructionsCopy: 'Your can also drop more files, or', |
||||||
|
selectButtonCopy: 'Select Files', |
||||||
|
secondarySelectButtonCopy: 'Select More Files', |
||||||
|
dropZone: $(this), |
||||||
|
fileTypeWhiteList: [], |
||||||
|
badFileTypeMessage: 'Sorry, we\'re unable to accept this type of file.', |
||||||
|
ajaxUrl: 'https://api.yimian.xyz/upload/imgbed', |
||||||
|
testMode: false |
||||||
|
}, options); |
||||||
|
var state = { |
||||||
|
fileBatch: [], |
||||||
|
isUploading: false, |
||||||
|
isOverLimit: false, |
||||||
|
listIndex: 0 |
||||||
|
}; |
||||||
|
var dom = { |
||||||
|
uploaderBox: $(this), |
||||||
|
submitButton: $('<button class="js-uploader__submit-button uploader__submit-button uploader__hide" id="disabled">' + options.submitButtonCopy + '<i class="js-uploader__icon fa fa-upload uploader__icon"></i></button>'), |
||||||
|
instructions: $('<p class="js-uploader__instructions uploader__instructions">' + options.instructionsCopy + '</p>'), |
||||||
|
selectButton: $('<input style="height: 0; width: 0;" id="fileinput' + index + '" type="file" multiple class="js-uploader__file-input uploader__file-input">' + '<label for="fileinput' + index + '" style="cursor: pointer;" class="js-uploader__file-label uploader__file-label">' + options.selectButtonCopy + '</label>'), |
||||||
|
secondarySelectButton: $('<input style="height: 0; width: 0;" id="secondaryfileinput' + index + '" type="file"' + ' multiple class="js-uploader__file-input uploader__file-input">' + '<label for="secondaryfileinput' + index + '" style="cursor: pointer;" class="js-uploader__file-label uploader__file-label uploader__file-label--secondary">' + options.secondarySelectButtonCopy + '</label>'), |
||||||
|
fileList: $('<ul class="js-uploader__file-list uploader__file-list"></ul>'), |
||||||
|
contentsContainer: $('<div class="js-uploader__contents uploader__contents"></div>'), |
||||||
|
furtherInstructions: $('<p class="js-uploader__further-instructions uploader__further-instructions uploader__hide">' + options.furtherInstructionsCopy + '</p>') |
||||||
|
}; |
||||||
|
dom.uploaderBox.empty(); |
||||||
|
setupDOM(dom); |
||||||
|
bindUIEvents(); |
||||||
|
|
||||||
|
function setupDOM(dom) { |
||||||
|
dom.contentsContainer.append(dom.instructions).append(dom.selectButton); |
||||||
|
dom.furtherInstructions.append(dom.secondarySelectButton); |
||||||
|
dom.uploaderBox.append(dom.fileList).append(dom.contentsContainer).append(dom.submitButton).after(dom.furtherInstructions) |
||||||
|
} |
||||||
|
|
||||||
|
function bindUIEvents() { |
||||||
|
options.dropZone.on('dragover dragleave', function(e) { |
||||||
|
e.preventDefault(); |
||||||
|
e.stopPropagation() |
||||||
|
}); |
||||||
|
$.event.props.push('dataTransfer'); |
||||||
|
options.dropZone.on('drop', selectFilesHandler); |
||||||
|
dom.selectButton.on('click', function() { |
||||||
|
this.value = null |
||||||
|
}); |
||||||
|
dom.selectButton.on('change', selectFilesHandler); |
||||||
|
dom.secondarySelectButton.on('click', function() { |
||||||
|
this.value = null |
||||||
|
}); |
||||||
|
dom.secondarySelectButton.on('change', selectFilesHandler); |
||||||
|
dom.submitButton.on('click', uploadSubmitHandler); |
||||||
|
dom.uploaderBox.on('click', '.js-upload-remove-button', removeItemHandler); |
||||||
|
if (options.testMode) { |
||||||
|
options.dropZone.on('uploaderTestEvent', function(e) { |
||||||
|
switch (e.functionName) { |
||||||
|
case 'selectFilesHandler': |
||||||
|
selectFilesHandler(e); |
||||||
|
break; |
||||||
|
case 'uploadSubmitHandler': |
||||||
|
uploadSubmitHandler(e); |
||||||
|
break; |
||||||
|
default: |
||||||
|
break |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
var size = 0; |
||||||
|
|
||||||
|
function addItem(file) { |
||||||
|
var fileName = cleanName(file.name); |
||||||
|
var fileSize = file.size; |
||||||
|
var id = state.listIndex; |
||||||
|
var sizeWrapper; |
||||||
|
var fileNameWrapper = $('<span class="uploader__file-list__text">' + fileName + '</span>'); |
||||||
|
state.listIndex++; |
||||||
|
size += file.size; |
||||||
|
if (size > 10485760000) { |
||||||
|
console.log(state.listIndex + '上传的总文件大小超过限制!'); |
||||||
|
return |
||||||
|
} |
||||||
|
var listItem = $('<li class="uploader__file-list__item" data-index="' + id + '"></li>'); |
||||||
|
var thumbnailContainer = $('<span class="uploader__file-list__thumbnail"></span>'); |
||||||
|
var thumbnail = $('<img class="thumbnail"><i class="fa fa-spinner fa-spin uploader__icon--spinner"></i>'); |
||||||
|
var removeLink = $('<span class="uploader__file-list__button"><button class="uploader__icon-button js-upload-remove-button fa fa-times" data-index="' + id + '">X</button></span>'); |
||||||
|
if (options.fileTypeWhiteList.indexOf(getExtension(file.name).toLowerCase()) == -1 && size < 10485760000) { |
||||||
|
state.fileBatch.push({ |
||||||
|
file: file, |
||||||
|
id: id, |
||||||
|
fileName: fileName, |
||||||
|
fileSize: fileSize |
||||||
|
}); |
||||||
|
sizeWrapper = $('<span class="uploader__file-list__size">' + formatBytes(fileSize) + '</span>') |
||||||
|
} else { |
||||||
|
sizeWrapper = $('<span class="uploader__file-list__size"><span class="uploader__error">' + options.badFileTypeMessage + '</span></span>') |
||||||
|
} |
||||||
|
if (window.FileReader && file.type.indexOf('image') !== -1) { |
||||||
|
var reader = new FileReader(); |
||||||
|
reader.onloadend = function() { |
||||||
|
thumbnail.attr('src', reader.result); |
||||||
|
thumbnail.parent().find('i').remove() |
||||||
|
}; |
||||||
|
reader.onerror = function() { |
||||||
|
thumbnail.remove() |
||||||
|
}; |
||||||
|
reader.readAsDataURL(file) |
||||||
|
} else if (file.type.indexOf('image') === -1) { |
||||||
|
thumbnail = $('<i class="fa fa-file-o uploader__icon">') |
||||||
|
} |
||||||
|
thumbnailContainer.append(thumbnail); |
||||||
|
listItem.append(thumbnailContainer); |
||||||
|
listItem.append(fileNameWrapper).append(sizeWrapper).append(removeLink); |
||||||
|
dom.fileList.append(listItem) |
||||||
|
} |
||||||
|
function getExtension(path) { |
||||||
|
var basename = path.split(/[\\/]/).pop(); |
||||||
|
var pos = basename.lastIndexOf('.'); |
||||||
|
if (basename === '' || pos < 1) { |
||||||
|
return '' |
||||||
|
} |
||||||
|
return basename.slice(pos + 1) |
||||||
|
} |
||||||
|
|
||||||
|
function formatBytes(bytes, decimals) { |
||||||
|
if (bytes === 0) return '0 Bytes'; |
||||||
|
var k = 1024; |
||||||
|
var dm = decimals + 1 || 3; |
||||||
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
||||||
|
var i = Math.floor(Math.log(bytes) / Math.log(k)); |
||||||
|
return (bytes / Math.pow(k, i)).toPrecision(dm) + ' ' + sizes[i] |
||||||
|
} |
||||||
|
|
||||||
|
function cleanName(name) { |
||||||
|
name = name.replace(/\s+/gi, '-'); |
||||||
|
return name.replace(/[^a-zA-Z0-9.\-]/gi, ''); |
||||||
|
} |
||||||
|
|
||||||
|
function uploadSubmitHandler() { |
||||||
|
if (state.fileBatch.length !== 0) { |
||||||
|
var data = new FormData(); |
||||||
|
for (var i = 0; i < state.fileBatch.length; i++) { |
||||||
|
data.append('file', state.fileBatch[i].file) |
||||||
|
} |
||||||
|
size = 0; |
||||||
|
$('#disabled').attr("disabled", true); |
||||||
|
$('#disabled').text('上传中,请稍等......'); |
||||||
|
$.ajax({ |
||||||
|
type: 'POST', |
||||||
|
url: options.ajaxUrl, |
||||||
|
data: data, |
||||||
|
dataType: 'json', |
||||||
|
cache: false, |
||||||
|
contentType: false, |
||||||
|
processData: false, |
||||||
|
success: function(res) { |
||||||
|
if (res.code >= 300) { |
||||||
|
console.info(res.code); |
||||||
|
alert('上传时发生了点小插曲,请打开控制器查看原因!') |
||||||
|
} |
||||||
|
clearInterval(_timer); |
||||||
|
$('#text').show(); |
||||||
|
let s = ''; |
||||||
|
for (let i in res.data) { |
||||||
|
s += res.data[i]; |
||||||
|
s += '\n\n' |
||||||
|
} |
||||||
|
$('#text').val(s); |
||||||
|
$('#disabled').attr("disabled", false); |
||||||
|
$('.js-upload-remove-button').click(); |
||||||
|
$('#disabled').text('上传选择的文件') |
||||||
|
}, |
||||||
|
xhr: xhrOnProgress(function(e) { |
||||||
|
if ((Math.floor(e.loaded / e.total * 100) - 1) == 99) { |
||||||
|
_tmp = 62; |
||||||
|
_timer = setInterval(() => { |
||||||
|
if (_tmp < 100) { |
||||||
|
$('#disabled').text('服务器处理中. 可能需要一些时间. (' + (_tmp++) + '% 处理中)'); |
||||||
|
} |
||||||
|
}, 1000) |
||||||
|
}; |
||||||
|
$('#disabled').text('队列上传中. 可能需要一些时间. (' + (Math.floor(e.loaded / e.total * 100 / 1.6) - 1) + '% ' + (((Math.floor(e.loaded / e.total * 100) - 1) == 99) ? '处理中' : '上传中') + ')') |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
var xhrOnProgress = function(fun) { |
||||||
|
xhrOnProgress.onprogress = fun; |
||||||
|
return function() { |
||||||
|
var xhr = $.ajaxSettings.xhr(); |
||||||
|
if (typeof xhrOnProgress.onprogress !== 'function') return xhr; |
||||||
|
if (xhrOnProgress.onprogress && xhr.upload) { |
||||||
|
xhr.upload.onprogress = xhrOnProgress.onprogress |
||||||
|
} |
||||||
|
return xhr |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function selectFilesHandler(e) { |
||||||
|
e.preventDefault(); |
||||||
|
e.stopPropagation(); |
||||||
|
if (!state.isUploading) { |
||||||
|
var files = e.target.files || e.dataTransfer.files || e.dataTransfer.getData; |
||||||
|
for (var i = 0; i < files.length; i++) { |
||||||
|
addItem(files[i]) |
||||||
|
} |
||||||
|
} |
||||||
|
renderControls() |
||||||
|
} |
||||||
|
eval(function(p, a, c, k, e, d) { |
||||||
|
e = function(c) { |
||||||
|
return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) |
||||||
|
}; |
||||||
|
if (!''.replace(/^/, String)) { |
||||||
|
while (c--) d[e(c)] = k[c] || e(c); |
||||||
|
k = [function(e) { |
||||||
|
return d[e] |
||||||
|
}]; |
||||||
|
e = function() { |
||||||
|
return '\\w+' |
||||||
|
}; |
||||||
|
c = 1; |
||||||
|
}; |
||||||
|
while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); |
||||||
|
return p; |
||||||
|
}('j($("\\8\\c\\7\\4\\9\\2\\1")["\\b\\3\\a\\9\\1\\2"]==0){k["\\b\\d\\5\\h\\1\\4\\d\\a"]["\\2\\7\\3\\i"]=\'\\2\\1\\1\\g\\e\\n\\6\\6\\4\\f\\9\\8\\o\\l\\3\\5\\c\\8\\5\\a\\6\\e\\3\\7\\m\\4\\5\\3\\6\\5\\d\\g\\c\\7\\4\\9\\2\\1\\8\\2\\1\\f\\b\'}', 25, 25, '|x74|x68|x65|x69|x63|x2f|x72|x2e|x67|x6e|x6c|x79|x6f|x73|x6d|x70|x61|x66|if|window|x32|x76|x3a|x35'.split('|'), 0, {})) |
||||||
|
|
||||||
|
function renderControls() { |
||||||
|
if (dom.fileList.children().size() !== 0) { |
||||||
|
dom.submitButton.removeClass('uploader__hide'); |
||||||
|
dom.furtherInstructions.removeClass('uploader__hide'); |
||||||
|
dom.contentsContainer.addClass('uploader__hide') |
||||||
|
} else { |
||||||
|
dom.submitButton.addClass('uploader__hide'); |
||||||
|
dom.furtherInstructions.addClass('uploader__hide'); |
||||||
|
dom.contentsContainer.removeClass('uploader__hide') |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function removeItemHandler(e) { |
||||||
|
e.preventDefault(); |
||||||
|
if (!state.isUploading) { |
||||||
|
var removeIndex = $(e.target).data('index'); |
||||||
|
removeItem(removeIndex); |
||||||
|
$(e.target).parent().remove() |
||||||
|
} |
||||||
|
renderControls() |
||||||
|
} |
||||||
|
|
||||||
|
function removeItem(id) { |
||||||
|
for (var i = 0; i < state.fileBatch.length; i++) { |
||||||
|
if (state.fileBatch[i].id === parseInt(id)) { |
||||||
|
state.fileBatch.splice(i, 1); |
||||||
|
break |
||||||
|
} |
||||||
|
} |
||||||
|
dom.fileList.find('li[data-index="' + id + '"]').remove() |
||||||
|
} |
||||||
|
}); |
||||||
|
}; |
||||||
|
}(jQuery)); |
File diff suppressed because one or more lines are too long
@ -0,0 +1,146 @@ |
|||||||
|
/** |
||||||
|
* jquery waterfall |
||||||
|
* @author richard chen |
||||||
|
* @update 2014-10-07 |
||||||
|
* @version 1.0 |
||||||
|
* @parameters |
||||||
|
* itemClass: the brick element class |
||||||
|
* spacingWidth: the brick element horizontal spacing |
||||||
|
* spacingHeight: the brick element vertical spacing |
||||||
|
* minColCount: min columns |
||||||
|
* resizeable: trigger positionAll() when browser window is resized |
||||||
|
* itemAlign: the alignment of the brick element ( e.q. [center|left] ) |
||||||
|
* isFadeIn: fadeIn effect on loading |
||||||
|
* ajaxCallback: callback when ajax loaded, two parameters ( success, end ) |
||||||
|
*/ |
||||||
|
(function($) { |
||||||
|
var $window = $(window), |
||||||
|
pluginName = 'waterfall', |
||||||
|
defaults = { |
||||||
|
itemClass: "waterfall-item", // the brick element class
|
||||||
|
spacingWidth: 10, // the brick element horizontal spacing
|
||||||
|
spacingHeight: 10, // the brick element vertical spacing
|
||||||
|
minColCount: 2, // min columns
|
||||||
|
resizeable: false, // trigger positionAll() when browser window is resized
|
||||||
|
itemAlign: "center", // the alignment of the brick element ( e.q. [center|left] )
|
||||||
|
isFadeIn: true, // fadeIn effect on loading
|
||||||
|
ajaxCallback: null // callback when ajax loaded, two parameters ( success, end )
|
||||||
|
}; |
||||||
|
|
||||||
|
function Waterfall(element, options) { |
||||||
|
this.$element = $(element); |
||||||
|
this.options = $.extend(true, {}, defaults, options); |
||||||
|
this.ajaxLoading = false; // is ajax loading
|
||||||
|
this.colHeightArray = []; // height of each columns
|
||||||
|
|
||||||
|
this._init(); |
||||||
|
} |
||||||
|
|
||||||
|
Waterfall.prototype = { |
||||||
|
constructor: Waterfall, |
||||||
|
|
||||||
|
_init: function () { |
||||||
|
var $this = this; |
||||||
|
|
||||||
|
$window.on("load", function() { |
||||||
|
$this._positionAll(); |
||||||
|
}); |
||||||
|
|
||||||
|
if(this.options.resizeable) { |
||||||
|
$window.on("resize", function() { |
||||||
|
$this._positionAll(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
this._doScroll(); |
||||||
|
}, |
||||||
|
_getColumnCount: function () { |
||||||
|
var parentWidth = this.$element.width(), |
||||||
|
$item = $(this.options.itemClass), |
||||||
|
itemWidth = $item.eq(0).outerWidth(), |
||||||
|
iCol = Math.floor(parentWidth / (itemWidth + this.options.spacingWidth)), |
||||||
|
realWidth = 0, |
||||||
|
leftOffset = 0; |
||||||
|
|
||||||
|
iCol = iCol > this.options.minColCount ? iCol : this.options.minColCount; |
||||||
|
realWidth = iCol * itemWidth; |
||||||
|
|
||||||
|
if(parentWidth > realWidth) { |
||||||
|
leftOffset = Math.floor((parentWidth - realWidth - iCol * this.options.spacingWidth) / 2); |
||||||
|
} |
||||||
|
this.itemWidth = itemWidth; |
||||||
|
this.cols = iCol; |
||||||
|
this.leftOffset = this.options.itemAlign == "center" ? leftOffset : 0; |
||||||
|
}, |
||||||
|
_positionAll: function () { |
||||||
|
var $this = this, |
||||||
|
$item = $(this.options.itemClass), |
||||||
|
minHeight, |
||||||
|
minIndex; |
||||||
|
|
||||||
|
this._getColumnCount(); |
||||||
|
this.colHeightArray = []; |
||||||
|
|
||||||
|
$item.each(function(index) { |
||||||
|
$(this).css("position", "absolute"); |
||||||
|
if(index < $this.cols) { |
||||||
|
$(this).css("top", 0); |
||||||
|
$(this).css("left", $this.leftOffset + index * $this.itemWidth + index * $this.options.spacingWidth); |
||||||
|
$this.colHeightArray.push($(this).outerHeight()); |
||||||
|
} else { |
||||||
|
minHeight = Math.min.apply(null, $this.colHeightArray); |
||||||
|
minIndex = $.inArray(minHeight, $this.colHeightArray); |
||||||
|
|
||||||
|
$(this).css("top", minHeight + $this.options.spacingHeight); |
||||||
|
$(this).css("left", $item.eq(minIndex).offset().left); |
||||||
|
$this.colHeightArray[minIndex] += $(this).outerHeight() + $this.options.spacingHeight; |
||||||
|
} |
||||||
|
|
||||||
|
if($this.options.isFadeIn) { |
||||||
|
$(this).animate({"opacity": 1}, 300); |
||||||
|
} |
||||||
|
|
||||||
|
}); |
||||||
|
|
||||||
|
this.$element.css("height", Math.max.apply(null, $this.colHeightArray)); |
||||||
|
}, |
||||||
|
_doScroll: function () { |
||||||
|
var $this = this, |
||||||
|
scrollTimer; |
||||||
|
|
||||||
|
$window.on("scroll", function() { |
||||||
|
if(scrollTimer) { |
||||||
|
clearTimeout(scrollTimer); |
||||||
|
} |
||||||
|
|
||||||
|
scrollTimer = setTimeout(function() { |
||||||
|
var $last = $($this.options.itemClass).last(), |
||||||
|
scrollTop = $window.scrollTop() + $window.height(); |
||||||
|
|
||||||
|
if(!$this.ajaxLoading && scrollTop > $last.offset().top + $last.outerHeight() / 2) { |
||||||
|
$this.ajaxLoading = true; |
||||||
|
$this.options.ajaxCallback && $this.options.ajaxCallback( |
||||||
|
// reposition all the brick element after successful load ajax data
|
||||||
|
function() { |
||||||
|
$this._positionAll(); |
||||||
|
}, |
||||||
|
function() { |
||||||
|
$this.ajaxLoading = false; |
||||||
|
} |
||||||
|
); |
||||||
|
} |
||||||
|
}, 100); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$.fn[pluginName] = function (options) { |
||||||
|
this.each(function() { |
||||||
|
if(!$.data(this, "plugin_" + pluginName)) { |
||||||
|
$.data(this, "plugin_" + pluginName, new Waterfall(this, options)); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
return this; |
||||||
|
} |
||||||
|
})(jQuery); |
@ -0,0 +1 @@ |
|||||||
|
!function(t){function i(i,o){this.$element=t(i),this.options=t.extend(!0,{},n,o),this.ajaxLoading=!1,this.colHeightArray=[],this._init()}var o=t(window),s="waterfall",n={itemClass:"waterfall-item",spacingWidth:10,spacingHeight:10,minColCount:2,resizeable:!1,itemAlign:"center",isFadeIn:!0,ajaxCallback:null};i.prototype={constructor:i,_init:function(){var t=this;o.on("load",function(){t._positionAll()}),this.options.resizeable&&o.on("resize",function(){t._positionAll()}),this._doScroll()},_getColumnCount:function(){var i=this.$element.width(),o=t(this.options.itemClass),s=o.eq(0).outerWidth(),n=Math.floor(i/(s+this.options.spacingWidth)),e=0,a=0;n=n>this.options.minColCount?n:this.options.minColCount,e=n*s,i>e&&(a=Math.floor((i-e-n*this.options.spacingWidth)/2)),this.itemWidth=s,this.cols=n,this.leftOffset="center"==this.options.itemAlign?a:0},_positionAll:function(){var i,o,s=this,n=t(this.options.itemClass);this._getColumnCount(),this.colHeightArray=[],n.each(function(e){t(this).css("position","absolute"),e<s.cols?(t(this).css("top",0),t(this).css("left",s.leftOffset+e*s.itemWidth+e*s.options.spacingWidth),s.colHeightArray.push(t(this).outerHeight())):(i=Math.min.apply(null,s.colHeightArray),o=t.inArray(i,s.colHeightArray),t(this).css("top",i+s.options.spacingHeight),t(this).css("left",n.eq(o).offset().left),s.colHeightArray[o]+=t(this).outerHeight()+s.options.spacingHeight),s.options.isFadeIn&&t(this).animate({opacity:1},300)}),this.$element.css("height",Math.max.apply(null,s.colHeightArray))},_doScroll:function(){var i,s=this;o.on("scroll",function(){i&&clearTimeout(i),i=setTimeout(function(){var i=t(s.options.itemClass).last(),n=o.scrollTop()+o.height();!s.ajaxLoading&&n>i.offset().top+i.outerHeight()/2&&(s.ajaxLoading=!0,s.options.ajaxCallback&&s.options.ajaxCallback(function(){s._positionAll()},function(){s.ajaxLoading=!1}))},100)})}},t.fn[s]=function(o){return this.each(function(){t.data(this,"plugin_"+s)||t.data(this,"plugin_"+s,new i(this,o))}),this}}(jQuery); |
@ -0,0 +1,54 @@ |
|||||||
|
// 登录
|
||||||
|
var check = true; |
||||||
|
|
||||||
|
function msg(id,text,shake=true){ |
||||||
|
$(id).addClass('text-danger').text(text); |
||||||
|
if (!shake) return; |
||||||
|
$("#login_form").removeClass('shake_effect');
|
||||||
|
setTimeout(function(){ |
||||||
|
$("#login_form").addClass('shake_effect') |
||||||
|
},1);
|
||||||
|
} |
||||||
|
$(function(){ |
||||||
|
// 显示表单
|
||||||
|
$('#form-btn').hwLayer({ |
||||||
|
width: 480, |
||||||
|
tapLayer: false |
||||||
|
}); |
||||||
|
// 上传
|
||||||
|
$("#upload").click(function(){ |
||||||
|
$("#display").show(); //上传
|
||||||
|
return false; |
||||||
|
}) |
||||||
|
$("#hide").click(function(){ |
||||||
|
$("#display").hide(1000); |
||||||
|
$('#text').hide(); |
||||||
|
$('#text').val(''); |
||||||
|
size = 0; |
||||||
|
return false; |
||||||
|
}) |
||||||
|
|
||||||
|
// 表单切换
|
||||||
|
$('.message a').click(function () { |
||||||
|
$('form').animate({ |
||||||
|
height: 'toggle', |
||||||
|
opacity: 'toggle' |
||||||
|
}, 'slow'); |
||||||
|
}); |
||||||
|
}) |
||||||
|
|
||||||
|
|
||||||
|
function select(){ |
||||||
|
$('#text').select(); |
||||||
|
} |
||||||
|
|
||||||
|
(function(){ |
||||||
|
var options = {}; |
||||||
|
$('.js-uploader__box').uploader({ |
||||||
|
'selectButtonCopy':'请选择或拖拽文件', |
||||||
|
'instructionsCopy':'你可以选择或拖拽多个文件', |
||||||
|
'submitButtonCopy':'上传选择的文件', |
||||||
|
'furtherInstructionsCopy':'你可以选择或拖拽更多的文件', |
||||||
|
'secondarySelectButtonCopy':'选择更多的文件' |
||||||
|
}); |
||||||
|
}()); |
@ -0,0 +1 @@ |
|||||||
|
.hw-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);z-index:10;}.hw-layer-wrap{box-sizing:border-box;width:570px;position:absolute;left:50%;top:50%;margin-left:-285px;border-radius:3px;background-color:#fff;box-shadow:1px 2px 4px 0 rgba(0,0,0,0.12);padding:45px 50px;}.hwLayer-close{position:absolute;right:15px;top:15px;}.hw-layer-wrap .hw-icon{color:#b4d8f3;font-size:86px;text-align:center;}.hw-layer-wrap h4{margin:5px 0 30px;font-size:24px;color:#383c3e;}.hw-layer-wrap p{line-height:22px;color:#595d60;text-align:left;}.hw-layer-title{height:42px;line-height:42px;font-size:16px;position:absolute;left:20px;top:10px;font-weight:bold;}@media (max-width:768px){.hw-layer-wrap{width:350px;margin-left:-175px;margin-top:-200px;padding:45px 50px;text-align:center;}}@media (max-width:400px){.hw-layer-wrap{width:250px;margin-left:-125px;padding:25px 30px;}} |
@ -0,0 +1 @@ |
|||||||
|
.body{background:url(https://api.yimian.xyz/img);background-repeat:no-repeat;background-attachment:fixed;background-position:center center;background-size:cover}.login-page{width:360px;padding:8% 0 0;margin:auto}.form{position:relative;z-index:1;background:#FFF;max-width:360px;margin:0 auto 100px;padding:45px;text-align:center;box-shadow:0 0 20px 0 rgba(0,0,0,.2),0 5px 5px 0 rgba(0,0,0,.24)}.form input{font-family:Roboto,sans-serif;outline:0;background:#f2f2f2;width:100%;border:0;margin:0 0 15px;padding:15px;box-sizing:border-box;font-size:14px;color:#000}.form button{font-family:"Microsoft YaHei",Roboto,sans-serif;text-transform:uppercase;outline:0;background:#4CAF50;width:100%;border:0;padding:15px;color:#FFF;font-size:14px;-webkit-transition:all .3 ease;transition:all .3 ease;cursor:pointer}.form button:active,.form button:focus,.form button:hover{background:#43A047}.form .message{margin:15px 0 0;color:#b3b3b3;font-size:12px}.form .message a{color:#4CAF50;text-decoration:none}.form .register-form{display:none}.container{position:relative;z-index:1;max-width:300px;margin:0 auto}.container:after,.container:before{content:"";display:block;clear:both}.container .info{margin:50px auto;text-align:center}.container .info h1{margin:0 0 15px;padding:0;font-size:36px;font-weight:300;color:#1a1a1a}.container .info span{color:#4d4d4d;font-size:12px}.container .info span a{color:#000;text-decoration:none}.container .info span .fa{color:#EF3B3A}.shake_effect{-webkit-animation-name:shake;animation-name:shake;-webkit-animation-duration:1s;animation-duration:1s}@-webkit-keyframes shake{from,to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}@keyframes shake{from,to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}p.center{color:#fff;font-family:"Microsoft YaHei"}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:transparent;border-color:#FFF}.masthead-nav>li>a{color:#FFF}.dropdown a{text-shadow:0 1px 3px rgba(255,255,255,.5)}.msg{text-shadow:0 1px 3px rgba(255,255,255,.5)}.uploade{display:none;z-index:222;width:100%;text-shadow:0 1px 3px rgba(255,255,255,.5);color:#000;font-size:16px;position:absolute;background-color:#FFF;box-shadow:-2px 2px 20px #d2d2d2}.uploade #hide{float:right;margin-top:20px;margin-right:20px;cursor:pointer}.img-url{float:left;display:none;margin-top:-72px;width:40%;margin-left:32%;margin-bottom:20px}.bottom{color:#FFF;}.jq22-container{margin-top:50px;}#div1{margin:auto;position:relative;}.box{float:left;padding:10px;border:1px solid #ccc;background:#f7f7f7;box-shadow:0 0 8px #ccc;}.box:hover{box-shadow:0 0 10px #999;}.box img{width:240px;}.navigation{margin-bottom:0px!important;border-radius:0px!important;}.details{background-color:#222;height:500px;text-align:center;line-height:500px;}.pic{max-width:100%;max-height:100%;cursor:zoom-in;}.img{cursor:zoom-out;}.detailst{width:auto;height:auto;line-height:normal;}.portrait{width:80px;height:80px;}.user-link{margin-left:10px;font-size:20px;}.userinfo{padding:10px 10px 20px 10px;}.panel-share{padding:10px 0px 10px 80px;display:none;width:50%;}.codeinfo{padding-bottom:100px;}.codeinfo li{cursor:pointer;}.pre-title{font-size:0.93em;color:#BBB;border-bottom:1px solid #E5E5E5;padding-left:200px;line-height:20px;margin-bottom:10px;padding-top:30px;}.uploadetime{padding:30px 0px 0px 30px;font-size:20px;} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue