ผู้ใช้:Passawuth/custom.js

จาก วิกิพจนานุกรม พจนานุกรมเสรี

หมายเหตุ: หลังเผยแพร่ คุณอาจต้องล้างแคชเว็บเบราว์เซอร์ของคุณเพื่อดูการเปลี่ยนแปลง

  • ไฟร์ฟอกซ์ / ซาฟารี: กด Shift ค้างขณะคลิก Reload หรือกด Ctrl-F5 หรือ Ctrl-R (⌘-R บนแมค)
  • กูเกิล โครม: กด Ctrl-Shift-R (⌘-Shift-R บนแมค)
  • อินเทอร์เน็ตเอกซ์พลอเรอร์ และ Edge: กด Ctrl ค้างขณะคลิก Refresh หรือกด Ctrl-F5
  • โอเปร่า: กด Ctrl-F5
/* <pre><noinclude> */

/*</pre>
__TOC__
== จาวาสคริปต์สำหรับการแสดง CSS insertions ==
<pre> */

if ( getCookie('WiktionaryUseJSPreferences') == 'true' ) {

// CSS Insertions

 document.write('<style>');

 if ( getCookie('WiktionaryPreferencesHideSiteNotice') == 'true' ) document.write('#siteNotice { display: none; } ');

 //ยังไม่มีปุ่มสำหรับตรงนี้...
 document.write('#bodyContent .allpagesredirect { text-decoration:line-through } \n');

 document.write('</style>');

//JavaScript insertions เพิ่มเติม (แล้วแต่เลือก)

 if ( getCookie('WiktionaryPreferencesPopUps') == 'true' ) {
    // [[w:User:Lupin/popups.js]]
    document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></' 
             + 'script>');
    } //end of popups

/*
 if ( getCookie('WiktionaryPreferencesKeyPad') == 'true' ) document.write('<script ' 
            + 'type="text/javascript" src="http://th.wiktionary.org/w/index.php?title=User:Spacebirdy' 
            + '/keypad.js&action=raw&ctype=text/javascript"><\/' 
            + 'script>');
*/
// จบ If (UsePreferences) block
}


//อาร์เรย์รูปภาพ
 enWiktPrefButtons = [] ;

/* </pre>
== ปุ่ม wiktAddButton ==
<pre> */
// สร้างปุ่ม
function wiktAddButton(cookieToToggle, speedTip) {
   var checkbox = document.createElement("input");
       checkbox.type = 'checkbox';
       checkbox.name = cookieToToggle;
       checkbox.onclick = function() {
                if ( getCookie(this.name) != 'true' ) {
                   setCookie(this.name, 'true');
                } else {
                   setCookie(this.name, 'false');
                }
	} 
       if ( 'true' == getCookie( cookieToToggle ) ) {
         checkbox.checked = true ;
        }
       var isPreferencePage = document.getElementById('isPreferencePage');
       isPreferencePage.appendChild( checkbox ); 
       if ( 'true' == getCookie( cookieToToggle ) ) {
         checkbox.checked = true ;
       }
       var text = document.createTextNode( speedTip );
       isPreferencePage.appendChild( text );
       var text = document.createElement( 'br' );
       isPreferencePage.appendChild( text );
     return true;
}

//not used just yet
function wiktAddTextBox(cookieToInput, speedTip) {
    var textbox = document.createElement("input");
        textbox.type = 'text';
        textbox.width = 10;
        textbox.name = cookieToInput;
        textbox.onchange = function() {
            setCookie(this.name, this.value);
        }
        textbox.value = getCookie( cookieToInput );
	isPreferencePage.appendChild( textbox );
        var text = document.createTextNode( speedTip );
	isPreferencePage.appendChild( text );
    return true;
}

/* </pre>
== CustomizePreferencesPage==
<pre> */

function CustomizePreferencesPage() {
   var isPreferencePage = document.getElementById('isPreferencePage');
   if ( !isPreferencePage ) return;

  //OK, so now we know we are on 
  //the Set EnglishWiktionary-specific Preferences page (or impersonation thereof)

   // http://tools.wikimedia.de/~cmackenzie/make_buttons.html
   // ตัดภาพ จนได้ขนาด 21 พิกเซล แนวตั้ง แนวนอนยังไงก็ได้

  wiktAddButton( 'WiktionaryUseJSPreferences', 'ใช้การตั้งค่าที่ถูกตั้งไว้แล้วในเว็บนี้!');

  wiktAddButton( 'WiktionaryPreferencesHideSiteNotice', 'ซ่อนประกาศของเว็บ');

  //ที่จะทำ: เพิ่มการเลือกสีสำหรับกล่อง

  // [[User:Lupin/popups.js]]
  wiktAddButton( 'WiktionaryPreferencesPopUps', 'ใช้ [[w:User:Lupin/popups.js]] (ของดั้งเดิมสำหรับวิกิพีเดีย)');

  //ดู [[MediaWiki:Monobook.js]]
  wiktAddButton( 'WiktionaryPreferencesHideNav', 'ซ่อนส่วนการแปลหรือส่วนที่คล้ายกันทั้งหมด - ค่าปริยายคือ แสดง');

  //ดู [[MediaWiki:Monobook.js]]
  wiktAddButton( 'WiktionaryPreferencesShowNav', 'แสดงส่วนการแปลหรือที่ส่วนที่คล้ายกัน - ค่าปริยายคือ แสดง');
 
  /* Allow special characters in [Search] input
  wiktAddButton( 'WiktionaryPreferencesKeyPad', 'ยังไม่สามารถใช้ความสามารถนี้ได้');
  */
}

addLoadEvent( CustomizePreferencesPage );

/* </pre> */