Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

User:Mattflaschen/Compare link.js

    From Wikipedia, the free encyclopedia
    <User:Mattflaschen
    Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at theappropriate village pump.
    This codewill be executed when previewing this page.
    Documentation for thisuser script can be added atUser:Mattflaschen/Compare link.
    Note: After saving, you have to bypass your browser's cache to see the changes.Google Chrome,Firefox,Microsoft Edge andSafari: Hold down the⇧ Shift key and click theReload toolbar button. For details and instructions about other browsers, seeWikipedia:Bypass your cache.
    /** * Convert the "Compare selected versions" button to a link * (Based on [[w:en:User:Superm401/Compare_link.js]]) * @source: http://www.mediawiki.org/wiki/Snippets/Compare_link * @rev: 2 * @see: [[bugzilla:16165]] * * Copyright 2006-2013 Matthew Flaschen ([[User:Superm401]]), [[User:Helder.wiki]] * * In addition to the GFDL and CC-BY-SA: * * This function (compare link) is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This function is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * A copy of the GPL is available at https://www.gnu.org/licenses/gpl-2.0.txt . * * By modifying [[Snippets/Compare_link]]: * You agree to dual-license your contributions under both the * GFDL (http://en.wikipedia.org/wiki/WP:GFDL) and version 2 of the GPL * (https://www.gnu.org/licenses/gpl-2.0.txt) or any later version * of the GPL published by the FSF. * */functionfixCompare(){var$histForm=$('#mw-history-compare'),$diffList=$('#pagehistory'),$buttons=$histForm.find('input.historysubmit'),buttonText,$compareLink;if($buttons.length===0){// Only one version, so do nothingreturn;}buttonText=$buttons.remove().first().val();$compareLink=$('<a></a>',{'class':'compare-link','text':buttonText});$histForm.prepend($compareLink).append($compareLink.clone());varupdateCompare=function(){var$radio=$histForm.find('input[type=radio]:checked'),genLink=mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+'&diff='+$radio.eq(0).val()+'&oldid='+$radio.eq(1).val();$('.compare-link').each(function(){$(this).attr('href',genLink);});};updateCompare();$diffList.change(updateCompare);}if(mw.config.get('wgAction')==='history'){mw.util.addCSS('.compare-link { border-radius:5px; color:black; text-decoration:none; border-width:1px 2px 2px 1px; border-style:solid; border-color:#DDDDDD #BBBBBB #BBBBBB #DDDDDD; padding:0.2em 1em; background-color:#EEEEEE; white-space:nowrap; } .compare-link:active{ border-width:0.1em; margin:0.1em; }');$(fixCompare);}
    Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Mattflaschen/Compare_link.js&oldid=658679284"

    [8]ページ先頭

    ©2009-2025 Movatter.jp