Pengguna:Kenrick95/common.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Kenrick95 (bicara | kontrib)
kTidak ada ringkasan suntingan
Kenrick95 (bicara | kontrib)
Tidak ada ringkasan suntingan
Baris 112:
== CollapsibleTable ==*/
var autoCollapse = 2;
var collapseCaption = 'hidesembunyikan';
var expandCaption = 'showtampilkan';
window.collapseTable = function ( tableIndex ) {
Baris 194:
$( createCollapseButtons );
/**
/* End of CollapsibleTable */
/* * Dynamic Navigation Bars (experimental) *************************************
/** Dynamic Navigation Bars (experimental) *************************************
*
* Description: See [[Wikipedia:NavFrame]].
* Maintainers: UNMAINTAINED
*/
//* set up the words in your language */
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';
/**
// * showsShows and hides content and picture (if available) of navigation bars
// * Parameters:
// indexNavigationBar: the index of navigation bar to be toggled
function * toggleNavigationBar(indexNavigationBar): the index of navigation bar to be toggled
**/
{
window.toggleNavigationBar = function ( indexNavigationBar ) {
var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
var NavFrameNavToggle = document.getElementById("NavFrame" 'NavToggle' + indexNavigationBar );
var NavToggleNavFrame = document.getElementById("NavToggle" 'NavFrame' + indexNavigationBar );
if ( !NavFrame || !NavToggle ) {
return false;
}
//* if shown now */
if ( NavToggle.firstChild.data == NavigationBarHide ) {
for ( var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
if (hasClass $( NavChild, ).hasClass( 'NavContent' ) || hasClass$( NavChild, ).hasClass( 'NavPic' ) ) {
NavChild.style.display = 'none';
}
Baris 227:
NavToggle.firstChild.data = NavigationBarShow;
//* if hidden now */
} else if ( NavToggle.firstChild.data == NavigationBarShow ) {
for ( var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
if (hasClass $( NavChild, ).hasClass( 'NavContent' ) || hasClass$( NavChild, ).hasClass( 'NavPic' ) ) {
NavChild.style.display = 'block';
}
Baris 238:
}
//* adds show/hide-button to navigation bars */
function createNavigationBarToggleButton() {
{
var indexNavigationBar = 0;
//* iterate over all < div >-elements */
var divs = document.getElementsByTagName(" 'div"' );
for ( var i = 0; NavFrame = divs[i]; i++ ) {
//* if found a navigation bar */
if (hasClass $( NavFrame, ").hasClass( 'NavFrame"' ) ) {
indexNavigationBar++;
var NavToggle = document.createElement(" 'a"' );
NavToggle.className = 'NavToggle';
NavToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );
NavToggle.setAttribute( 'href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');' );
var isCollapsed = hasClass$( NavFrame, ").hasClass( 'collapsed"' );
/**
* Check if any children are already hidden. This loop is here for backwards compatibility:
* the old way of making NavFrames start out collapsed was to manually add style="display:none"
Baris 262 ⟶ 261:
* "collapsed" to the NavFrame itself, just like with collapsible tables.
*/
for ( var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling ) {
if ( hasClass$( NavChild, ).hasClass( 'NavPic' ) || hasClass$( NavChild, ).hasClass( 'NavContent' ) ) {
if ( NavChild.style.display == 'none' ) {
isCollapsed = true;
Baris 269 ⟶ 268:
}
}
if ( isCollapsed ) {
for ( var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
if ( hasClass$( NavChild, ).hasClass( 'NavPic' ) || hasClass$( NavChild, ).hasClass( 'NavContent' ) ) {
NavChild.style.display = 'none';
}
}
}
var NavToggleText = document.createTextNode( isCollapsed ? NavigationBarShow : NavigationBarHide );
NavToggle.appendChild( NavToggleText );
//* Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) */
for( var j = 0; j < NavFrame.childNodes.length; j++ ) {
if (hasClass $( NavFrame.childNodes[j], ").hasClass( 'NavHead"' ) ) {
NavToggle.style.color = NavFrame.childNodes[j].appendChild(NavToggle)style.color;
NavFrame.childNodes[j].appendChild( NavToggle );
}
}
NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
}
}
}
addOnloadHook$( createNavigationBarToggleButton );
 
/**
== Edittools ==
Baris 300:
//de.wiki-indonesia.club/wiki/MediaWiki:Onlyifediting.js and
//en.wiktionary.org/wiki/MediaWiki:Monobook.js
*/
<pre><nowiki> */
function addCharSubsetMenu() {
if ( load_edittools != true ) return;
var specialchars = document.getElementById('specialchars');
if (specialchars) {
var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
Baris 360 ⟶ 358:
}
}
/* </nowiki></pre> */
/**
Baris 368 ⟶ 365:
[[Bantuan:Tabel|Tabel cantik]] */
 
if (LoadStripe == true) {
var stripe = function()
{
Baris 426 ⟶ 422:
// Perform the striping.
hookEvent("load", stripe);
}
/**
== ExtraEditButtons ==
-> Tidak jalan untuk kulit Vector
<pre><nowiki> */
*/
function addCustomEditButton( imageFile, speedTip, tagOpen, tagClose, sampleText ) {
var imagePath = '//upload.wikimedia.org/wikipedia/commons/';
Baris 514 ⟶ 509:
"&nbsp;", "", "" );
}
/*</nowiki></pre>*/
/**
Baris 550 ⟶ 544:
=== Sunting bagian 0 ===
*/
function addPortletLink( PLplace, PLlink, PLtext, PLid, PLtitle) {
var PLtempplace="#"+PLplace;
var PLinside = '<a id="' + PLid + '" title="' + PLtitle + '" href="'+ PLlink +'"> ' + PLtext + '</div>';
$(PLtempplace).append();
}
function addEdittopPortletLink() {
if(wgCanonicalNamespace == 'Special') return;