მედიავიკის განხილვა:Common.js

ბოლო კომენტარი: 1 წლის წინ დატოვა მომხმარებელმა DerFuchs თემაში არასწორად ამოღებული

მთავარი გვერდის სათაური რედაქტირება

რაღაც ხდება დღეს, ან ჩემი ქეშის ბრალია, კოდები გავაახლე, მაგრამ ეს ხაზი არ წაიშალა. - ალ-ო      @ 17:28, 18 თებერვალი 2009 (UTC)პასუხი

ხელის მოწერა რედაქტირება

ამ დისკუსიის საფუძველზე, დავამატე კოდი, რომელიც განხილვის გვერდების რედაქტირებისას მომხმარებელს ხელმოწერას სთხოვს. - Island 06:30, 24 ივნისი 2009 (UTC)პასუხი

მედიავიკის დასუფთავება რედაქტირება

თუ შეიძლება განმარტეთ რა ფუნქცია აქვს ამ დამატებას, სავარაუდოდ პოლონური მედიავიკიდან. თუ ადეკვატური ახსნა არ აქვს, წასაშლელია. - ალ-ო      @ 08:49, 1 ივლისი 2010 (UTC)პასუხი

/*************************************************************************************/

/* DALEKOPIS */

/*************************************************************************************/ (სკრიპტი იხ. მედიავიკის გვერდზე - დასაწყისში)

/*************************************************************************************/

/* DALEKOPIS KONIEC */

/*************************************************************************************/

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: [1] [2] [3]. 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");
}
--[[m:User:Nemo_bis|Nemo]] ~~~~~ ([[w:en:MediaWiki talk:Wdsearch.js|comments, translations and last instructions]])
</div>
<!-- EdwardsBot 0661 -->

Request for improvements რედაქტირება

Hi all,

I have been asked why there are no markers for Featured Articles and Good Articles in your list of interlanguage links. User:Deu suggested to explain details.

Looking into this MediaWiki:Common.js I detected a pile of old programming which is disturbing modern browsers, or might be unsupported by MediaWiki right now, perhaps already causing errors.

Below I put some recommendations based on a quick scrolling, but I will not change your code in detail since I am not able to test what happens with your pages, since I cannot read them.

LinkFA
The function seems to be okay (optically, I did not test).
However, I failed to see any point where this function would be called.
Insert the following lines, e.g. at the end of page:
if ( ! mw.config.get( "wgNamespaceNumber" ) ) {
   $(LinkFA);
}
(shows also how addOnloadHook() might be replaced by $() call.
Various obsolete functions and data
I found a lot of deprecated functions. Some might not work as earlier right now, some throw warning messages in debug mode and urge to replace.
See mw:ResourceLoader/JavaScript Deprecations for details.
  • addOnloadHook, hookEvent
    • It has been announced that this won't be supported any more by next major version of MW; this might happen end of April 2014, or mid 2014.
    • This needs to be replaced urgently. It might cause problems with modern browsers and hang up page presentation.
  • addPortletLink
    • mw.util.addPortletLink now
  • mwCustomEditButtons
    • Use mw.toolbar package.
  • ta
Meaningless now. Use mw.toolbar package.
  • collapse
collapseTable, createCollapseButtons
  • These functions are suported automatically by system, if properly used on pages.
  • I cannot read your pages, so I cannot decide whether you need these anywhere.
  • Remove, and wait for complaints. If problems, use state-of-the-art syntax in pages. If not possible, re-insert that code.
addLoadEvent
  • Use $(function) instead, which is an abbbreviation of jQuery(document).ready(function)
sysop
There is a new page MediaWiki:Group-sysop.js available.
  • Put any stuff specific to sysops into that page (content of MediaWiki:Sysop.js [perhaps simply move this page]) and remove sysopFunctions.
  • If current user has sysop rights, this code will be executed.
ticker_load, sajax_init_object, setTimeout
Should be replaced by mw.Api system, which gives very short code.
Would be more robust with modern browsers.
Since I can't test it for you, I won't suggest new lines.
<source>
Change source into syntaxhighlight in first and last line.

Good luck --PerfektesChaos განხილვაწვლილი 09:32, 23 მარტი 2014 (UTC) and small fix 09:41, 23 მარტი 2014 (UTC)პასუხი

დიზაინი რედაქტირება

@David1010: ეს როგორც გაკეთდა კი კარგია, სულ ურარაობას, მაგრამ რას იტყვი, ინგლისური დიზაინით, ბმულების წინ რომ იყოს ვარსკვლავები, როგორც უწინაც გვქონდა? როგორც არის ახლა რუსული დიზაინითაა, რომელიც, ინგლისურთან შედარებით, არასოდეს მომწონდა, რადგან ერთი დიდი მინუსი აქვს: თუ ენის სახელი მოკლეა, ძნელად გაარჩევ, რომელ ენას ეკუთვნის ვარსკვლავი. ძალიანაა დაშორებული. მოკლედ ასეთ რამეს გთავაზობ: </source> ამის მერე რაც წერია იმას ვშლით და ნაცვლად ამას ვწერთ:

/**

* Interwiki links to featured articles ***************************************
*
* Description: Highlights interwiki links to featured articles (or
*              equivalents) by changing the bullet before the interwiki link
*              into a star.
* Maintainers: User:R. Koot
*/

function LinkFA() {

   if ( document.getElementById( 'p-lang' ) ) {
       var InterwikiLinks = document.getElementById( 'p-lang' ).getElementsByTagName( 'li' );

       for ( var i = 0; i < InterwikiLinks.length; i++ ) {
           var className = InterwikiLinks[i].className.match(/interwiki-[-\w]+/);
           if ( document.getElementById( className + '-fa' ) ) {
               InterwikiLinks[i].className += ' FA';
               InterwikiLinks[i].title = 'ეს არის რჩეული სტატია ამ ენაზე.';
           } else if ( document.getElementById( className + '-ga' ) ) {
               InterwikiLinks[i].className += ' GA';
               InterwikiLinks[i].title = 'ეს არის კარგი სტატია ამ ენაზე.';
           }
       }
   }

}

mw.hook( 'wikipage.content' ).add( LinkFA );

(ინგლისური მედიავიკიდან ავიღე). გაცილებით მოკლე და დახვეწილი კოდიცაა. თუ რამე არ გამოვა, ძველ ვერსიაზე დაბრუნებას მხოლოდ მაუსის ერთი დაწკაპუნება ჭირდება.   რას იტყვი?— G.G. 09:59, 26 ივნისი 2014 (UTC)პასუხი

@BRUTE: @Henry McClean: @Otogi: @MIKHEIL: @Zangala: @Deu: @Jaba1977: @SHOTHA: @M.: თქვენი აზრიც მაინტერესებს ამ საკითხთან დაკავშირებით.— G.G. 10:48, 26 ივნისი 2014 (UTC)პასუხი

როგორც მახსოვს მაგ კოდმა არ იმუშავა, თუმცა ცადე მაინც იმიტომ, რომ ბევრად უკეთესია. ისე ეს რუსულიდან არ ამიღია გერმანულიდან ავიღე--დათო1010   15:02, 26 ივნისი 2014 (UTC)პასუხი
მე არ მაქვს რედაქტირების უფლება (დაცულია მხოლოდ ადმინებზე). მე გერმანულ ვიკიში იშვიათად ვიხედები, მაგრამ თუ მაქედან აიღე, მაშინ კიდევ რაღაც აქვთ სადღაც მაგათ, რადგან გერმანულშიც ვარსკვლავები ენების მაცხნივაა და არა მარჯვნივ. ისევ შენ უნდა შეგაცვლევინო, თუ არ იმუშავა, დააბრუნე უკან, არაა პრობლემა. როგორმე გადავიტანთ   პ.ს. მე ჯავასკრიპტში არ ვბწყინავ და საწინააღმდეგო არც არასდროს მიმტკიცებია, მაგრამ, ბოლო ხაზში მეპარება ეჭვი, რაღაც საერთო სურათში არ ჯდება თითქოს, მაგრამ მაგის შემდეგ უკვე Collapsed options და სხვა რაღაცები იყო და მაგიტომ მაგიანად დავაკოპირე. — G.G. 16:45, 26 ივნისი 2014 (UTC)პასუხი
ჩავსვი,მაგრამ არაფერი შეცვლილა ისევ ისეა. როგორც ჩანს ჩვენთან არის რომელიღაც მედიავიკში კიდევ რარაც შესაცვლელი--დათო1010   17:00, 26 ივნისი 2014 (UTC)პასუხი
შეცვდი ეხლა ისევ გაქრა ვარსკვლავები, ამიტომ დავაბრუნებ ძველს--დათო1010   17:02, 26 ივნისი 2014 (UTC)პასუხი
ამ წუთას ორივე მხარეს იყო....— G.G. 17:29, 26 ივნისი 2014 (UTC)პასუხი
მორჩა ყველაფერი   გავასწორე :)--დათო1010   17:34, 26 ივნისი 2014 (UTC)პასუხი

მე როგორც ინგლისურ ვიკიპედიაშია ისე მომწონს, უფრო წვრილიცაა და უფრო ლამაზად ჯდება ვარსკვლავები. რაც მთავარია არც ერთ შემთხვევაში არ მახინჯდება. ასე ჯობია. კიდევ, ერთი, @ITshnik: @David1010: ეგებ სამუშაო თარგებიც ავამუშავოთ რამენაირად ?. - ოთოჯი განხილვა 17:39, 26 ივნისი 2014 (UTC)პასუხი

ვეცდები. ბულგარულში მუშაობს ჩვეულებრივად და ჩვენთან ნეტა რატომ გაქრა--დათო1010   17:41, 26 ივნისი 2014 (UTC)პასუხი
არადა რაოდენ გვიადვილებდა სამუშაოს ეს სამუშაოს გამზადებული თარგები... მეტად საჭიროა. - ოთოჯი განხილვა 17:46, 26 ივნისი 2014 (UTC)პასუხი
გაიხარე დავით!   აი, როგორ იყო წეღან: 1. სამუშაო თარგებიც ამ მედიავიკიშია და, როგორც ჩანს, რაცღაც სხვა კოდთან მოდის კონფლიქტში. User:Borislav/toolbar.js აქ არის მაგ თარგების ორიგინალი კოდი ბულგარელი ვიკიპედიელისგან, წინაპირობა, რომ სამუშაო თარგებმა იმუშავოს. დანარჩენი ამ მედიავიკის ქვეგვერდებზეა. ეგ კოდი ამ მედიავიკიშიც არის, მაგრამ რაღაცა უშლის ხელს მუშაობაში, ძალიან მგრძნობიარე კოდია, ერთი მძიმეც რომ არ იჯდეს საჭირო ადგილას, არ უშაობს, პირადი გამოცდილებიდან ვიცი (როცა ადმინი ვიყავი). დანარჩენი შენც იცი, დავით. — G.G. 18:06, 26 ივნისი 2014 (UTC)პასუხი
ცნობისათვის: ინგლისური მედიავიკის თავში წერია ასეთი რამ: „Keep code in MediaWiki:Common.js to a minimum“, რადგანაცო „it is unconditionally loaded for all users on every wiki page“ თუ შესაძლებელია, გაჯეტები შექმენითო და ა.შ. ამის გათვალისწინებით, ჩვენ „საგმირო საქმეც“ კი ჩავიდინეთ კოდის გამარტივებით.  G.G. 18:32, 26 ივნისი 2014 (UTC)პასუხი
ისე იქით იყოს, და რაღაც შრიფტის ფერია გამკრთალი, არა ?. - ოთოჯი განხილვა 19:21, 26 ივნისი 2014 (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* განხილვაწვლილი 19:16, 11 აგვისტო 2014 (UTC)პასუხი

Donations რედაქტირება

Hello, I propose to remove the entire block after "IE 6 Z-index bug workaround for anonnotice". Those donation notices are superseded and English-only banners in non-English wikis are both useless and harmful for Wikimedia and its finances. In fact, they make Wikipedia slower for unregistered users, so they cost more money than they bring, because the WMF has to spend millions on mw:Site performance. The WMF already runs banners for all the money they need, such permanent banners are inefficient. --Nemo bis განხილვაწვლილი 12:10, 13 თებერვალი 2015 (UTC)პასუხი

Suggested fix for Content Translation რედაქტირება

Hi,

There's a bug here, which prevents the ContentTranslation extension from being used. It was reported at mw:Topic:Tf11e5q6xsjh78pq.

To fix it, please edit the ImageGroup function. Its beginning should look like this:

function ImageGroup(){
	if (document.URL.match(/printable/g)) return;
	var bc=document.getElementById("bodyContent");
	if ( bc === null ) {
		return;
	}
	var divs=bc.getElementsByTagName("div");
	var i = 0, j = 0;

Thank you! --ამირ ე. აჰარონი განხილვაწვლილი 11:39, 27 ნოემბერი 2016 (UTC)პასუხი

@Amire80: Done--დათო1010 11:44, 27 ნოემბერი 2016 (UTC)პასუხი

არასწორად ამოღებული რედაქტირება

@DerFuchs გთხოვ, ეს დააბრუნე უკან. გიო ოქრო 11:36, 30 ოქტომბერი 2022 (UTC)პასუხი

  გაკეთდა DerFuchs მიწერა 16:53, 30 ოქტომბერი 2022 (UTC)პასუხი
გვერდ „Common.js“-ზე დაბრუნება.