Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.44 KB | None | 0 0
  1.   <div id="profilePhotoDialog" style="margin: auto;" title="{!$Label.ProfilePhotoDialogTitle}">
  2.         <apex:form id="profilePhotoForm">
  3.             <div id="buttonsContainer" style=" margin-top: 10px; text-align: center;">
  4.                 <apex:commandButton value="{!$Label.AddButton}" id="addButton"
  5.                                    onClick="openCropperDialog();  return false;"
  6.                                    disabled="{!IF(ISNULL(profilePhotoId), false, true)}">
  7.                 </apex:commandButton>
  8.                 <apex:commandButton value="{!$Label.DeleteButton}"
  9.                                    onClick="deleteAttachments(); closeProfilePhotoDialog(); return false;"
  10.                                    disabled="{!IF(ISNULL(profilePhotoId), true, false)}"/>
  11.                 <apex:commandButton value="{!$Label.ChangeButton}"
  12.                                    onClick="openCropperDialog(); return false;"
  13.                                    disabled="{!IF(ISNULL(profilePhotoId), true, false)}">
  14.                 </apex:commandButton>
  15.             </div>
  16.             <apex:actionRegion>
  17.                 <apex:actionFunction name="deleteAttachmentsJS" action="{!deleteAllAttachments}"
  18.                                     reRender="profilePhoto, profilePhotoForm, cropperForm"/>
  19.                 <apex:actionFunction name="updateProfilePhotoJS" action="{!updateProfilePhoto}"
  20.                                     reRender="profilePhoto, profilePhotoForm, cropperForm">
  21.                     <apex:param name="imageName" value="" assignTo="{!myDoc.Name}"/>
  22.                     <apex:param name="imageBody" value="" assignTo="{!imageBody}"/>
  23.                 </apex:actionFunction>
  24.                 <apex:actionFunction name="addNewProfilePhoto" action="{!addNewImage}"
  25.                                     reRender="profilePhoto, profilePhotoForm, cropperForm">
  26.                     <apex:param name="imageName" value="" assignTo="{!myDoc.Name}"/>
  27.                     <apex:param name="imageBody" value="" assignTo="{!imageBody}"/>
  28.                 </apex:actionFunction>
  29.             </apex:actionRegion>
  30.         </apex:form>
  31.     </div>
  32.  
  33.     <div id="cropperDialog">
  34.         <apex:form id="cropperForm">
  35.             <div id="imageContainer" style="margin: auto; text-align: center;">
  36.                 <apex:image id="target"
  37.                            url="{! IF(ISNULL(profilePhotoId), URLFOR($Resource.default_profile_photo), '/servlet/servlet.FileDownload?file=' + profilePhotoId)}"
  38.                            style="max-height: 100%; max-width: 100%"/>
  39.                 <canvas id="preview" width="150" height="150"
  40.                        style="border:1px solid; overflow:hidden;display:none;"></canvas>
  41.                 <br/>
  42.             </div>
  43.             <div style="text-align: center;">
  44.                 <input type="file" value="{!myDoc.Body}" fileName="{!myDoc.Name}" styleClass="fileType" id="imgInp"
  45.                       accept="image/jpeg,image/pjpeg,image/jpeg,image/png"/>
  46.             </div>
  47.             <apex:commandButton value="{!$Label.AddButton}"
  48.                                onClick="saveImage(); closeCropperDialog(); closeProfilePhotoDialog();  return false;" reRender="imgInp"/>
  49.             <apex:commandButton value="{!$Label.ChangeButton}"
  50.                                onClick="updateProfilePhoto1(); closeCropperDialog(); closeProfilePhotoDialog();  return false;" reRender="imgInp"/>
  51.         </apex:form>
  52.  
  53.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement