Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(plugins): adds several reported content features
Ajaxifies the reporting form (form page still BC) and delete/archive actions. Sorts un-archived reports at the top of results. More compact report display, and clicking reported link opens page in an iframe in colorbox. Fixes Elgg#5379, Elgg#6082, Elgg#5380
- Loading branch information
Showing
10 changed files
with
183 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
define(function (require) { | ||
var elgg = require('elgg'), | ||
$ = require('jquery'); | ||
|
||
var $a = $('.elgg-menu-item-report-this a'); | ||
if ($a.length) { | ||
$a[0].href += '?address=' + encodeURIComponent(location.href) + | ||
'&title=' + encodeURIComponent(document.title); | ||
} | ||
|
||
$(document).on('submit', '.elgg-form-reportedcontent-add', function (e) { | ||
e.preventDefault(); | ||
var $form = $(this); | ||
elgg.action($form[0].action, { | ||
data: $form.serialize(), | ||
success: function (data) { | ||
if (data.status == 0) { | ||
elgg.ui.lightbox.close(); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
$(document).on('click', '.elgg-item-object-reported_content', function (e) { | ||
var $clicked = $(e.target), | ||
$li = $(this); | ||
|
||
if ($clicked.is('a[data-elgg-action]')) { | ||
var action = $clicked.data('elggAction'); | ||
elgg.action(action.name, { | ||
data: action.data, | ||
success: function (data) { | ||
if (data.status == -1) { | ||
return; | ||
} | ||
|
||
if (action.name === 'reportedcontent/delete') { | ||
$li.slideUp(); | ||
} else { | ||
$clicked.fadeOut(); | ||
$li.find('.reported-content-active') | ||
.removeClass('reported-content-active') | ||
.addClass('reported-content-archived'); | ||
} | ||
} | ||
}); | ||
return false; | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
mod/reportedcontent/views/default/resources/reportedcontent/add_form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
echo elgg_view_form('reportedcontent/add'); |
Oops, something went wrong.