Showing
25 changed files
with
625 additions
and
23 deletions
| ... | @@ -27,6 +27,7 @@ | ... | @@ -27,6 +27,7 @@ |
| 27 | <div id="preview" style="padding:1em"> | 27 | <div id="preview" style="padding:1em"> |
| 28 | 28 | ||
| 29 | </div> | 29 | </div> |
| 30 | + <script src="lib/lrz/lrz.bundle.js"></script> | ||
| 30 | <script> | 31 | <script> |
| 31 | $(document).ready(function() { | 32 | $(document).ready(function() { |
| 32 | function Publisher(options) { | 33 | function Publisher(options) { |
| ... | @@ -34,7 +35,7 @@ | ... | @@ -34,7 +35,7 @@ |
| 34 | return new Publisher(); | 35 | return new Publisher(); |
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | - var $editor | 38 | + var $editor; |
| 38 | function init(editor) { | 39 | function init(editor) { |
| 39 | $editor = $(editor); | 40 | $editor = $(editor); |
| 40 | var ImageGallery = function (context) { | 41 | var ImageGallery = function (context) { |
| ... | @@ -102,29 +103,33 @@ | ... | @@ -102,29 +103,33 @@ |
| 102 | if (image.size <= 102400) { | 103 | if (image.size <= 102400) { |
| 103 | $editor.summernote('insertImages', [image]); | 104 | $editor.summernote('insertImages', [image]); |
| 104 | } else { | 105 | } else { |
| 105 | - data = new FormData(); | 106 | + lrz(image, { |
| 106 | - data.append("file", image); | 107 | + width: 1024 |
| 107 | - | 108 | + }) |
| 108 | - $.ajax({ | 109 | + .then(function (rst) { |
| 109 | - data: data, | 110 | + rst.formData.append('fileLen', rst.fileLen); |
| 110 | - type: "POST", | 111 | + rst.formData.append('xxx', '我是其他参数'); |
| 111 | - url: "/upload", | 112 | + $.ajax({ |
| 112 | - cache: false, | 113 | + data: rst.formData, |
| 113 | - contentType: false, | 114 | + type: "POST", |
| 114 | - processData: false, | 115 | + url: "/upload", |
| 115 | - success: function(result) { | 116 | + cache: false, |
| 116 | - var file = result.content.files[0]||{}; | 117 | + contentType: false, |
| 117 | - console.log(file); | 118 | + processData: false, |
| 118 | - if (file.size) { | 119 | + success: function(result) { |
| 119 | - setTimeout(function () { | 120 | + var file = result.content.files[0]||{}; |
| 120 | - $editor.summernote('insertImage', file.url, function ($image) { | 121 | + console.log(file); |
| 121 | - $image.css('width', $image.width() / 3); | 122 | + if (file.size) { |
| 122 | - $image.attr('data-filename', file.name); | 123 | + setTimeout(function () { |
| 123 | - }); | 124 | + $editor.summernote('insertImage', file.url, function ($image) { |
| 124 | - }, 1000); //等待上传处理图片 | 125 | + $image.css('width', $image.width() / 3); |
| 126 | + $image.attr('data-filename', file.name); | ||
| 127 | + }); | ||
| 128 | + }, 1000); //等待上传处理图片 | ||
| 129 | + } | ||
| 125 | } | 130 | } |
| 126 | - } | 131 | + }); |
| 127 | - }); | 132 | + }); |
| 128 | } | 133 | } |
| 129 | } | 134 | } |
| 130 | }, | 135 | }, | ... | ... |
lib/lrz/1.chunk.js
0 → 100644
| 1 | +webpackJsonp([1],{6:function(t,e,a){var r,n;!function(){function a(t){var e=t.naturalWidth,a=t.naturalHeight;if(e*a>1048576){var r=document.createElement("canvas");r.width=r.height=1;var n=r.getContext("2d");return n.drawImage(t,-e+1,0),0===n.getImageData(0,0,1,1).data[3]}return!1}function i(t,e,a){var r=document.createElement("canvas");r.width=1,r.height=a;var n=r.getContext("2d");n.drawImage(t,0,0);for(var i=n.getImageData(0,0,1,a).data,o=0,c=a,s=a;s>o;){var h=i[4*(s-1)+3];0===h?c=s:o=s,s=c+o>>1}var d=s/a;return 0===d?1:d}function o(t,e,a){var r=document.createElement("canvas");return c(t,r,e,a),r.toDataURL("image/jpeg",e.quality||.8)}function c(t,e,r,n){var o=t.naturalWidth,c=t.naturalHeight,h=r.width,d=r.height,g=e.getContext("2d");g.save(),s(e,g,h,d,r.orientation);var l=a(t);l&&(o/=2,c/=2);var u=1024,w=document.createElement("canvas");w.width=w.height=u;for(var f=w.getContext("2d"),v=n?i(t,o,c):1,m=Math.ceil(u*h/o),b=Math.ceil(u*d/c/v),L=0,I=0;c>L;){for(var p=0,R=0;o>p;)f.clearRect(0,0,u,u),f.drawImage(t,-p,-L),g.drawImage(w,0,0,u,u,R,I,m,b),p+=u,R+=m;L+=u,I+=b}g.restore(),w=f=null}function s(t,e,a,r,n){switch(n){case 5:case 6:case 7:case 8:t.width=r,t.height=a;break;default:t.width=a,t.height=r}switch(n){case 2:e.translate(a,0),e.scale(-1,1);break;case 3:e.translate(a,r),e.rotate(Math.PI);break;case 4:e.translate(0,r),e.scale(1,-1);break;case 5:e.rotate(.5*Math.PI),e.scale(1,-1);break;case 6:e.rotate(.5*Math.PI),e.translate(0,-r);break;case 7:e.rotate(.5*Math.PI),e.translate(a,-r),e.scale(-1,1);break;case 8:e.rotate(-.5*Math.PI),e.translate(-a,0)}}function h(t){if(window.Blob&&t instanceof Blob){var e=new Image,a=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!a)throw Error("No createObjectURL function found to create blob url");e.src=a.createObjectURL(t),this.blob=t,t=e}if(!t.naturalWidth&&!t.naturalHeight){var r=this;t.onload=function(){var t=r.imageLoadListeners;if(t){r.imageLoadListeners=null;for(var e=0,a=t.length;a>e;e++)t[e]()}},this.imageLoadListeners=[]}this.srcImage=t}h.prototype.render=function(t,e,a){if(this.imageLoadListeners){var r=this;return void this.imageLoadListeners.push(function(){r.render(t,e,a)})}e=e||{};var n=this.srcImage,i=n.src,s=i.length,h=n.naturalWidth,d=n.naturalHeight,g=e.width,l=e.height,u=e.maxWidth,w=e.maxHeight,f=this.blob&&"image/jpeg"===this.blob.type||0===i.indexOf("data:image/jpeg")||i.indexOf(".jpg")===s-4||i.indexOf(".jpeg")===s-5;g&&!l?l=d*g/h<<0:l&&!g?g=h*l/d<<0:(g=h,l=d),u&&g>u&&(g=u,l=d*g/h<<0),w&&l>w&&(l=w,g=h*l/d<<0);var v={width:g,height:l};for(var m in e)v[m]=e[m];var b=t.tagName.toLowerCase();"img"===b?t.src=o(this.srcImage,v,f):"canvas"===b&&c(this.srcImage,t,v,f),"function"==typeof this.onrender&&this.onrender(t),a&&a()},r=[],n=function(){return h}.apply(e,r),!(void 0!==n&&(t.exports=n))}()}}); | ||
| 2 | +//# sourceMappingURL=1.chunk.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
lib/lrz/1.chunk.js.map
0 → 100644
This diff is collapsed. Click to expand it.
lib/lrz/2.chunk.js
0 → 100644
| 1 | +webpackJsonp([2],{7:function(r,a){function n(r){function a(r){for(var a=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;64>n;n++){var o=b((a[n]*r+50)/100);1>o?o=1:o>255&&(o=255),C[I[n]]=o}for(var f=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],e=0;64>e;e++){var t=b((f[e]*r+50)/100);1>t?t=1:t>255&&(t=255),j[I[e]]=t}for(var v=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],i=0,u=0;8>u;u++)for(var c=0;8>c;c++)_[i]=1/(C[I[i]]*v[u]*v[c]*8),k[i]=1/(j[I[i]]*v[u]*v[c]*8),i++}function n(r,a){for(var n=0,o=0,f=new Array,e=1;16>=e;e++){for(var t=1;t<=r[e];t++)f[a[o]]=[],f[a[o]][0]=n,f[a[o]][1]=e,o++,n++;n*=2}return f}function o(){p=n(K,L),l=n(Q,R),D=n(O,P),T=n(V,W)}function f(){for(var r=1,a=2,n=1;15>=n;n++){for(var o=r;a>o;o++)J[32767+o]=n,x[32767+o]=[],x[32767+o][1]=n,x[32767+o][0]=o;for(var f=-(a-1);-r>=f;f++)J[32767+f]=n,x[32767+f]=[],x[32767+f][1]=n,x[32767+f][0]=a-1+f;r<<=1,a<<=1}}function e(){for(var r=0;256>r;r++)H[r]=19595*r,H[r+256>>0]=38470*r,H[r+512>>0]=7471*r+32768,H[r+768>>0]=-11059*r,H[r+1024>>0]=-21709*r,H[r+1280>>0]=32768*r+8421375,H[r+1536>>0]=-27439*r,H[r+1792>>0]=-5329*r}function t(r){for(var a=r[0],n=r[1]-1;n>=0;)a&1<<n&&(q|=1<<z),n--,z--,0>z&&(255==q?(v(255),v(0)):v(q),z=7,q=0)}function v(r){U.push(G[r])}function i(r){v(r>>8&255),v(255&r)}function u(r,a){var n,o,f,e,t,v,i,u,c,w=0;const y=8,A=64;for(c=0;y>c;++c){n=r[w],o=r[w+1],f=r[w+2],e=r[w+3],t=r[w+4],v=r[w+5],i=r[w+6],u=r[w+7];var h=n+u,d=n-u,g=o+i,s=o-i,m=f+v,p=f-v,l=e+t,D=e-t,T=h+l,M=h-l,b=g+m,C=g-m;r[w]=T+b,r[w+4]=T-b;var j=.707106781*(C+M);r[w+2]=M+j,r[w+6]=M-j,T=D+p,b=p+s,C=s+d;var _=.382683433*(T-C),k=.5411961*T+_,x=1.306562965*C+_,J=.707106781*b,S=d+J,U=d-J;r[w+5]=U+k,r[w+3]=U-k,r[w+1]=S+x,r[w+7]=S-x,w+=8}for(w=0,c=0;y>c;++c){n=r[w],o=r[w+8],f=r[w+16],e=r[w+24],t=r[w+32],v=r[w+40],i=r[w+48],u=r[w+56];var q=n+u,z=n-u,B=o+i,E=o-i,F=f+v,G=f-v,H=e+t,I=e-t,K=q+H,L=q-H,O=B+F,P=B-F;r[w]=K+O,r[w+32]=K-O;var Q=.707106781*(P+L);r[w+16]=L+Q,r[w+48]=L-Q,K=I+G,O=G+E,P=E+z;var R=.382683433*(K-P),V=.5411961*K+R,W=1.306562965*P+R,X=.707106781*O,Y=z+X,Z=z-X;r[w+40]=Z+V,r[w+24]=Z-V,r[w+8]=Y+W,r[w+56]=Y-W,w++}var $;for(c=0;A>c;++c)$=r[c]*a[c],N[c]=$>0?$+.5|0:$-.5|0;return N}function c(){i(65504),i(16),v(74),v(70),v(73),v(70),v(0),v(1),v(1),v(0),i(1),i(1),v(0),v(0)}function w(r,a){i(65472),i(17),v(8),i(a),i(r),v(3),v(1),v(17),v(0),v(2),v(17),v(1),v(3),v(17),v(1)}function y(){i(65499),i(132),v(0);for(var r=0;64>r;r++)v(C[r]);v(1);for(var a=0;64>a;a++)v(j[a])}function A(){i(65476),i(418),v(0);for(var r=0;16>r;r++)v(K[r+1]);for(var a=0;11>=a;a++)v(L[a]);v(16);for(var n=0;16>n;n++)v(O[n+1]);for(var o=0;161>=o;o++)v(P[o]);v(1);for(var f=0;16>f;f++)v(Q[f+1]);for(var e=0;11>=e;e++)v(R[e]);v(17);for(var t=0;16>t;t++)v(V[t+1]);for(var u=0;161>=u;u++)v(W[u])}function h(){i(65498),i(12),v(3),v(1),v(0),v(2),v(17),v(3),v(17),v(0),v(63),v(0)}function d(r,a,n,o,f){var e,v=f[0],i=f[240];const c=16,w=63,y=64;for(var A=u(r,a),h=0;y>h;++h)S[I[h]]=A[h];var d=S[0]-n;n=S[0],0==d?t(o[0]):(e=32767+d,t(o[J[e]]),t(x[e]));for(var g=63;g>0&&0==S[g];g--);if(0==g)return t(v),n;for(var s,m=1;g>=m;){for(var p=m;0==S[m]&&g>=m;++m);var l=m-p;if(l>=c){s=l>>4;for(var D=1;s>=D;++D)t(i);l=15&l}e=32767+S[m],t(f[(l<<4)+J[e]]),t(x[e]),m++}return g!=w&&t(v),n}function g(){for(var r=String.fromCharCode,a=0;256>a;a++)G[a]=r(a)}function s(r){if(0>=r&&(r=1),r>100&&(r=100),M!=r){var n=0;n=50>r?Math.floor(5e3/r):Math.floor(200-2*r),a(n),M=r}}function m(){var a=(new Date).getTime();r||(r=50),g(),o(),f(),e(),s(r);(new Date).getTime()-a}var p,l,D,T,M,b=(Math.round,Math.floor),C=new Array(64),j=new Array(64),_=new Array(64),k=new Array(64),x=new Array(65535),J=new Array(65535),N=new Array(64),S=new Array(64),U=[],q=0,z=7,B=new Array(64),E=new Array(64),F=new Array(64),G=new Array(256),H=new Array(2048),I=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],K=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],O=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],Q=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];this.encode=function(r,a,n){var o=(new Date).getTime();a&&s(a),U=new Array,q=0,z=7,i(65496),c(),y(),w(r.width,r.height),A(),h();var f=0,e=0,v=0;q=0,z=7,this.encode.displayName="_encode_";for(var u,g,m,M,b,C,j,x,J,N=r.data,S=r.width,G=r.height,I=4*S,K=0;G>K;){for(u=0;I>u;){for(b=I*K+u,C=b,j=-1,x=0,J=0;64>J;J++)x=J>>3,j=4*(7&J),C=b+x*I+j,K+x>=G&&(C-=I*(K+1+x-G)),u+j>=I&&(C-=u+j-I+4),g=N[C++],m=N[C++],M=N[C++],B[J]=(H[g]+H[m+256>>0]+H[M+512>>0]>>16)-128,E[J]=(H[g+768>>0]+H[m+1024>>0]+H[M+1280>>0]>>16)-128,F[J]=(H[g+1280>>0]+H[m+1536>>0]+H[M+1792>>0]>>16)-128;f=d(B,_,f,p,D),e=d(E,k,e,l,T),v=d(F,k,v,l,T),u+=32}K+=8}if(z>=0){var L=[];L[1]=z+1,L[0]=(1<<z+1)-1,t(L)}if(i(65497),n){for(var O=U.length,P=new Uint8Array(O),Q=0;O>Q;Q++)P[Q]=U[Q].charCodeAt();U=[];(new Date).getTime()-o;return P}var R="data:image/jpeg;base64,"+btoa(U.join(""));U=[];(new Date).getTime()-o;return R},m()}r.exports=n}}); | ||
| 2 | +//# sourceMappingURL=2.chunk.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
lib/lrz/2.chunk.js.map
0 → 100644
This diff is collapsed. Click to expand it.
lib/lrz/lrz.all.bundle.js
0 → 100644
This diff is collapsed. Click to expand it.
lib/lrz/lrz.all.bundle.js.map
0 → 100644
This diff could not be displayed because it is too large.
lib/lrz/lrz.bundle.js
0 → 100644
This diff is collapsed. Click to expand it.
lib/lrz/lrz.bundle.js.map
0 → 100644
This diff could not be displayed because it is too large.
lib/lrz/那么多文件,应该引用哪个?.txt
0 → 100644
| ... | @@ -22,6 +22,7 @@ | ... | @@ -22,6 +22,7 @@ |
| 22 | "gm": "^1.23.0", | 22 | "gm": "^1.23.0", |
| 23 | "lodash": "^4.16.5", | 23 | "lodash": "^4.16.5", |
| 24 | "log4js": "^0.6.38", | 24 | "log4js": "^0.6.38", |
| 25 | + "lrz": "^4.9.40", | ||
| 25 | "node-uuid": "^1.4.7", | 26 | "node-uuid": "^1.4.7", |
| 26 | "redis": "^2.6.3", | 27 | "redis": "^2.6.3", |
| 27 | "sequelize": "^3.24.6" | 28 | "sequelize": "^3.24.6" | ... | ... |
| ... | @@ -16,6 +16,7 @@ const loggers = require('./init/log4js-init'); | ... | @@ -16,6 +16,7 @@ const loggers = require('./init/log4js-init'); |
| 16 | 16 | ||
| 17 | var ROOT_PATH = process.cwd(); | 17 | var ROOT_PATH = process.cwd(); |
| 18 | app.use('/lib/', express.static(ROOT_PATH + '/lib')); | 18 | app.use('/lib/', express.static(ROOT_PATH + '/lib')); |
| 19 | +app.use('/test/', express.static(ROOT_PATH + '/test')); | ||
| 19 | 20 | ||
| 20 | app.get('/', function(req, res){ | 21 | app.get('/', function(req, res){ |
| 21 | res.sendFile(ROOT_PATH + '/index.html'); | 22 | res.sendFile(ROOT_PATH + '/index.html'); | ... | ... |
test/demo.gif
0 → 100755
478 KB
test/img/loading.gif
0 → 100755
14.2 KB
test/img/orientation_1.JPG
0 → 100755
48.9 KB
test/img/orientation_3.JPG
0 → 100755
48.7 KB
test/img/orientation_6.JPG
0 → 100755
45.6 KB
test/img/orientation_8.JPG
0 → 100755
46.4 KB
test/img/transparent_png.png
0 → 100755
8.42 KB
test/index.html
0 → 100755
| 1 | +<!doctype html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | +<meta name="viewport" content="width=device-width, user-scalable=no"> | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <title>lrz4 demo&test</title> | ||
| 7 | + | ||
| 8 | + <link rel="stylesheet" href="../lib/bootstrap/3.3.5/css/bootstrap.min.css"/> | ||
| 9 | + <style> | ||
| 10 | + img { | ||
| 11 | + width: 100%; | ||
| 12 | + max-width: 320px; | ||
| 13 | + padding: 10px 15px; | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + .tip { | ||
| 17 | + position: relative; | ||
| 18 | + top: 15px; | ||
| 19 | + right: 10px; | ||
| 20 | + } | ||
| 21 | + </style> | ||
| 22 | +</head> | ||
| 23 | +<body> | ||
| 24 | +<div class="navbar navbar-default"> | ||
| 25 | + <div class="pull-right tip text-muted">遇到问题时请截图到 <a | ||
| 26 | + href="https://github.com/think2011/localResizeIMG/issues">issues</a> | ||
| 27 | + </div> | ||
| 28 | + <div class="container"> | ||
| 29 | + <div class="navbar-header"> | ||
| 30 | + <a href="./" class="navbar-brand">Lrz4</a> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<div class="container"> | ||
| 36 | + | ||
| 37 | + <div class="row"> | ||
| 38 | + <div class="col-xs-12 text-center"> | ||
| 39 | + <h3 style="margin-top: 0;">上传图片测试</h3> | ||
| 40 | + <small><a href="server.html">切换至带服务端演示</a></small> | ||
| 41 | + <br> | ||
| 42 | + <small class="text-muted">配置:宽度不超过800,高度适应,70%压缩率</small> | ||
| 43 | + <br> | ||
| 44 | + <small class="text-muted UA">UA</small> | ||
| 45 | + <hr/> | ||
| 46 | + </div> | ||
| 47 | + | ||
| 48 | + <div id="upload-container" class="col-xs-12 text-center"> | ||
| 49 | + <input accept="image/*" type="file"/> | ||
| 50 | + </div> | ||
| 51 | + | ||
| 52 | + <div class="col-xs-12 text-center"> | ||
| 53 | + <hr/> | ||
| 54 | + <h3>旋转方向测试</h3> | ||
| 55 | + <small class="text-muted">看到的图像应该全是一个方向的,没见到图片是出问题了</small> | ||
| 56 | + <hr/> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + <div class="col-xs-6 text-center"> | ||
| 60 | + <img data-src="img/orientation_1.JPG?v=49ec2ec" | ||
| 61 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 62 | + | ||
| 63 | + <p>方向为【1】的图片</p> | ||
| 64 | + </div> | ||
| 65 | + <div class="col-xs-6 text-center"> | ||
| 66 | + <img data-src="img/orientation_3.JPG?v=c393d29" | ||
| 67 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 68 | + | ||
| 69 | + <p>方向为【3】的图片</p> | ||
| 70 | + </div> | ||
| 71 | + <div class="col-xs-6 text-center"> | ||
| 72 | + <img data-src="img/orientation_6.JPG?v=cd9d967" | ||
| 73 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 74 | + | ||
| 75 | + <p>方向为【6】的图片</p> | ||
| 76 | + </div> | ||
| 77 | + <div class="col-xs-6 text-center"> | ||
| 78 | + <img data-src="img/orientation_8.JPG?v=619646c" | ||
| 79 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 80 | + | ||
| 81 | + <p>方向为【8】的图片</p> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | +</div> | ||
| 85 | + | ||
| 86 | +<footer class="text-center"> | ||
| 87 | + <hr/> | ||
| 88 | + <p class="text-muted"><a href="https://github.com/think2011/localResizeIMG"> | ||
| 89 | + localResizeIMG(<span id="version"></span>版) by think2011</a> | ||
| 90 | + </p> | ||
| 91 | +</footer> | ||
| 92 | + | ||
| 93 | + | ||
| 94 | +<script src="../lib/lrz/lrz.bundle.js"></script> | ||
| 95 | +<script src="./index.js?v=27ce5f7"></script> | ||
| 96 | +</body> | ||
| 97 | +</html> |
test/index.js
0 → 100755
| 1 | +window.onerror = function (errMsg, scriptURI, lineNumber, columnNumber, errorObj) { | ||
| 2 | + setTimeout(function () { | ||
| 3 | + var rst = { | ||
| 4 | + "错误信息:": errMsg, | ||
| 5 | + "出错文件:": scriptURI, | ||
| 6 | + "出错行号:": lineNumber, | ||
| 7 | + "出错列号:": columnNumber, | ||
| 8 | + "错误详情:": errorObj | ||
| 9 | + }; | ||
| 10 | + | ||
| 11 | + console.log('出错了,下一步将显示错误信息'); | ||
| 12 | + console.log(JSON.stringify(rst, null, 10)); | ||
| 13 | + }); | ||
| 14 | +}; | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +[].forEach.call(document.querySelectorAll('[data-src]'), function (el) { | ||
| 18 | + (function (el) { | ||
| 19 | + el.addEventListener('click', function () { | ||
| 20 | + el.src = 'img/loading.gif'; | ||
| 21 | + | ||
| 22 | + lrz(el.dataset.src) | ||
| 23 | + .then(function (rst) { | ||
| 24 | + el.src = rst.base64; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + return rst; | ||
| 28 | + }); | ||
| 29 | + }); | ||
| 30 | + | ||
| 31 | + fireEvent(el, 'click'); | ||
| 32 | + })(el); | ||
| 33 | +}); | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +document.querySelector('input').addEventListener('change', function () { | ||
| 37 | + var that = this; | ||
| 38 | + | ||
| 39 | + lrz(that.files[0], { | ||
| 40 | + width: 800 | ||
| 41 | + }) | ||
| 42 | + .then(function (rst) { | ||
| 43 | + var img = new Image(), | ||
| 44 | + div = document.createElement('div'), | ||
| 45 | + p = document.createElement('p'), | ||
| 46 | + sourceSize = toFixed2(that.files[0].size / 1024), | ||
| 47 | + resultSize = toFixed2(rst.fileLen / 1024), | ||
| 48 | + scale = parseInt(100 - (resultSize / sourceSize * 100)); | ||
| 49 | + | ||
| 50 | + p.style.fontSize = 13 + 'px'; | ||
| 51 | + p.innerHTML = '源文件:<span class="text-danger">' + | ||
| 52 | + sourceSize + 'KB' + | ||
| 53 | + '</span> <br />' + | ||
| 54 | + '压缩后传输大小:<span class="text-success">' + | ||
| 55 | + resultSize + 'KB (省' + scale + '%)' + | ||
| 56 | + '</span> '; | ||
| 57 | + | ||
| 58 | + div.className = 'col-sm-6'; | ||
| 59 | + div.appendChild(img); | ||
| 60 | + div.appendChild(p); | ||
| 61 | + | ||
| 62 | + img.onload = function () { | ||
| 63 | + document.querySelector('#upload-container').appendChild(div); | ||
| 64 | + }; | ||
| 65 | + | ||
| 66 | + img.src = rst.base64; | ||
| 67 | + | ||
| 68 | + /* /!* ==================================================== *!/ | ||
| 69 | + // 原生ajax上传代码,所以看起来特别多 ╮(╯_╰)╭,但绝对能用 | ||
| 70 | + // 其他框架,例如ajax处理formData略有不同,请自行google,baidu。 | ||
| 71 | + var xhr = new XMLHttpRequest(); | ||
| 72 | + xhr.open('POST', '/upload'); | ||
| 73 | + | ||
| 74 | + xhr.onload = function () { | ||
| 75 | + if (xhr.status === 200) { | ||
| 76 | + // 上传成功 | ||
| 77 | + } else { | ||
| 78 | + // 处理其他情况 | ||
| 79 | + } | ||
| 80 | + }; | ||
| 81 | + | ||
| 82 | + xhr.onerror = function () { | ||
| 83 | + // 处理错误 | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + // issues #45 提到似乎有兼容性问题,关于progress | ||
| 87 | + xhr.upload.onprogress = function (e) { | ||
| 88 | + // 上传进度 | ||
| 89 | + var percentComplete = ((e.loaded / e.total) || 0) * 100; | ||
| 90 | + }; | ||
| 91 | + | ||
| 92 | + // 添加参数和触发上传 | ||
| 93 | + rst.formData.append('a', '我是参数'); | ||
| 94 | + xhr.send(rst.formData); | ||
| 95 | + /!* ==================================================== *!/*/ | ||
| 96 | + | ||
| 97 | + return rst; | ||
| 98 | + }); | ||
| 99 | +}); | ||
| 100 | + | ||
| 101 | +document.querySelector('#version').innerHTML = lrz.version; | ||
| 102 | +document.querySelector('.UA').innerHTML = 'UA: ' + navigator.userAgent; | ||
| 103 | + | ||
| 104 | +function toFixed2 (num) { | ||
| 105 | + return parseFloat(+num.toFixed(2)); | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +/** | ||
| 109 | + * 替换字符串 !{} | ||
| 110 | + * @param obj | ||
| 111 | + * @returns {String} | ||
| 112 | + * @example | ||
| 113 | + * '我是!{str}'.render({str: '测试'}); | ||
| 114 | + */ | ||
| 115 | +String.prototype.render = function (obj) { | ||
| 116 | + var str = this, reg; | ||
| 117 | + | ||
| 118 | + Object.keys(obj).forEach(function (v) { | ||
| 119 | + reg = new RegExp('\\!\\{' + v + '\\}', 'g'); | ||
| 120 | + str = str.replace(reg, obj[v]); | ||
| 121 | + }); | ||
| 122 | + | ||
| 123 | + return str; | ||
| 124 | +}; | ||
| 125 | + | ||
| 126 | +/** | ||
| 127 | + * 触发事件 - 只是为了兼容演示demo而已 | ||
| 128 | + * @param element | ||
| 129 | + * @param event | ||
| 130 | + * @returns {boolean} | ||
| 131 | + */ | ||
| 132 | +function fireEvent (element, event) { | ||
| 133 | + var evt; | ||
| 134 | + | ||
| 135 | + if (document.createEventObject) { | ||
| 136 | + // IE浏览器支持fireEvent方法 | ||
| 137 | + evt = document.createEventObject(); | ||
| 138 | + return element.fireEvent('on' + event, evt) | ||
| 139 | + } | ||
| 140 | + else { | ||
| 141 | + // 其他标准浏览器使用dispatchEvent方法 | ||
| 142 | + evt = document.createEvent('HTMLEvents'); | ||
| 143 | + // initEvent接受3个参数: | ||
| 144 | + // 事件类型,是否冒泡,是否阻止浏览器的默认行为 | ||
| 145 | + evt.initEvent(event, true, true); | ||
| 146 | + return !element.dispatchEvent(evt); | ||
| 147 | + } | ||
| 148 | +} | ||
| 149 | + | ||
| 150 | +/** | ||
| 151 | + * | ||
| 152 | + * ┏┓ ┏┓ | ||
| 153 | + * ┏┛┻━━━┛┻┓ | ||
| 154 | + * ┃ ┃ | ||
| 155 | + * ┃ ━ ┃ | ||
| 156 | + * ┃ ┳┛ ┗┳ ┃ | ||
| 157 | + * ┃ ┃ | ||
| 158 | + * ┃ ┻ ┃ | ||
| 159 | + * ┃ ┃ | ||
| 160 | + * ┗━┓ ┏━┛Code is far away from bug with the animal protecting | ||
| 161 | + * ┃ ┃ 神兽保佑,代码无bug | ||
| 162 | + * ┃ ┃ | ||
| 163 | + * ┃ ┗━━━┓ | ||
| 164 | + * ┃ ┣┓ | ||
| 165 | + * ┃ ┏┛ | ||
| 166 | + * ┗┓┓┏━┳┓┏┛ | ||
| 167 | + * ┃┫┫ ┃┫┫ | ||
| 168 | + * ┗┻┛ ┗┻┛ | ||
| 169 | + * | ||
| 170 | + */ |
test/lrz.spec.js
0 → 100755
This diff is collapsed. Click to expand it.
test/qrcode.png
0 → 100755
31.3 KB
test/server.html
0 → 100755
| 1 | +<!doctype html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | +<meta name="viewport" content="width=device-width, user-scalable=no"> | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <title>lrz4 demo&test</title> | ||
| 7 | + | ||
| 8 | + <link rel="stylesheet" href="../lib/bootstrap/3.3.5/css/bootstrap.min.css"/> | ||
| 9 | + <style> | ||
| 10 | + img { | ||
| 11 | + width: 100%; | ||
| 12 | + max-width: 320px; | ||
| 13 | + padding: 10px 15px; | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + .tip { | ||
| 17 | + position: relative; | ||
| 18 | + top: 15px; | ||
| 19 | + right: 10px; | ||
| 20 | + } | ||
| 21 | + </style> | ||
| 22 | +</head> | ||
| 23 | +<body> | ||
| 24 | +<div class="navbar navbar-default"> | ||
| 25 | + <div class="pull-right tip text-muted">遇到问题时请截图到 <a | ||
| 26 | + href="https://github.com/think2011/localResizeIMG/issues">issues</a> | ||
| 27 | + </div> | ||
| 28 | + <div class="container"> | ||
| 29 | + <div class="navbar-header"> | ||
| 30 | + <a href="./" class="navbar-brand">Lrz4 </a> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<div class="container"> | ||
| 36 | + <div class="row"> | ||
| 37 | + <div class="col-xs-12 text-center"> | ||
| 38 | + <h3 style="margin-top: 0;">上传图片测试</h3> | ||
| 39 | + <small><a href="index.html">切换至无服务端演示</a></small> | ||
| 40 | + <div> | ||
| 41 | + <progress value="0" max="100"></progress> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <small class="text-muted">配置:宽度不超过800,高度适应,70%压缩率</small> | ||
| 45 | + <br/> | ||
| 46 | + <small class="text-muted">演示服务端是跨域上传且免费的,所以较慢,请耐心等待..</small> | ||
| 47 | + <br/> | ||
| 48 | + <small class="text-muted UA">UA</small> | ||
| 49 | + <hr/> | ||
| 50 | + </div> | ||
| 51 | + | ||
| 52 | + <div id="upload-container" class="col-xs-12 text-center"> | ||
| 53 | + <input accept="image/*" type="file"/> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + <div class="col-xs-12 text-center"> | ||
| 57 | + <hr/> | ||
| 58 | + <h3>旋转方向测试</h3> | ||
| 59 | + <small class="text-muted">看到的图像应该全是一个方向的,没见到图片是出问题了</small> | ||
| 60 | + <hr/> | ||
| 61 | + </div> | ||
| 62 | + | ||
| 63 | + <div class="col-xs-6 text-center"> | ||
| 64 | + <img data-src="img/orientation_1.JPG?v=49ec2ec" | ||
| 65 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 66 | + | ||
| 67 | + <p>方向为【1】的图片</p> | ||
| 68 | + </div> | ||
| 69 | + <div class="col-xs-6 text-center"> | ||
| 70 | + <img data-src="img/orientation_3.JPG?v=c393d29" | ||
| 71 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 72 | + | ||
| 73 | + <p>方向为【3】的图片</p> | ||
| 74 | + </div> | ||
| 75 | + <div class="col-xs-6 text-center"> | ||
| 76 | + <img data-src="img/orientation_6.JPG?v=cd9d967" | ||
| 77 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 78 | + | ||
| 79 | + <p>方向为【6】的图片</p> | ||
| 80 | + </div> | ||
| 81 | + <div class="col-xs-6 text-center"> | ||
| 82 | + <img data-src="img/orientation_8.JPG?v=619646c" | ||
| 83 | + src="http://placehold.it/1x1" alt="点击载入"/> | ||
| 84 | + | ||
| 85 | + <p>方向为【8】的图片</p> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | +</div> | ||
| 89 | + | ||
| 90 | +<footer class="text-center"> | ||
| 91 | + <hr/> | ||
| 92 | + <p class="text-muted"><a href="https://github.com/think2011/localResizeIMG"> | ||
| 93 | + localResizeIMG(<span id="version"></span>版) by think2011</a> | ||
| 94 | + </p> | ||
| 95 | +</footer> | ||
| 96 | + | ||
| 97 | + | ||
| 98 | +<script src="../lib/lrz/lrz.bundle.js"></script> | ||
| 99 | +<script src="./server.js?v=c8aaa97"></script> | ||
| 100 | +</body> | ||
| 101 | +</html> |
test/server.js
0 → 100755
| 1 | +window.onerror = function (errMsg, scriptURI, lineNumber, columnNumber, errorObj) { | ||
| 2 | + setTimeout(function () { | ||
| 3 | + var rst = { | ||
| 4 | + "错误信息:": errMsg, | ||
| 5 | + "出错文件:": scriptURI, | ||
| 6 | + "出错行号:": lineNumber, | ||
| 7 | + "出错列号:": columnNumber, | ||
| 8 | + "错误详情:": errorObj | ||
| 9 | + }; | ||
| 10 | + | ||
| 11 | + console.log('出错了,下一步将显示错误信息'); | ||
| 12 | + console.log(JSON.stringify(rst, null, 10)); | ||
| 13 | + }); | ||
| 14 | +}; | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +[].forEach.call(document.querySelectorAll('[data-src]'), function (el) { | ||
| 18 | + (function (el) { | ||
| 19 | + el.addEventListener('click', function () { | ||
| 20 | + el.src = 'img/loading.gif'; | ||
| 21 | + | ||
| 22 | + lrz(el.dataset.src) | ||
| 23 | + .then(function (rst) { | ||
| 24 | + el.src = rst.base64; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + return rst; | ||
| 28 | + }); | ||
| 29 | + }); | ||
| 30 | + | ||
| 31 | + fireEvent(el, 'click'); | ||
| 32 | + })(el); | ||
| 33 | +}); | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +document.querySelector('input').addEventListener('change', function () { | ||
| 37 | + var that = this, | ||
| 38 | + progress = document.querySelector('progress'); | ||
| 39 | + | ||
| 40 | + lrz(that.files[0], { | ||
| 41 | + width: 1024 | ||
| 42 | + }) | ||
| 43 | + .then(function (rst) { | ||
| 44 | + var img = new Image(), | ||
| 45 | + div = document.createElement('div'), | ||
| 46 | + p = document.createElement('p'), | ||
| 47 | + sourceSize = toFixed2(that.files[0].size / 1024), | ||
| 48 | + resultSize = toFixed2(rst.fileLen / 1024), | ||
| 49 | + effect = parseInt(100 - (resultSize / sourceSize * 100)); | ||
| 50 | + | ||
| 51 | + p.style.fontSize = 13 + 'px'; | ||
| 52 | + p.innerHTML = '源文件:<span class="text-danger">!{sourceSize}KB</span> <br>压缩后传输大小:<span class="text-success">!{resultSize}KB (省!{effect}%)</span> '.render({ | ||
| 53 | + sourceSize: sourceSize, | ||
| 54 | + resultSize: resultSize, | ||
| 55 | + effect : effect | ||
| 56 | + }); | ||
| 57 | + | ||
| 58 | + div.className = 'col-sm-6'; | ||
| 59 | + div.appendChild(img); | ||
| 60 | + div.appendChild(p); | ||
| 61 | + | ||
| 62 | + img.onload = function () { | ||
| 63 | + document.querySelector('#upload-container').appendChild(div); | ||
| 64 | + }; | ||
| 65 | + | ||
| 66 | + progress.value = 0; | ||
| 67 | + | ||
| 68 | + /* ==================================================== */ | ||
| 69 | + // 原生ajax上传代码,所以看起来特别多 ╮(╯_╰)╭,但绝对能用 | ||
| 70 | + // 其他框架,例如ajax处理formData略有不同,请自行google,baidu。 | ||
| 71 | + var xhr = new XMLHttpRequest(); | ||
| 72 | + xhr.open('POST', '/upload'); | ||
| 73 | + | ||
| 74 | + xhr.onload = function () { | ||
| 75 | + var data = JSON.parse(xhr.response); | ||
| 76 | + | ||
| 77 | + if (xhr.status === 200) { | ||
| 78 | + // 上传成功 | ||
| 79 | + img.src = rst.base64; | ||
| 80 | + progress.value = 0; | ||
| 81 | + } else { | ||
| 82 | + // 处理错误 | ||
| 83 | + console.log(data.msg); | ||
| 84 | + | ||
| 85 | + div.remove(); | ||
| 86 | + that.value = null; | ||
| 87 | + } | ||
| 88 | + }; | ||
| 89 | + | ||
| 90 | + xhr.onerror = function (err) { | ||
| 91 | + console.log('未知错误:' + JSON.stringify(err, null, 2)); | ||
| 92 | + div.remove(); | ||
| 93 | + that.value = null; | ||
| 94 | + }; | ||
| 95 | + | ||
| 96 | + // issues #45 提到似乎有兼容性问题,关于progress | ||
| 97 | + if (xhr.upload) { | ||
| 98 | + try { | ||
| 99 | + xhr.upload.addEventListener('progress', function (e) { | ||
| 100 | + if (!e.lengthComputable) return false; | ||
| 101 | + | ||
| 102 | + // 上传进度 | ||
| 103 | + progress.value = ((e.loaded / e.total) || 0) * 100; | ||
| 104 | + }); | ||
| 105 | + } catch (err) { | ||
| 106 | + console.error('进度展示出错了,似乎不支持此特性?', err); | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + // 添加参数 | ||
| 111 | + rst.formData.append('fileLen', rst.fileLen); | ||
| 112 | + rst.formData.append('xxx', '我是其他参数'); | ||
| 113 | + | ||
| 114 | + // 触发上传 | ||
| 115 | + xhr.send(rst.formData); | ||
| 116 | + /* ==================================================== */ | ||
| 117 | + | ||
| 118 | + return rst; | ||
| 119 | + }); | ||
| 120 | +}); | ||
| 121 | + | ||
| 122 | +document.querySelector('#version').innerHTML = lrz.version; | ||
| 123 | +document.querySelector('.UA').innerHTML = 'UA: ' + navigator.userAgent; | ||
| 124 | + | ||
| 125 | +function toFixed2 (num) { | ||
| 126 | + return parseFloat(+num.toFixed(2)); | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +/** | ||
| 130 | + * 替换字符串 !{} | ||
| 131 | + * @param obj | ||
| 132 | + * @returns {String} | ||
| 133 | + * @example | ||
| 134 | + * '我是!{str}'.render({str: '测试'}); | ||
| 135 | + */ | ||
| 136 | +String.prototype.render = function (obj) { | ||
| 137 | + var str = this, reg; | ||
| 138 | + | ||
| 139 | + Object.keys(obj).forEach(function (v) { | ||
| 140 | + reg = new RegExp('\\!\\{' + v + '\\}', 'g'); | ||
| 141 | + str = str.replace(reg, obj[v]); | ||
| 142 | + }); | ||
| 143 | + | ||
| 144 | + return str; | ||
| 145 | +}; | ||
| 146 | + | ||
| 147 | +/** | ||
| 148 | + * 触发事件 - 只是为了兼容演示demo而已 | ||
| 149 | + * @param element | ||
| 150 | + * @param event | ||
| 151 | + * @returns {boolean} | ||
| 152 | + */ | ||
| 153 | +function fireEvent (element, event) { | ||
| 154 | + var evt; | ||
| 155 | + | ||
| 156 | + if (document.createEventObject) { | ||
| 157 | + // IE浏览器支持fireEvent方法 | ||
| 158 | + evt = document.createEventObject(); | ||
| 159 | + return element.fireEvent('on' + event, evt) | ||
| 160 | + } | ||
| 161 | + else { | ||
| 162 | + // 其他标准浏览器使用dispatchEvent方法 | ||
| 163 | + evt = document.createEvent('HTMLEvents'); | ||
| 164 | + // initEvent接受3个参数: | ||
| 165 | + // 事件类型,是否冒泡,是否阻止浏览器的默认行为 | ||
| 166 | + evt.initEvent(event, true, true); | ||
| 167 | + return !element.dispatchEvent(evt); | ||
| 168 | + } | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +/** | ||
| 172 | + * 替换字符串 !{} | ||
| 173 | + * @param obj | ||
| 174 | + * @returns {String} | ||
| 175 | + * @example | ||
| 176 | + * '我是!{str}'.render({str: '测试'}); | ||
| 177 | + */ | ||
| 178 | +String.prototype.render = function (obj) { | ||
| 179 | + var str = this, reg; | ||
| 180 | + | ||
| 181 | + Object.keys(obj).forEach(function (v) { | ||
| 182 | + reg = new RegExp('\\!\\{' + v + '\\}', 'g'); | ||
| 183 | + str = str.replace(reg, obj[v]); | ||
| 184 | + }); | ||
| 185 | + | ||
| 186 | + return str; | ||
| 187 | +}; | ||
| 188 | + | ||
| 189 | + | ||
| 190 | +if (!('remove' in Element.prototype)) { | ||
| 191 | + Element.prototype.remove = function () { | ||
| 192 | + this.parentNode.removeChild(this); | ||
| 193 | + }; | ||
| 194 | +} | ||
| 195 | + | ||
| 196 | +/** | ||
| 197 | + * | ||
| 198 | + * ┏┓ ┏┓ | ||
| 199 | + * ┏┛┻━━━┛┻┓ | ||
| 200 | + * ┃ ┃ | ||
| 201 | + * ┃ ━ ┃ | ||
| 202 | + * ┃ ┳┛ ┗┳ ┃ | ||
| 203 | + * ┃ ┃ | ||
| 204 | + * ┃ ┻ ┃ | ||
| 205 | + * ┃ ┃ | ||
| 206 | + * ┗━┓ ┏━┛Code is far away from bug with the animal protecting | ||
| 207 | + * ┃ ┃ 神兽保佑,代码无bug | ||
| 208 | + * ┃ ┃ | ||
| 209 | + * ┃ ┗━━━┓ | ||
| 210 | + * ┃ ┣┓ | ||
| 211 | + * ┃ ┏┛ | ||
| 212 | + * ┗┓┓┏━┳┓┏┛ | ||
| 213 | + * ┃┫┫ ┃┫┫ | ||
| 214 | + * ┗┻┛ ┗┻┛ | ||
| 215 | + * | ||
| 216 | + */ |
-
Please register or login to post a comment