From: <de...@de...> - 2014-05-30 23:23:02
|
Author: PeterThoeny Date: 2014-05-30 18:22:14 -0500 (Fri, 30 May 2014) New Revision: 27581 Trac url: http://develop.twiki.org/trac/changeset/27581 Modified: twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/ChangeProfilePicture.txt twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/UserProfileHeader.txt Log: Item7502: Follow-up fix on drag & drop, now delaying upload until [Upload] pressed Modified: twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/ChangeProfilePicture.txt =================================================================== --- twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/ChangeProfilePicture.txt 2014-05-30 23:21:32 UTC (rev 27580) +++ twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/ChangeProfilePicture.txt 2014-05-30 23:22:14 UTC (rev 27581) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1401342951" format="1.1" version="$Rev$"}% +%META:TOPICINFO{author="TWikiContributor" date="1401491605" format="1.1" version="$Rev$"}% ---+ %MAKETEXT{"Change Profile Picture of [_1]" args="%URLPARAM{ "wikiname" default=" " }%" }% <!--<pre>--> @@ -59,18 +59,30 @@ function(){ if ( Dropzone.isBrowserSupported() ) { $('#fileUpload').replaceWith('<div id="dropzonePreviews" class="dropzone-previews"><div id="dropzoneMessage" class="dz-message" style="">Drop file %BR% or click</div></div>'); + $('#submitFile').replaceWith('<button type="button" class="twikiSubmit" onClick="myDropzone.processQueue();" %IF{ "defined 'wikiname'" else="disabled=\"disabled\"" }%>%MAKETEXT{"Upload"}%</button>'); myDropzone = new Dropzone("form.dropzone", { maxFiles: 1, maxFilesize: %IF{"$'ATTACHFILESIZELIMIT' = '' or $'ATTACHFILESIZELIMIT' = '0'" then="1024 * 1024" else="%ATTACHFILESIZELIMIT% / 1024"}%, withCredentials: true, paramName: 'filepath', addRemoveLinks: true, + autoProcessQueue: false, acceptedFiles: 'image/*', previewsContainer: "div#dropzonePreviews", uploadMultiple: false, parallelUploads: 1, params: {noredirect: '1'}, clickable: "div#dropzonePreviews", + success: function(file, responseText, e) { + var xhr = file.xhr; + if ( xhr && xhr.getResponseHeader("Content-type").indexOf("text/html" ) != -1) { + document.open(); + document.write(responseText); + document.close(); + } else { + window.location.href = '%SCRIPTURL{view}%/%WEB%/%URLPARAM{wikiname}%'; + } + }, }); } } Modified: twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/UserProfileHeader.txt =================================================================== --- twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/UserProfileHeader.txt 2014-05-30 23:21:32 UTC (rev 27580) +++ twiki/branches/TWikiRelease06x00/TWikiUserMappingContrib/data/Main/UserProfileHeader.txt 2014-05-30 23:22:14 UTC (rev 27581) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1365211898" format="1.1" version="$Rev$"}% +%META:TOPICINFO{author="TWikiContributor" date="1401489806" format="1.1" version="$Rev$"}% ---+ Header of User Profile Pages __Note:__ This is a maintenance topic, used by the TWiki Administrator. @@ -53,7 +53,7 @@ <div id="viewRecord" style="display: block; padding: 10px 0 0 0"> <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" class="profileBox" style="width: 200px;" rowspan="2"> <div style="position: absolute; width: 200px; margin-top: -1px; text-align:right;"> -<a href="%SCRIPTURL{view}%/%WEB%/ChangeProfilePicture?wikiname=%INCLUDINGTOPIC%" title="%MAKETEXT{"Change profile picture"}%" class="changePicture" rel="nofollow"> <img src='%ICONURLPATH{uweb-bo12}%' width='12' height='12' alt='' border='0' style='vertical-align: middle' /> %MAKETEXT{"Change"}% </a> +<a href="%SCRIPTURL{viewauth}%/%WEB%/ChangeProfilePicture?wikiname=%INCLUDINGTOPIC%" title="%MAKETEXT{"Change profile picture"}%" class="changePicture" rel="nofollow"> <img src='%ICONURLPATH{uweb-bo12}%' width='12' height='12' alt='' border='0' style='vertical-align: middle' /> %MAKETEXT{"Change"}% </a> </div> <div id="profilePicture"> %CALCULATE{$SET(image, %FORMFIELD{ "Image" topic="%INCLUDINGTOPIC%" }%)}%<nop> |