dcDel

2021. 1. 2. 오후 9:43:11

目前為 2021-01-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        dcDel
// @namespace   Violentmonkey Scripts
// @match       https://gall.dcinside.com/mgallery/board/lists
// @grant       none
// @version     1.6
// @author      -
// @description 2021. 1. 2. 오후 9:43:11
// ==/UserScript==
var colg = $("colgroup")[0].children[0], th = $("thead")[0].children[0].children[0];
if(colg.getAttribute('style') == 'width:3%') {
  colg.remove();
  th.remove();
}

var issue = $(".ub-content");
for(var i=0; i<issue.length; i++) {
  if(issue[i].children[3].getAttribute('user_name') == '운영자') {
    issue[i].remove();
  }
}

$(document).on("contextmenu",function(e){
	var x, y, ElementPoint, ElementPointNo;
  x = e.pageX - document.scrollingElement.scrollLeft;
  y = e.pageY - document.scrollingElement.scrollTop;
  ElementPoint = document.elementFromPoint(x, y);
  
  if($(ElementPoint).prop('tagName') == 'TD') {
    ElementPointNo = $(ElementPoint).closest("tr")[0].getAttribute('data-no');
    del_custom(ElementPointNo);
    return false;
  }
  else if(ElementPoint.getAttribute('class') == 'btn_write sp_img' || ElementPoint.getAttribute('class') == 'btn_blue write') {
    window.open('https://gall.dcinside.com/mgallery/board/write/?id='+getParameterByName('id'), '_blank').focus();
  }
  else if(ElementPoint.getAttribute('class') == 'sp_img btn_useradmin_go') {
    window.open('https://gall.dcinside.com/mgallery/management?id='+getParameterByName('id'), '_blank').focus();
  }
  //window.location.href
});

function del_custom(no) {
  var allVals = Array();
    
  allVals.push(no);

  if(confirm("해당 게시물을 삭제하시겠습니까?")){

      $.ajax({
          type : "POST",
          url : "/ajax/"+ get_gall_type_name() +"_manager_board_ajax/delete_list",
          data : { 'ci_t': get_cookie('ci_c'), 'id': $.getURLParam('id'), 'nos': allVals ,_GALLTYPE_: _GALLERY_TYPE_ },
      dataType : 'json',
          cache : false,
          async : false,
          success : function(ajaxData) {
        if(typeof(ajaxData.msg) != 'undefined' && ajaxData.msg) {
          alert(ajaxData.msg);
        }

        if(ajaxData.result == "success") {
          //location.reload(true);
        }
          },
          error : function(data) {
             alert('시스템 오류로 작업이 중지되었습니다. 잠시 후 다시 이용해 주세요.');
          }
      });
  }
}

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
            results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}