Difference between revisions 103593 and 103602 on hewikiquote


$(document).ready(function () {
        var x = $(":[rel=signature]").data('action');
        if (x && x.options)
                x.options.pre = '~~' + '~~';
});
//<source lang="javascript">
/* סקריפט להוספת רשימת אזהרות כשעורכים דף שיחה של אנונימי, נכתב על-ידי ערן */
/* מועתק מ[[w:מדיה ויקי:Gadget-Warnings.js]] */
var warnings = ["בחרו אזהרה כדי להוסיף", "אזהרה", "בוטל", "הבל", "הזמנה", "הסבר", "העתקה", "ויקיזציה", "כבר קיים", "לך", "ניסויים", "נמחק", "נמחק ניסויים", "פרסומת", "תודה", "תלונה"];
var substWarning = false;

function warningsList() {
    if (!document.getElementById("wpSummaryLabel")) return; // not an edit page
    if( wgNamespaceNumber != 3 || !/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test( wgTitle ) ) return; // not an anonymous user talk

    var select = document.createElement("select");
    select.id = "warningsList";
    select.onchange = function() {
        insertWarning( this.selectedIndex, this[this.selectedIndex].title );
        this.selectedIndex = 0;
        return false;
    }
 
    for( var i = 0; i < warnings.length; i++ ) {
        select = createOptionElement( select, warnings[i] );
    }
    var div = document.createElement("div");
    div.appendChild (document.createTextNode("אזהרות: "));
    div.appendChild (select);
    var wpSummaryLabel = document.getElementById("wpSummaryLabel");
    wpSummaryLabel.parentNode.insertBefore (div, wpSummaryLabel);
}

function insertWarning( index, title ) {
    if( index > 0 ) {
        document.getElementById("wpSummary").value += title;
        document.getElementById("wpTextbox1").value += "{" + "{" + (substWarning ? "ס:" : "") + title + "}} ~~" + "~~";
    }
}

addOnloadHook(warningsList);
//</source>