JSFiddle - React, Tailwind, and code Playground

by rluuan

JavaScript

"$(document).ready(function() {
    osAjaxBackend.BindAfterAjaxRequest(function(){ screenUnBlock(); }); 
    

    var iWidth = " + If ( EncodeJavaScript(CropImageWidth) <> "", TextToInteger(EncodeJavaScript(CropImageWidth)),  TextToInteger(EncodeJavaScript(CroppieWidth))) + ";
    var iHeight= " + If ( EncodeJavaScript(CropImageHeight) <> "", TextToInteger(EncodeJavaScript(CropImageHeight)), TextToInteger(EncodeJavaScript(CroppieHeight))) + ";
    var iWidthMaxImage = " + TextToInteger(EncodeJavaScript(CropImageWidth)) + ";
    var iHeightMaxImage= " + TextToInteger(EncodeJavaScript(CropImageHeight)) + ";
    var iOriginalHeightImage = 0;
    var screenWidth = $(window).width();
    
    $uploadCrop = $('.upload-demo').croppie({
      url: 'data:image/jpeg;base64, " + EncodeJavaScript(ImageDefault) + "',
      enableResize: true,
      viewport: { width: iWidth, height: iHeight, type: '" + EncodeJavaScript(GetTypeArea(Type).TypeArea.Type) + "' },
      boundary: { width: " + ( If (IsCroppieFull, "screenWidth", TextToInteger(EncodeJavaScript(CroppieWidth)) + 40)) + ", height:" + ( TextToInteger(EncodeJavaScript(CroppieHeight)) + 40) + " }
      " + If (not IsZoom, ",
      showZoomer: false,
      mouseWheelZoom: 'ctrl'
      ", "") + "  
    });
    $(window).load (function() {
        $uploadCrop.croppie('setZoom', 0);
        
    });
    $('.btnNewImage').on('click', function(event) {
        $('.UploadCroppie').click(); 
        return false;  
    });
    $(document).on(""change"", ""[type=file]"", function() {

        var input = this;
        var file = this.files[0];
        var fileType = file['type'];
        var fileSize = file.size;
        var ValidImageTypes = ['image/gif', 'image/jpeg', 'image/png'];
        if (fileSize > 2097152) {
            alert ('Imagem acima de 2Mb, entre com uma imagem inferior a isso.');
            return false;
        }
        if ($.inArray(fileType, ValidImageTypes) < 0) {
            OsNotifyWidget('" +...