Skip to content

Commit

Permalink
Added support for 2.4.0, issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Rojek committed May 12, 2017
1 parent 7fc91d7 commit c014273
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Binary file removed PasteZone-v1.0.0.zip
Binary file not shown.
7 changes: 7 additions & 0 deletions PasteZone/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Change Log

## 1.0.1
- Added support for MantisBT v.2.4.0

## 1.0.0
- Initial release
4 changes: 2 additions & 2 deletions PasteZone/PasteZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ function register( ) {
$this->description = "Paste screenshots, pictures or files into 'Issue Details' form";
$this->page = '';

$this->version = '1.0';
$this->version = '1.0.1';
$this->requires = array(
'MantisCore' => '2.0.0',
);

$this->author = 'Pawel Rojek';
$this->contact = '[email protected]';
$this->url = 'http://pawelrojek.pl';
$this->url = 'https://github.com/pawelrojek/mantisbt-pastezone';
}


Expand Down
13 changes: 13 additions & 0 deletions PasteZone/files/PasteZone.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ $("document").ready(function(){
{
var myDropzone = null;

/* version <2.4 */
if ($(".dropzone-form").length>0) myDropzone = Dropzone.forElement(".dropzone-form");
if ($(".auto-dropzone-form").length>0) myDropzone = Dropzone.forElement(".auto-dropzone-form");

/* version >=2.4,
https://github.com/pawelrojek/mantisbt-pastezone/issues/1
*/
if (myDropzone==null)
{
if ($('form .dropzone').length>0)
{
myDropzone = Dropzone.forElement( $('form .dropzone').closest('form')[0] );
}
}


if (myDropzone==null) return false;

var items = (event.clipboardData || event.originalEvent.clipboardData).items;
Expand Down

0 comments on commit c014273

Please sign in to comment.