LockD&DMail

Bloque le drag and drop sur la messagerie

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        LockD&DMail
// @namespace   InGame
// @description Bloque le drag and drop sur la messagerie
// @include     http://www.dreadcast.net/Main
// @include     https://www.dreadcast.eu/Main
// @version     1.021
// @grant       none
// ==/UserScript==

MenuMessagerie.prototype.handleDrag = function () {
    $("#liste_messages .message:not(.ui-draggable)").draggable({
        cursorAt: {
            top: 0,
            left: -20
        },
        helper: function () {
            var a = $("#liste_messages .content input:checked").length;
            return $('<div id="dragged_msg"><span>' + (a ? a : "") + "</span></div>")
        },
        start: function () {
    		if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
            	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")))
        },
        stop: function () {
	    	if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
            	 $("#liste_messages .folder_list").trigger("click")
        }
    })
}

var lock = document.createElement('div');
lock.id='lock';
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;");

//$("#zone_messagerie .titre").text("");
var mess = document.getElementById('zone_messagerie');
mess.appendChild(lock);
$('#lock').css('background-position','0px 0px').css('left','120px').css('top','5px').css('background-size','15px 15px').addClass('link');

lock.onclick = function(){
    if( document.getElementById('lock').style.backgroundImage.replace(/\"/g,'') == 'url(https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png)')
    document.getElementById('lock').style.backgroundImage = 'url("http://www.geodesheep.com/skin-01/images/icone_cadenas.png")';
  else
    document.getElementById('lock').style.backgroundImage = 'url("https://cdn1.iconfinder.com/data/icons/win8-and-ios-tab-bar-icons/30/Unlock.png")';
};