'$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12),
// Dropzone
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
}
'$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12),
// Dropzone
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
'$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12),
// Dropzone
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
}
'$always_open_compose' => $this->pConfig->get($this->session->getLocalUserId(), 'frio', 'always_open_compose', false),
// Dropzone
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
]),
// Dropzone
- '$max_imagesize' => DI::config()->get('system', 'maximagesize')
+ '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
}
'$shortpermset' => $this->t('Permissions'),
'$compose_link_title' => $this->t('Open Compose page'),
+
// Dropzone
- //'$max_imagesize' => \Friendica\\Util\\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // both not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
-
return $output;
}
'$indent' => $indent,
'$rand_num' => Crypto::randomDigits(12),
// Dropzone
- //'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
- // Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
- '$max_imagesize' => DI::config()->get('system', 'maximagesize'),
+ '$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
</div>
</div>
<script>
- // getMByte() is from view/theme/frio/js/dropzone-frio.js
- // to workaround dysfunctional php Strings:getBytesFromShorthand
Dropzone.autoDiscover = false;
var dropzoneCompose = new Dropzone( '#dropzone-{{$id}}', {
- paramName: "userfile", // The name that will be used to transfer the file
- maxFilesize: getMBytes('{{$max_imagesize}}'), // MB
- url: "/media/photo/upload?response=url&album=",
+ paramName: 'userfile', // The name that will be used to transfer the file
+ maxFilesize: {{$max_imagesize}}, // MB
+ url: '/media/photo/upload?response=url&album=',
accept: function(file, done) {
done();
},
init: function() {
- this.on("success", function(file, serverResponse) {
+ this.on('success', function(file, serverResponse) {
var target = $('#comment-edit-text-{{$id}}')
var resp = $(serverResponse).find('div#content').text()
if (target.setRangeText) {
//if setRangeText function is supported by current browser
- target.setRangeText(" " + $.trim(resp) + " ")
+ target.setRangeText(' ' + $.trim(resp) + ' ')
} else {
target.focus()
document.execCommand('insertText', false /*no UI*/, $.trim(resp));
}
});
- this.on("complete", function(file) {
+ this.on('complete', function(file) {
// Remove just uploaded file from dropzone, makes interface more clear.
// Image can be seen in posting-preview
// We need preview to get optical feedback about upload-progress.
// To make dropzone fileupload work on editing a comment, we need to
// attach a new dropzone to modal
dropzoneJotEdit = new Dropzone( '#jot-text-wrap', {
- paramName: "userfile", // The name that will be used to transfer the file
- maxFilesize: getMBytes('{{$max_imagesize}}'), // MB
- url: "/media/photo/upload?response=url&album=",
+ paramName: 'userfile', // The name that will be used to transfer the file
+ maxFilesize: '{{$max_imagesize}}', // MB
+ url: '/media/photo/upload?response=url&album=',
accept: function(file, done) {
done();
},
init: function() {
- this.on("success", function(file, serverResponse) {
+ this.on('success', function(file, serverResponse) {
var target = $('#profile-jot-text')
var resp = $(serverResponse).find('div#content').text()
if (target.setRangeText) {
//if setRangeText function is supported by current browser
- target.setRangeText(" " + $.trim(resp) + " ")
+ target.setRangeText(' ' + $.trim(resp) + ' ')
} else {
target.focus()
- document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
+ document.execCommand('insertText', false /*no UI*/, ' ' + $.trim(resp) + ' ');
}
});
- this.on("complete", function(file) {
+ this.on('complete', function(file) {
// Remove just uploaded file from dropzone, makes interface more clear.
// Image can be seen in posting-preview
// We need preview to get optical feedback about upload-progress.
</div>
<script>
- // getMByte() is from view/theme/frio/js/dropzone-frio.js
- // to workaround dysfunctional php Strings:getBytesFromShorthand
Dropzone.autoDiscover = false;
var dropzone{{$id}} = new Dropzone( '#dropzone-{{$id}}', {
- paramName: "userfile", // The name that will be used to transfer the file
- maxFilesize: getMBytes('{{$max_imagesize}}'), // MB
- url: "/media/photo/upload?response=url&album=",
+ paramName: 'userfile', // The name that will be used to transfer the file
+ maxFilesize: {{$max_imagesize}}, // MB
+ url: '/media/photo/upload?response=url&album=',
accept: function(file, done) {
done();
},
init: function() {
- this.on("success", function(file, serverResponse) {
+ this.on('success', function(file, serverResponse) {
var target = $('#comment-edit-text-{{$id}}')
var resp = $(serverResponse).find('div#content').text()
if (target.setRangeText) {
//if setRangeText function is supported by current browser
- target.setRangeText(" " + $.trim(resp) + " ")
+ target.setRangeText(' ' + $.trim(resp) + ' ')
} else {
target.focus()
- document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
+ document.execCommand('insertText', false /*no UI*/, ' ' + $.trim(resp) + ' ');
}
});
- this.on("complete", function(file) {
+ this.on('complete', function(file) {
// Remove just uploaded file from dropzone, makes interface more clear.
// Image can be seen in posting-preview
// We need preview to get optical feedback about upload-progress.
{{/if}}
<script type="text/javascript" src="view/theme/frio/js/textedit.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<script type="text/javascript" src="vendor/enyo/dropzone/dist/min/dropzone.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
- <script type="text/javascript" src="view/theme/frio/js/dropzone-frio.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
{{* Include the strings which are needed for some js functions (e.g. translation)
They are loaded into the html <head> so that js functions can use them *}}
</script>
<script>
- // getMByte() is from view/theme/frio/js/dropzone-frio.js
- // to workaround dysfunctional php Strings:getBytesFromShorthand
Dropzone.autoDiscover = false;
var dropzoneJot = new Dropzone( '#jot-text-wrap', {
- paramName: "userfile", // The name that will be used to transfer the file
- maxFilesize: getMBytes('{{$max_imagesize}}'), // MB
- url: "/media/photo/upload?response=url&album=",
+ paramName: 'userfile', // The name that will be used to transfer the file
+ maxFilesize: {{$max_imagesize}}, // MB
+ url: '/media/photo/upload?response=url&album=',
accept: function(file, done) {
done();
},
init: function() {
- this.on("success", function(file, serverResponse) {
+ this.on('success', function(file, serverResponse) {
var target = $('#profile-jot-text')
var resp = $(serverResponse).find('div#content').text()
if (target.setRangeText) {
//if setRangeText function is supported by current browser
- target.setRangeText(" " + $.trim(resp) + " ")
+ target.setRangeText(' ' + $.trim(resp) + ' ')
} else {
target.focus()
- document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
+ document.execCommand('insertText', false /*no UI*/, ' ' + $.trim(resp) + ' ');
}
});
- this.on("complete", function(file) {
+ this.on('complete', function(file) {
// Remove just uploaded file from dropzone, makes interface more clear.
// Image can be seen in posting-preview
// We need preview to get optical feedback about upload-progress.