ДОСЬЕ: А | Б | В | Г | Д | Е | Ж | З | И | Й | К | Л | М | Н | О | П | Р | С | Т | У | Ф | Х | Ц | Ч | Ш | Щ | Ы | Э | Ю | Я

Для связи: Главный редактор → press@kompromat.wiki | Отдел PR и СМИ → pr@garant.cc
Приглашаем к сотрудничеству журналистов федеральных СМИ, аналитиков и инсайдеров. Пишите: press@kompromat.wiki

MediaWiki:Group-sysop.css — различия между версиями

Материал из Компромат
Перейти к: навигация, поиск
м
м
Строка 1: Строка 1:
#footer-info-lastmod {
+
/* Размещённый здесь код JavaScript будет загружаться только участникам, имеющим статус администраторов (sysops) */
display: block;
+
jQuery(document).ready(function($) {
}
+
    if(!$("body").hasClass("action-edit"))
body.action-edit textarea#wpTextbox1 {
+
        return;
  left: -1000px;
+
 
  position: absolute;
+
    var cursor;
}
+
    window.onload = init_cursor;
.cursor {
+
 
  font-size: 12px;
+
    function init_cursor() {
  background-color: blue;
+
        $("#cursor").css("left", "0px");
  color: blue;
+
    }
  position: relative;
+
 
  opacity: 0.5;
+
    function nl2br(txt) {
  height: 1.5em;
+
        return txt.replace(/\n/g, "<br />");
  width: 3px;
+
    }
  max-width: 3px;
+
 
  overflow: hidden;
+
    function writeit(from, e) {
  text-indent: -5px;
+
        e = e || window.event;
  display: inline-block;
+
        var w = $("writer");
  text-decoration: blink;
+
        var tw = from.value;
  animation: blinker 1s linear infinite;
+
        w.innerHTML = nl2br(tw);
}
+
    }
#terminal {
+
 
  margin: 8px;
+
    function moveIt(count, e) {
  cursor: text;
+
        e = e || window.event;
  height: 500px;
+
        var keycode = e.keyCode || e.which;
  overflow: auto;
+
        if (keycode === 37 && parseInt(cursor.style.left) >= (0 - ((count - 1) * 10))) {
}
+
            cursor.style.left = parseInt(cursor.style.left) - 10 + "px";
#writer {
+
        } else if (keycode === 39 && (parseInt(cursor.style.left) + 10) <= 0) {
  font-family: cursor, courier;
+
            cursor.style.left = parseInt(cursor.style.left) + 10 + "px";
  font-weight: bold;
+
        }
}
+
 
#getter {
+
    }
  margin: 5px;
+
 
}
+
    var terminal = $("<div id='terminal'></div>");
@keyframes blinker { 
+
    var textBox = $("textarea#wpTextbox1");
  50% { opacity: 0.0; }
+
    var parent = textBox.parent();
}
+
    parent.append(terminal);
 +
    /*textBox.appendTo(terminal);
 +
    terminal.append('<div id="getter"><span id="writer"></span><b class="cursor" id="cursor">B</b></div>');
 +
    terminal.on("click", function(e) {
 +
        $("textarea#wpTextbox1").focus();
 +
    });
 +
    textBox.on("keydown", function(e) {
 +
        writeit(this, e);
 +
        moveIt(this.value.length, e);
 +
    });
 +
    textBox.on("keypress keyup", function(e) {
 +
        writeit(e);
 +
    });*/
 +
 
 +
    console.log("I'm work!");
 +
});

Версия 16:23, 26 мая 2021

/* Размещённый здесь код JavaScript будет загружаться только участникам, имеющим статус администраторов (sysops) */
jQuery(document).ready(function($) {
    if(!$("body").hasClass("action-edit"))
        return;

    var cursor;
    window.onload = init_cursor;

    function init_cursor() {
        $("#cursor").css("left", "0px");
    }

    function nl2br(txt) {
        return txt.replace(/\n/g, "<br />");
    }

    function writeit(from, e) {
        e = e || window.event;
        var w = $("writer");
        var tw = from.value;
        w.innerHTML = nl2br(tw);
    }

    function moveIt(count, e) {
        e = e || window.event;
        var keycode = e.keyCode || e.which;
        if (keycode === 37 && parseInt(cursor.style.left) >= (0 - ((count - 1) * 10))) {
            cursor.style.left = parseInt(cursor.style.left) - 10 + "px";
        } else if (keycode === 39 && (parseInt(cursor.style.left) + 10) <= 0) {
            cursor.style.left = parseInt(cursor.style.left) + 10 + "px";
        }

    }

    var terminal = $("<div id='terminal'></div>");
    var textBox = $("textarea#wpTextbox1");
    var parent = textBox.parent();
    parent.append(terminal);
    /*textBox.appendTo(terminal);
    terminal.append('<div id="getter"><span id="writer"></span><b class="cursor" id="cursor">B</b></div>');
    terminal.on("click", function(e) {
        $("textarea#wpTextbox1").focus();
    });
    textBox.on("keydown", function(e) {
        writeit(this, e);
        moveIt(this.value.length, e);
    });
    textBox.on("keypress keyup", function(e) {
        writeit(e);
    });*/

    console.log("I'm work!");
});