MediaWiki:Common.js
Материал из MachineLearning.
(Различия между версиями)
(убрал wiked из основного скрипта - wiked пользователь сможет себе установить сам. При этом объем первоначальной загрузки сущесьвенно уменьша) |
|||
| Строка 4: | Строка 4: | ||
if (wgAction == 'edit' || wgAction == 'submit') | if (wgAction == 'edit' || wgAction == 'submit') | ||
document.write('<script type="text/javascript" src="/wiki/index.php?title=MediaWiki:Editpage.js&action=raw&ctype=text/javascript"><\/script>') | document.write('<script type="text/javascript" src="/wiki/index.php?title=MediaWiki:Editpage.js&action=raw&ctype=text/javascript"><\/script>') | ||
| + | } | ||
| + | |||
| + | |||
| + | //CleanChanges | ||
| + | /* | ||
| + | * Adapted from monobook, with possibility to set display to block or inline. | ||
| + | */ | ||
| + | function toggleVisibilityE(_levelId, _otherId, _linkId, _type) { | ||
| + | var thisLevel = document.getElementById(_levelId); | ||
| + | var otherLevel = document.getElementById(_otherId); | ||
| + | var linkLevel = document.getElementById(_linkId); | ||
| + | if (thisLevel.style.display == 'none') { | ||
| + | thisLevel.style.display = _type; | ||
| + | otherLevel.style.display = 'none'; | ||
| + | linkLevel.style.display = 'inline'; | ||
| + | } else { | ||
| + | thisLevel.style.display = 'none'; | ||
| + | otherLevel.style.display = 'inline'; | ||
| + | linkLevel.style.display = 'none'; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | /* | ||
| + | * Simple function to add user information inline. | ||
| + | */ | ||
| + | function showUserInfo( sourceVar, targetId ) { | ||
| + | var targetElement = document.getElementById(targetId); | ||
| + | targetElement.innerHTML = eval( sourceVar ); | ||
} | } | ||
Версия 00:00, 21 июня 2008
/* Размещённый здесь код JavaScript будет загружен всем пользователям при обращении к какой-либо странице */ if (wgAction != 'history'){ if (wgAction == 'edit' || wgAction == 'submit') document.write('<script type="text/javascript" src="/wiki/index.php?title=MediaWiki:Editpage.js&action=raw&ctype=text/javascript"><\/script>') } //CleanChanges /* * Adapted from monobook, with possibility to set display to block or inline. */ function toggleVisibilityE(_levelId, _otherId, _linkId, _type) { var thisLevel = document.getElementById(_levelId); var otherLevel = document.getElementById(_otherId); var linkLevel = document.getElementById(_linkId); if (thisLevel.style.display == 'none') { thisLevel.style.display = _type; otherLevel.style.display = 'none'; linkLevel.style.display = 'inline'; } else { thisLevel.style.display = 'none'; otherLevel.style.display = 'inline'; linkLevel.style.display = 'none'; } } /* * Simple function to add user information inline. */ function showUserInfo( sourceVar, targetId ) { var targetElement = document.getElementById(targetId); targetElement.innerHTML = eval( sourceVar ); }

