PageSourceSearch

https://verge-rpg.com/assets/modules/pictureCropper.aa09cde313679cc15a64.min.js

js verge-rpg.com collected 2026-09-26 12:12:17 UTC 4,601 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[16852],{72254:(h,g,l)=>{var m,d;m=[l(29930)],d=function(f){const u={};u.show=function(e,r){const i=e.hasOwnProperty("fileSize")&&e.fileSize!==void 0?parseInt(e.fileSize,10):!1;app.parseAndTranslate("modals/upload-file",{showHelp:e.hasOwnProperty("showHelp")&&e.showHelp!==void 0?e.showHelp:!0,fileSize:i,title:e.title||"[[global:upload-file]]",description:e.description||"",button:e.button||"[[global:upload]]",accept:e.accept?e.accept.replace(/,/g,"&#44; "):""},function(s){s.modal("show"),s.on("hidden.bs.modal",function(){s.remove()});const t=s.find("#uploadForm");e.route&&t.attr("action",e.route),s.find("#fileUploadSubmitBtn").on("click",function(){return $(this).addClass("disabled"),e.uploadModal=s,C(e,r),!1})})},u.handleImageCrop=function(e,r){$("#crop-picture-modal").remove(),app.parseAndTranslate("modals/crop_picture",{url:utils.escapeHTML(e.url)},async function(i){i.modal({backdrop:"static"}).modal("show");const s=parseInt($(window).height()/2,10),t=document.getElementById("cropped-image");$(t).css("max-height",s);const c=(await l.e(60239).then(l.t.bind(l,65643,23))).default;let n=new c(t,{aspectRatio:e.aspectRatio,autoCropArea:1,viewMode:1,checkCrossOrigin:!0,cropmove:function(){e.restrictImageDimension&&(n.cropBoxData.width>e.imageDimension&&n.setCropBoxData({width:e.imageDimension}),n.cropBoxData.height>e.imageDimension&&n.setCropBoxData({height:e.imageDimension}))},ready:function(){if(!p(n,e))return i.modal("hide");if(e.restrictImageDimension){const o=t.width<t.height?t.width:t.height,a=o>e.imageDimension?e.imageDimension:o;n.setCropBoxData({width:a,height:a})}i.find(".rotate").on("click",function(){const o=this.getAttribute("data-degrees");n.rotate(o)}),i.find(".flip").on("click",function(){const o=this.getAttribute("data-option");this.getAttribute("data-method")==="scaleX"?n.scaleX(o):n.scaleY(o),this.setAttribute("data-option",o*-1)}),i.find(".reset").on("click",function(){n.reset()}),i.find(".crop-btn").on("click",function(){$(this).addClass("disabled");const o=p(n,e);o&&(i.find("#upload-progress-bar").css("width","0%"),i.find("#upload-progress-box").show().removeClass("hide"),D({data:e,imageData:o,progressBarEl:i.find("#upload-progress-bar")},function(a,b){if(a)return i.find("#upload-progress-box").hide(),i.find(".upload-btn").removeClass("disabled"),i.find(".crop-btn").removeClass("disabled"),f.error(a);r(b.url),i.modal("hide")}))}),i.find(".upload-btn").on("click",async function(){$(this).addClass("disabled"),n.destroy();const o=(await l.e(60239).then(l.t.bind(l,65643,23))).default;n=new o(t,{viewMode:1,autoCropArea:1,ready:function(){i.find(".crop-btn").trigger("click")}})})}})})};function D(e,r){const i={};i[e.data.paramName]=e.data.paramValue,i.method=e.data.socketMethod,i.size=e.imageData.length,i.progress=0;const s=1e5;function t(){const c=e.imageData.slice(i.progress,i.progress+s);socket.emit("uploads.upload",{chunk:c,params:i},function(n,o){if(n)return f.error(n);if(i.progress+s<i.size)return i.progress+=c.length,e.progressBarEl.css("width",(i.progress/i.size*100).toFixed(2)+"%"),setTimeout(t,100);e.progressBarEl.css("width","100%"),r(null,o)})}t()}function p(e,r){let i;try{i=r.imageType?e.getCroppedCanvas().toDataURL(r.imageType):e.getCroppedCanvas().toDataURL()}catch(s){["The operation is insecure.","Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported."].indexOf(s.message)!==-1?f.error("[[error:cors-error]]"):f.error(s.message);return}return i}function C(e,r){function i(o,a){o==="error"&&e.uploadModal.find("#fileUploadSubmitBtn").removeClass("disabled"),e.uploadModal.find("#alert-"+o).translateText(a).removeClass("hide")}const s=e.uploadModal.find("#fileInput");if(!s.val())return i("error","[[uploads:select-file-to-upload]]");const t=s[0].files[0],c=e.hasOwnProperty("fileSize")&&e.fileSize!==void 0?parseInt(e.fileSize,10):!1;if(c&&t.size>c*1024)return i("error","[[error:file-too-big, "+c+"]]");if(t.name.endsWith(".gif")){l.e(98463).then(function(){var o=[l(24187)];(function(a){a.ajaxSubmit(e.uploadModal,r)}).apply(null,o)}).catch(l.oe);return}const n=new FileReader;n.addEventListener("load",function(){const o=n.result;e.uploadModal.modal("hide"),u.handleImageCrop({url:o,imageType:t.type,socketMethod:e.socketMethod,aspectRatio:e.aspectRatio,allowSkippingCrop:e.allowSkippingCrop,restrictImageDimension:e.restrictImageDimension,imageDimension:e.imageDimension,paramName:e.paramName,paramValue:e.paramValue},r)},!1),t&&n.readAsDataURL(t)}return u}.apply(g,m),d!==void 0&&(h.exports=d)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.