|
|
(8 גרסאות ביניים של אותו משתמש אינן מוצגות) |
שורה 11: |
שורה 11: |
| mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js&action=raw&ctype=text/javascript'); | | mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js&action=raw&ctype=text/javascript'); |
|
| |
|
| //ניסוי לגאדג'אט של מחיקה הגנה וחסימה | | /* |
| if(mw.config.get('wgNamespaceNumber') + 1) // not a special page | | // סקריפט לצנזור שם ה' - נכתב ע"י [[user:Neriah]] |
| $(function(){
| | //if ( |
| | | // mw.config.get('wgNamespaceNumber') === 0 || |
| function save(title, summary, content, section, next) {
| | // mw.config.get('wgNamespaceNumber') === 106 || |
| var param = {action: 'edit', title: title, summary: summary, token: mw.user.tokens.get('csrfToken'), section: section || '0', appendtext: content, format: 'json'};
| | // mw.config.get('wgNamespaceNumber') === 14 |
| $.post(mw.util.wikiScript('api'), param, function(data) {
| | //) |
| if (data && data.error)
| | { |
| mw.util.jsMessage('שגיאה בשמירה: ' + data.error['info']);
| | var buttonSpan = document.createElement("span"); |
| else if (data && data.edit && data.edit.result == 'Success' && typeof next == 'function')
| | buttonSpan.className = "plainlinks mw-ui-button"; |
| next();
| | buttonSpan.id = "censorButton"; |
| });
| | buttonSpan.innerText = "צנזור שם ה'"; |
| }
| | |
|
| | var buttonDiv = document.createElement("div"); |
| function addMenuItem(caption, tooltip, section, message, summary, accessKey, replaceParam) {
| | buttonDiv.className = "mw-parser-output"; |
| if (replaceParam) {
| | buttonDiv.id = "censorButton-div"; |
| var r = /replaceParam/g;
| | buttonDiv.appendChild(buttonSpan); |
| tooltip = tooltip.replace(r, replaceParam);
| | |
| message = message.replace(r, replaceParam);
| | var heading = document.getElementById('firstHeading'); |
| summary = summary.replace(r, replaceParam);
| | heading.appendChild(buttonDiv); |
| }
| | |
| var a = mw.util.addPortletLink('p-cactions','#',caption,'',tooltip,(accessKey||''));
| | buttonSpan.addEventListener("click", function() { |
| $(a).click(function() {
| | function censore(element, word) { |
| var reason = prompt("הסיבה לבקשה:");
| | let split_str = word.split(""); |
| if ($.trim(reason) == '')
| | const nikud = "[-/]*" |
| return;
| | |
| message += ' - ' + reason + ' ~~' + '~~';
| | const reg_list = split_str.reduce((list, elem, i) => { |
| save('אוצר:בקשות ממפעילים', summary, '\n\n* ' + message, section, function() { mw.util.jsMessage('בקשתך נשמרה בדף הבקשות מהמפעילים');});
| | list.push(elem, nikud); |
| });
| | return list; |
| }
| | }, []); |
|
| | reg_list.splice(0, 0, '('); |
| var ca = $.inArray(mw.config.get('wgNamespaceNumber'), [6, 14]) + 1 ? ':' : '';
| | reg_list.splice(3, 0, ')', '('); |
| var pageName = mw.config.get('wgPageName').replace( /_/g, " " );
| | reg_list.push(')'); |
|
| | if (word === "אדני") reg_list[reg_list.length-4] = "[-֯/ָּ]*" |
| var pageLink = $('.redirectMsg').length ? '{{ללא הפניה|replaceParam}}' : '[[' + ca + 'replaceParam]]'; | | |
| if(wgIsArticle) addMenuItem('מחיקה', 'בקשה למחיקת דף זה', 1, pageLink, '/* בקשות מחיקה */ [[replaceParam]]','d', pageName);
| | const regex = new RegExp(reg_list.join(""), "g"); |
| addMenuItem('הגנה', 'בקשה להגנה/ביטול ההגנה על דף זה', 3, pageLink, '/* בקשות הגנה / הסרת הגנה */ [[replaceParam]]','=', pageName);
| | element.innerHTML = element.innerHTML.replace(regex, "$1-$2"); |
| if(! wgIsArticle) addMenuItem('שחזור', 'בקשה לשחזור דף זה', 7, pageLink, '/* בקשות שחזור או בדיקת דף מחוק */ [[replaceParam]]','d', pageName);
| | } |
|
| | |
| if ($('#t-contributions').length) {
| | var elements = document.getElementsByTagName("*"); |
| var badUser = mw.config.get('wgTitle').split('/')[0];
| | |
| addMenuItem('חסימה', 'בקשה לחסימה/ביטול חסימתו של משתמש זה ', 2, "{{לחסום|replaceParam}}", '/* בקשות חסימה / הסרת חסימה */ [[משתמש:replaceParam|replaceParam]] ([[שיחת משתמש:replaceParam|ש]]|[[מיוחד:תרומות/replaceParam|ת]]|[[מיוחד:חסימה/replaceParam|ח]])',']', badUser);
| | for (var i = 0; i < elements.length; i++) { |
| addMenuItem('הרשאות', 'בקשה לשינוי ההרשאות של משתמש זה', 8, "{{הרשאות|replaceParam}}", '/* בקשת הרשאות */ [[משתמש:replaceParam|replaceParam]] ([[שיחת משתמש:replaceParam|ש]]|[[מיוחד:תרומות/replaceParam|ת]]|[[מיוחד:ניהול הרשאות משתמש/replaceParam|נ]])',']', badUser);
| | censore(elements[i], "יהוה"); |
| | censore(elements[i], "אדני"); |
| | censore(elements[i], "אלוה"); |
| | censore(elements[i], "אלהי"); |
| | censore(elements[i], "אלהים"); |
| | censore(elements[i], "אלוהים"); |
| | censore(elements[i], "צבאות"); |
| | censore(elements[i], "שדי"); |
| | } |
| | }); |
| } | | } |
|
| | */ |
| if (mw.util.getParamValue('oldid') && mw.util.getParamValue('diff'))
| |
| addMenuItem('הסתרת גרסה', 'בקשה להסתרת גרסה זו ' , 5, '{{הבדל|' + mw.config.get('wgPageName') + '|' + mw.util.getParamValue('diff') + '|' + mw.util.getParamValue('oldid') + '|טקסט=גרסה זו}}', '/* בקשות מחיקת גרסאות מסוימות */ בקשה להסתרת גרסה','[');
| |
|
| |
| });
| |
| | |
|
| |
|
| var buttonSpan = document.createElement("span"); | | var buttonSpan = document.createElement("span"); |
שורה 69: |
שורה 73: |
| buttonDiv.className = "mw-parser-output"; | | buttonDiv.className = "mw-parser-output"; |
| buttonDiv.style.display = "inline-block"; | | buttonDiv.style.display = "inline-block"; |
| buttonDiv.style.verticalAlign = "middle"; | | buttonDiv.style.verticalAlign = "left"; |
| //buttonDiv.style.marginLeft = "10px";
| |
| buttonDiv.style.marginLeft = "10px";
| |
| buttonDiv.appendChild(buttonSpan); | | buttonDiv.appendChild(buttonSpan); |
|
| |
|