@@ 283-316 (lines=34) @@ | ||
280 | }); |
|
281 | }) |
|
282 | // Delete Comment Function in dropdown |
|
283 | $('.jsCommentsWrapper').on('click', '.jsCommentsDeleteDropdownItem', function () { |
|
284 | var commentsId = $(this).data('comments-id'); |
|
285 | $('#JSGenericModal').dialog({ |
|
286 | title: 'Delete Comment', |
|
287 | open: $('#JSGenericModalText').text('Are you sure you want to delete this comment?'), |
|
288 | resizable: false, |
|
289 | height: 200, |
|
290 | modal: true, |
|
291 | buttons: { |
|
292 | 'Delete': function () { |
|
293 | $(this).dialog('close'); |
|
294 | $.ajaxQueue({ |
|
295 | // The URL for the request |
|
296 | url: 'db_comments.php', |
|
297 | data: 'action=delete&comments_id=' + commentsId, |
|
298 | type: 'POST', |
|
299 | dataType: 'html', |
|
300 | // Code to run if the request succeeds; |
|
301 | success: function (html) { |
|
302 | var begin = html.startsWith('You'); |
|
303 | if (begin) { |
|
304 | } else { |
|
305 | $('#jsCommentId' + commentsId).html(''); |
|
306 | } |
|
307 | window.OSDMessageDisplay(html); |
|
308 | } |
|
309 | }); |
|
310 | }, |
|
311 | Cancel: function () { |
|
312 | $(this).dialog('close'); |
|
313 | } |
|
314 | } |
|
315 | }); |
|
316 | }) |
|
317 | ||
318 | $(window).scroll(function () { |
|
319 | if ($(window).scrollTop() + $(window).height() >= $(document).height()) { |
|
@@ 248-281 (lines=34) @@ | ||
245 | }); |
|
246 | }) |
|
247 | // Delete Comment Function |
|
248 | $('.jsCommentsWrapper').on('click', '.jsCommentsDeleteButton', function () { |
|
249 | var commentsId = $(this).data('comments-id'); |
|
250 | $('#JSGenericModal').dialog({ |
|
251 | title: 'Delete Comment', |
|
252 | open: $('#JSGenericModalText').text('Are you sure you want to delete this comment?'), |
|
253 | resizable: false, |
|
254 | height: 200, |
|
255 | modal: true, |
|
256 | buttons: { |
|
257 | 'Delete': function () { |
|
258 | $(this).dialog('close'); |
|
259 | $.ajaxQueue({ |
|
260 | // The URL for the request |
|
261 | url: 'db_comments.php', |
|
262 | data: 'action=delete&comments_id=' + commentsId, |
|
263 | type: 'POST', |
|
264 | dataType: 'html', |
|
265 | // Code to run if the request succeeds; |
|
266 | success: function (html) { |
|
267 | var begin = html.startsWith('You'); |
|
268 | if (begin) { |
|
269 | } else { |
|
270 | $('#jsCommentId' + commentsId).html(''); |
|
271 | } |
|
272 | window.OSDMessageDisplay(html); |
|
273 | } |
|
274 | }); |
|
275 | }, |
|
276 | Cancel: function () { |
|
277 | $(this).dialog('close'); |
|
278 | } |
|
279 | } |
|
280 | }); |
|
281 | }) |
|
282 | // Delete Comment Function in dropdown |
|
283 | $('.jsCommentsWrapper').on('click', '.jsCommentsDeleteDropdownItem', function () { |
|
284 | var commentsId = $(this).data('comments-id'); |