fine uploader - Enabling the past function -
reading docs mentions "also containing file list" in paste options target element http://docs.fineuploader.com/integrating/options/fineuploaderbasic.html
what this? there example how implement this? have far. #pasteimage text box.
using chrome 10.6 need turn on somewhere in jquery.fineuploader-3.4.1.js
$(document).ready(function(){ var thumbnailuploader = new qq.fineuploader({ element: $('#thumbnail-fine-uploader')[0], request: { endpoint: '/admin/cfc/image-uploader.cfc?method=upload', params: { profileid: '<cfoutput>#profile.id#</cfoutput>', profiletype:'<cfoutput>#profile.profile_type#</cfoutput>', subdname:'<cfoutput>#decodeforhtml(profile.subdomain_name)#</cfoutput>' }, }, multiple: true, validation: { allowedextensions: ['jpeg', 'jpg', 'gif', 'png'], sizelimit: 102400, // 100 kb = 100 * 1024 bytes itemlimit: 1, stoponfirstinvalidfile: false }, text: { uploadbutton: "\+ click or drop" }, paste:{ targetelement:$('#pasteimage') }, callbacks: { oncomplete: function(id, filename, responsejson){ if (responsejson.success) { $('#thumbnail-fine-uploader').append('<img src="/<cfoutput>#profile.profile_type#</cfoutput>/<cfoutput>#profile.id#</cfoutput>/' + responsejson.filename + '" alt="' + filename + '" style="width:120px;height:120px;">'); $('#thumbnail-fine-uploader').append('<br/><b style="color:red;">' + responsejson.returnedprofileid + '<br/>'+ responsejson.returnedprofiletype+'<br/>'+responsejson.returnedsubdname+'</b>'); } } }, onupload: function(id, filename){ $('#file-' + id).addclass('alert-info').html('<img src="/images/loading.gif" alt="initializing. please hold."> ' + 'initializing ' + '“' + filename + '”'); }, onprogress: function(id, filename, loaded, total){ if (loaded < total) { progress = math.round(loaded / total * 100) + '% of ' + math.round(total / 1024) + ' kb'; $('#file-' + id).removeclass('alert-info').html('<img src="/images/loading.gif" alt="in progress. please hold."> ' + 'uploading ' + '“' + filename + '” ' + progress); } else { $('#file-' + id).addclass('alert-info').html('<img src="/images/loading.gif" alt="saving. please hold."> ' + 'saving ' + '“' + filename + '”'); } }, }) });
the paste target element can container receive pasted image(s). users paste image on clipboard. there isn't demonstrate. create element in dom, preferably 1 users can understand location images can pasted. then, set element value of paste
option's targetelement
property. can use document
target, if want.
Comments
Post a Comment