LockD&DMail

Bloque le drag and drop sur la messagerie

  1. // ==UserScript==
  2. // @name LockD&DMail
  3. // @namespace InGame
  4. // @description Bloque le drag and drop sur la messagerie
  5. // @include http://www.dreadcast.net/Main
  6. // @include https://www.dreadcast.eu/Main
  7. // @version 1.021
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. MenuMessagerie.prototype.handleDrag = function () {
  12. $("#liste_messages .message:not(.ui-draggable)").draggable({
  13. cursorAt: {
  14. top: 0,
  15. left: -20
  16. },
  17. helper: function () {
  18. var a = $("#liste_messages .content input:checked").length;
  19. return $('<div id="dragged_msg"><span>' + (a ? a : "") + "</span></div>")
  20. },
  21. start: function () {
  22. if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
  23. return "-1" == $("#current_folder").attr("data-id") ? !1 : (!$(this).hasClass("selected") && $("#liste_messages").length && nav.getMessagerie().messageUnselectAll(), void($("#folder_list:hidden").length && $("#liste_messages .folder_list").trigger("click")))
  24. },
  25. stop: function () {
  26. if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
  27. $("#liste_messages .folder_list").trigger("click")
  28. }
  29. })
  30. }
  31.  
  32. var lock = document.createElement('div');
  33. lock.id='lock';
  34. lock.setAttribute("style", "width:32px;height:30px;background-image:url('https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png');background-repeat: no-repeat;background-position: 33px 0;position: absolute; right: 0px;z-index: 999999;");
  35.  
  36. //$("#zone_messagerie .titre").text("");
  37. var mess = document.getElementById('zone_messagerie');
  38. mess.appendChild(lock);
  39. $('#lock').css('background-position','0px 0px').css('left','120px').css('top','5px').css('background-size','15px 15px').addClass('link');
  40.  
  41. lock.onclick = function(){
  42. if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
  43. document.getElementById('lock').style.backgroundImage = 'url("http://www.geodesheep.com/skin-01/images/icone_cadenas.png")';
  44. else
  45. document.getElementById('lock').style.backgroundImage = 'url("https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png")';
  46. };