Feature #38504 » adjust-image-display-size-for-HiDPI-monitors.patch
| public/javascripts/attachments.js | ||
|---|---|---|
|
if (!clipboardData) { return; }
|
||
|
if (clipboardData.types.some(function(t){ return /^text\/plain$/.test(t); })) { return; }
|
||
|
var pixelDensity = Math.round(window.devicePixelRatio);
|
||
|
var files = clipboardData.files
|
||
|
for (var i = 0 ; i < files.length ; i++) {
|
||
|
var file = files[i];
|
||
| ... | ... | |
|
+ ('0'+date.getDate()).slice(-2)
|
||
|
+ ('0'+date.getHours()).slice(-2)
|
||
|
+ ('0'+date.getMinutes()).slice(-2)
|
||
|
+ '-' + randomKey(5).toLocaleLowerCase()
|
||
|
+ '.' + file.name.split('.').pop();
|
||
|
+ '-' + randomKey(5).toLocaleLowerCase();
|
||
|
// pixel density descriptor (e.g. @2x)
|
||
|
if (pixelDensity >= 2) {
|
||
|
filename += '@' + pixelDensity + 'x';
|
||
|
}
|
||
|
// file extension
|
||
|
filename += '.' + file.name.split('.').pop();
|
||
|
// get input file in the closest form
|
||
|
var inputEl = $(this).closest("form").find('input:file.filedrop');
|
||