MediaWiki talk:Common.js/存档2

Navbox標題偏右問題

{{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”页面。