fix a warning and suggestions for pullrequest
* fix indentation to tabs * remove unneeded calls for dropzone.min.js and dropzone.min.css * removed debug output
This commit is contained in:
parent
cf4c0a9ddf
commit
c64d09a98a
3 changed files with 57 additions and 3 deletions
|
@ -29,7 +29,7 @@
|
|||
"asika/simple-console": "^1.0",
|
||||
"bacon/bacon-qr-code": "^2.0.0",
|
||||
"divineomega/password_exposed": "^2.8",
|
||||
"enyo/dropzone": "^5.9",
|
||||
"enyo/dropzone": "^5.9",
|
||||
"ezyang/htmlpurifier": "^4.7",
|
||||
"friendica/json-ld": "^1.0",
|
||||
"geekwright/po": "^2.0",
|
||||
|
|
|
@ -59,10 +59,8 @@ class ACL
|
|||
|
||||
$page->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js'));
|
||||
$page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js'));
|
||||
$page->registerFooterScript(Theme::getPathForFile('../vendor/enyo/dropzone/dist/min/dropzone.min.js'));
|
||||
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
|
||||
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
|
||||
$page->registerStylesheet(Theme::getPathForFile('../vendor/enyo/dropzone/dist/min/dropzone.min.css'));
|
||||
|
||||
$contacts = self::getValidMessageRecipientsForUser(DI::userSession()->getLocalUserId());
|
||||
|
||||
|
|
|
@ -206,6 +206,49 @@ can load different content into the jot modal (e.g. the item edit jot)
|
|||
},
|
||||
});
|
||||
|
||||
// document.onpaste = function(event){
|
||||
$('#jot-modal-body').on('paste', function(event){
|
||||
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
items.forEach((item) => {
|
||||
if (item.kind === 'file') {
|
||||
// adds the file to your dropzone instance
|
||||
console.log(item);
|
||||
dropzoneJot.addFile(item.getAsFile())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
=======
|
||||
Dropzone.autoDiscover = false;
|
||||
var dropzoneJot = new Dropzone( '#jot-modal-body', {
|
||||
paramName: "userfile", // The name that will be used to transfer the file
|
||||
maxFilesize: 6, // MB - change this to use systemsettings
|
||||
previewsContainer: '#dz-preview-jot',
|
||||
url: "/media/photo/upload?response=url&album=",
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
init: function() {
|
||||
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) + " ")
|
||||
} else {
|
||||
target.focus()
|
||||
document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
>>>>>>> 6f2158ac2 (fix a warning and suggestions for pullrequest)
|
||||
|
||||
<<<<<<< HEAD
|
||||
$('#jot-modal-content').on('paste', function(event){
|
||||
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
items.forEach((item) => {
|
||||
|
@ -215,4 +258,17 @@ can load different content into the jot modal (e.g. the item edit jot)
|
|||
}
|
||||
})
|
||||
})
|
||||
||||||| parent of 6f2158ac2 (fix a warning and suggestions for pullrequest)
|
||||
=======
|
||||
// document.onpaste = function(event){
|
||||
$('#jot-modal-body').on('paste', function(event){
|
||||
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
items.forEach((item) => {
|
||||
if (item.kind === 'file') {
|
||||
// adds the file to your dropzone instance
|
||||
dropzoneJot.addFile(item.getAsFile())
|
||||
}
|
||||
})
|
||||
})
|
||||
>>>>>>> 6f2158ac2 (fix a warning and suggestions for pullrequest)
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue