MediaWiki討論:Common.js/存檔2

{{editprotect}} 提議將:

button=createElement("span",[textS,textH],{'class':'NavToggle',styles:{'width':"3.8em"}});

改成:

button=createElement("span",[textS,textH],{'class':'NavToggle',styles:{'width':"6em"}});

原因詳見Wikipedia:互助客棧/技術/存檔/2011年1月#Navbox標題偏右問題。 --Quest for Truth (留言) 2011年1月31日 (一) 21:37 (UTC)

照著改了但沒認真看,若有其他副作用再另外處理。Liangent (留言) 2011年2月3日 (四) 15:48 (UTC)

自動摺疊功能

隨著升級到1.17版,左側導航欄已經有了摺疊功能,那麼能否頁面中使用的摺疊功能在顯示效果上與左側導航欄保持視覺上的一致性呢?commons就是如此做的,見測試效果:[1],希望中文版也能改善--百無一用是書生 () 2011年2月21日 (一) 08:22 (UTC)

應該在互助客棧討論議定後修改吧。--用心閣(對話頁) 2011年3月16日 (三) 03:26 (UTC)

Give search results even when page doesn't exist

 
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 2013年12月14日 (六) 10:59 (UTC) (comments, translations and last instructions)

Great to see zh.wiki onboard! And sorry for the unclosed pre above. --Nemo bis留言2013年12月14日 (六) 10:59 (UTC)

hookEvent 和 addOnloadHook are deprecated

{{editprotected}}

因為現在addOnloadHook和hookEvent已經不建議使用了,能不能將本頁中的

addOnloadHook(MetaCaixaInit);

換成

$(MetaCaixaInit);

然後

hookEvent("load", function () {
if (location.hash) {
location.href = location.hash;
}
});

這個我不知道換成什麼,但是反正要改成jQuery啦。

以上,Chmarkine留言2014年3月19日 (三) 02:13 (UTC)

(~)補充mw.util.wikiGetlink( 'Wikipedia:维基百科语言列表' ), 是不是該改成
mw.util.getUrl( 'Wikipedia:维基百科语言列表' ),
--Chmarkine留言2014年3月19日 (三) 02:26 (UTC)
「補充」的已改。然後還是說引用自別處的代碼除非現在突然不工作了,或者上游不維護了,否則請去上游報告,然後回來要求從上游更新。Liangent留言 2014年3月22日 (六) 13:28 (UTC)
明白,謝謝!--Chmarkine留言2014年3月22日 (六) 20:57 (UTC)

Announced JavaScript change for badges implementation

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*留言2014年8月18日 (一) 20:32 (UTC)

返回 "Common.js/存档2" 頁面。