Pembicaraan MediaWiki:Common.js/Arsip

Konten halaman tidak didukung dalam bahasa lain.
Bagian baru
Dari Wikipedia bahasa Indonesia, ensiklopedia bebas

Script tambahan[sunting sumber]

Ada beberapa script tambahan yang bisa dinonaktifkan jika koneksi Internet Anda lambat atau Anda tidak menyukai tampilan itu.

Atur variabel yang Anda inginkan tersebut di sub halaman switches.js di halaman pengguna Anda.

Jika Anda menyalin kode berikut ini ke switch.js, keenam fitur di atas akan dinonaktifkan dan mempercepat munculnya halaman.

LoadInterProject = false;
LoadLinkFA = false;
LoadNavFrame = false;
load_edittools = false;
LoadExtraPortlet = false;
LoadStripe = false;

Pembicaraan Templat:Navbox[sunting sumber]

Ternyata ada perbedaan di MediaWiki:Common.js yang tidak memungkinkan hal tersebut. Tolong ditambahin di MediaWiki:Common.js seperi di versi en.wiki (saat ini halaman tersebut tidak bisa diedit):

bennylin (-_-)V 12:10, 3 Desember 2007 (UTC)

Tidak bisa ya? Hmm.... (-_-)V bennylin 404 09:29, 12 Desember 2007 (UTC)

Tolong diperbarui lagi, karena Navframe jadi tidak berfungsi dengan benar

Terima kasih

Subhalaman[sunting sumber]

Kok pranala "Subhalaman" yang menurut saya sangat berguna dihapus ya, bung Ivan? (-_-)V bennylin 404 08:59, 29 April 2008 (UTC)

Tidak dihapus, hanya dipindahkan ke gadget. borgx(kirim pesan) 00:12, 30 April 2008 (UTC)

Referensi[sunting sumber]

 addCustomEditButton( "3/3b/Button_template_alt.png", "Catatan kaki", 
 	"\n== Catatan kaki ==\n\n" + "Templat:" + "reflist" + "" + "\n", "", "" );

ada yang berkeberatan jka kata "Catatan kaki" diganti menjadi "Referensi"?
Bennylin
10:21, 19 November 2009 (UTC)

Setuju  Tjmoel   11:20, 19 November 2009 (UTC)

Sudah diganti. Terima kasih.
Bennylin
06:45, 7 Desember 2009 (UTC)

Beberapa tombol baru telah ditambahkan. Silakan utarakan di sini usulan tombol yang perlu ditambahkan/dibuang, atau kalau urutannya ingin diubah.
bennylin
10:47, 27 Januari 2010 (UTC)

tambah donk[sunting sumber]

Tambahin juga donk yang bersumber pada ini ==> http://tolololpedia.wikia.com/wiki/MediaWiki:Common.js

--Erik 08:27, 27 Maret 2011 (UTC)

mainpg[sunting sumber]

 function mainpg() {
     if ((isMainPage || /[\/=:]Halaman_Utama/.test(document.location)) && document.getElementById('ca-nstab-main')) {
          document.getElementById('ca-nstab-main').firstChild.innerHTML = '<span>Utama<\/span>';
     }   
 }
 addOnloadHook(mainpg);

Kode di atas merusak tampilan tab vector, baik di WBI maupun situs lain yang mengimpor kode WBI (seperti id.wikisource). Mohon kodenya digantu atau dihapus saja, karena hanya hiasan saja. вёӣйүӀіп 13:48, 22 Juni 2011 (UTC) (via Meta)

Ternyata penyelesaiannya sangat mudah. Tinggal tambahkan <a></a> di antara kata Utama -> <a>Utama</a> dan masalahnya selesai. Sudah dicoba di Wiktionary bahasa Indonesia. Silakan dicoba. вёӣйүӀіп 14.46, 6 Februari 2012 (WIB)
Kalau tidak ada yang menyadari, ini juga merusak tampilan halaman utama untuk anon dan pengguna yang menggunakan kulit Vector. Sejak kulit ini dijadikan tampilan default pada Desember 2008 (>3 tahun!). Mohon segera diperbaiki ASAP. вёӣйүӀіп 14.58, 6 Februari 2012 (WIB)
Sepertinya maksud Benny adalah:
function mainpg() {
    if ((isMainPage || /[\/=:]Halaman_Utama/.test(document.location)) && document.getElementById('ca-nstab-main')) {
         document.getElementById('ca-nstab-main').firstChild.innerHTML = '<span><a>Utama<\/a><\/span>';
    }   
}
addOnloadHook(mainpg);

Kℇℵ℟ℑK 6 Februari 2012 14.32 (UTC)Balas

iProject[sunting sumber]

Sebaiknya menggunakan kode di bawah ini sebab dalam Perubahan terbaru (dalam kulit Vector), ukuran font interproyek terlihat lebih besar. Salam. Kℇℵ℟ℑK 30 Maret 2012 11.42 (UTC)Balas

/**
 
== InterProject ==
 
InterProject, link di menu samping untuk proyek lain.
 
  */
 mw.util.addCSS('#interProyek {display: none; speak: none;} #p-tb .pBody {padding-right: 0;}');
 function iProject() {
     if (document.getElementById("interProyek")) {
          var iProject = document.getElementById("interProyek").innerHTML;
          var interProject = document.createElement("div");
          interProject.style.marginTop = "0.7em";
		  interProject.style.backgroundImage="url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAA"+
			"ABCAMAAAA7MLYKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5"+
			"ccllPAAAAEtQTFRF29vb2tra4ODg6urq5OTk4uLi6+vr7e3t7Ozs8PDw5+"+
			"fn4+Pj4eHh3d3d39/f6Ojo5eXl6enp8fHx8/Pz8vLy7+/v3Nzc2dnZ2NjY"+
			"nErj7QAAAD1JREFUeNq0wQUBACAMALDj7hf6JyUFGxzEnYhC9GaNPG1xVf"+
			"fGDErk/iCigLl1XV2xM49lfAxEaSM+AQYA9HMKuv4liFQAAAAASUVORK5C"+
			"YII=\")";
		  interProject.style.backgroundPosition="left top";
		  interProject.style.backgroundRepeat="no-repeat";
          interProject.innerHTML = '<h5>Proyek lain<\/h5><div class="pBody body" style="display:block;">'+iProject+'<\/div>';
          document.getElementById("p-tb").appendChild(interProject);
     }
 }
 addOnloadHook(iProject);
 /*  */

Penghitung suntingan[sunting sumber]

Dikarenakan Soxred93 sudah pensiun dari Wikipedia, alat penghitung suntingan bisa ditemukan di [[1]]. Jadi, ada baiknya jika kode

 function addEditcountPortlet() {
  if ( document.getElementById("t-contributions") ) {
   var sServer = 'idwiki';
   switch ( wgServer ) {
    case 'http://id.wikibooks.org':
     sServer = 'idwikibooks';
     break;
    case 'http://id.wiktionary.org':
     sServer = 'idwiktionary';
     break;
    case 'http://id.wikiquote.org':
     sServer = 'idwikiquote';
     break;
    case 'http://id.wikisource.org':
     sServer = 'idwikisource';
     break;
   }
   var sText = 'Statistik pengguna';
   var sLink = 'https://toolserver.org/~soxred93/count/index.php?&lang=id&wiki=wikipedia&uselang=id' +
    '&name=' + wgTitle;
   addPortletLink( 'p-tb', sLink, sText, 't-editcount', 
    'Jumlah suntingan pengguna', null, document.getElementById( 't-contributions' ).nextSibling );
  }
 }
 addOnloadHook( addEditcountPortlet );

diganti menjadi

 function addEditcountPortlet() {
  if ( document.getElementById("t-contributions") ) {
   var sServer = 'wikipedia';
   switch ( wgServer ) {
    case '//id.wikibooks.org':
     sServer = 'wikibooks';
     break;
    case '//id.wiktionary.org':
     sServer = 'wiktionary';
     break;
    case '//id.wikiquote.org':
     sServer = 'wikiquote';
     break;
    case '//id.wikisource.org':
     sServer = 'wikisource';
     break;
   }
   var sText = 'Statistik pengguna';
   var sLink = 'https://toolserver.org/~tparis/pcount/index.php?&lang=id&uselang=id' +
    '&wiki=' + sServer +
    '&name=' + wgTitle;
   addPortletLink( 'p-tb', sLink, sText, 't-editcount', 
    'Jumlah suntingan pengguna', null, document.getElementById( 't-contributions' ).nextSibling );
  }
 }
 addOnloadHook( addEditcountPortlet );

Give search results even when page doesn't exist[sunting sumber]

Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.
Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.

Hello, I propose to enable the tool created by Magnus Manske (creator of MediaWiki) to provide results from other languages and Commons (via Wikidata) when a page doesn't exist here: links are added to Special:Search and noarticletext. This helps to encourage translation and to make readers use your wiki more, because they can be sure to find something even if it's not local (rather than searching directly on the biggest wiki). The Italian and Polish Wikipedias, among others already enabled it by default.
Examples: [2] [3] [4]. More information: Magnus blog.
How to: just add the following line at the end of Common.js.

// Results from Wikidata
// [[File:Wdsearch_script_screenshot.png]]
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
	importScriptURI("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}

--Nemo 19 Desember 2013 08.41 (UTC) (comments, translations and last instructions)Balas

Done. Thanks. ꦱꦭꦩ꧀Bennylin diskusi 15.41, 19 Desember 2013 (WIB)

Announced JavaScript change for badges implementation[sunting sumber]

Hi! I want to let you know that in near future badges will be deployed on Wikidata and the Wikipedias. They help us with displaying the good and featured article icons next to the sitelinks and will replace the javascript hack which is used at the moment together with the Link GA and Link FA templates. To avoid an overlap where the current system and the new feature conflict, I will add a minor fix to your Common.js which adds the class names to the interwiki links. This is part of my task as a global edit interface editor for the Wikidata team. Thanks, Bene* (bicara) 18 Agustus 2014 20.26 (UTC)Balas

Sure, why not? Gombang (bicara) 20 Agustus 2014 07.01 (UTC)Balas
Thank you for implementing my request. ꦱꦭꦩ꧀Bennylin cakap 01.45, 22 Agustus 2014 (WIB)

hookEvent[sunting sumber]

Hi,

This page uses the hookEvent function. It has been deprecated since MediaWiki 1.17 (2011), and it's not supposed to do anything, or used in any code.

Now its use here causes the ContentTranslation extension, which is being deplo[y]ed [t]o this wiki, to work in a buggy way.

Can the local administrators please remove it?

Thank you! --Amir E. Aharoni (bicara) 18 Januari 2015 00.32 (UTC)Balas

Okay. I'll look into it. Thanks. ·· KℇℵℭK 18 Januari 2015 01.36 (UTC)Balas
@Kenrick95:, Bugnya bikin masalah ke "add translation", udah di remove?-AldNonUcallin?♫☎☏♬ 18 Januari 2015 11.54 (UTC)Balas
Per suntingan ini, harusnya sudah beres. ·· KℇℵℭK 18 Januari 2015 13.07 (UTC)Balas
Trims :D -AldNonUcallin?♫☎☏♬ 18 Januari 2015 13.17 (UTC)Balas
Thanks Amir, for finding out the source of the problem. ꦱꦭꦩ꧀Bennylin cakap 22.42, 18 Januari 2015 (WIB)

Breaking <charinsert>[sunting sumber]

Could the following code be removed?

// CharSubset selection
function chooseCharSubset(s) {
    var specialchars = document.getElementById('specialchars');
    if (specialchars) {
        var l = specialchars.getElementsByTagName('p'), i;
        for (i = 0; i < l.length; i++) {
            l[i].style.display = (i === s) ? 'inline' : 'none';
            // l[i].style.visibility = i == s ? 'visible' : 'hidden';
        }
    }
}
$(chooseCharSubset);

// Menu insertion
function addCharSubsetMenu() {
    var specialchars = document.getElementById('specialchars');
    if (specialchars) {
        var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
        menu += "<option>Standar+Templat</option>";
        menu += "<option>IPA</option>";
        menu += "<option>Latin</option>";
        menu += "<option>Jawa+Jawa Kuna</option>";
        menu += "<option>Pinyin+Romaji</option>";
        menu += "<option>Arab</option>";
        menu += "<option>Ibrani</option>";
        menu += "<option>Kiril</option>";
        menu += "<option>Yunani</option>";
        menu += "<option>Devanāgarī</option>";
        menu += "<option>Yiddish</option>";
        menu += "</select>";
        specialchars.innerHTML = menu + specialchars.innerHTML;

        // Standard-CharSubset
        chooseCharSubset(0);
    }
}
$(addCharSubsetMenu);

It hasn't worked correctly for many years (Since MediaWiki 1.17 the drop down box probably didn't work except on the default option). More recently it broke even with the default option. Since it has been broken for many years, I assume nobody really cares about it, and it should probably be removed. If people really do care, I can tell you how to fix it, if you want. (Ping User:Ezagren ). Bawolff (bicara) 11 Juni 2016 22.55 (UTC)Balas

To be honest, I have never used the other options (as lots of them are already available in Vector's toolbar; though few people here still use Monobook). But on the default option, I often use the list of templates there to tag articles. So, probably tell us how to fix? ·· Kℇℵ℟ℑℭK 12 Juni 2016 01.06 (UTC)Balas
To be clear, if you just remove the javascript, it will make the default option be the only option, which seems to be the state of things anyways since roughly 2010. Bawolff (bicara) 13 Juni 2016 09.03 (UTC)Balas

Deskripsi di warung kopi (bantuan)[sunting sumber]

@Kenrick95: Bagian deskripsi di Warung kopi (bantuan) sepertinya sering disalahgunakan untuk bertanya, atau disunting untuk uji coba, menurut saya lebih baik kalau fungsi hide_edit_description diubah saja menjadi "sysop". --Hidayatsrf (bicara) 14 Februari 2017 03.51 (UTC)Balas

Sebenarnya sih masalahnya cukup sering hide_edit_description gagal menyembunyikan tombol sunting entah karena apa. Jadi, untuk saat ini, dukunglah agar phab:T113902 diimplementasi. ·· Kℇℵ℟ℑℭK 14 Februari 2017 05.33 (UTC)Balas