r75797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75796‎ | r75797 | r75798 >
Date:15:53, 1 November 2010
Author:krinkle
Status:ok
Tags:
Comment:
Follow-up r75762; deleted rightclickedit.js
* Removed now obsolete mediawiki.legacy.rightclickedit. Replaced by mediawiki.advanced.rightclickedit r 75762
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/common/rightclickedit.js (deleted) (history)

Diff [purge]

Index: trunk/phase3/skins/common/rightclickedit.js
@@ -1,46 +0,0 @@
2 -window.setupRightClickEdit = function() {
3 - if (document.getElementsByTagName) {
4 - var spans = document.getElementsByTagName('span');
5 - for (var i = 0; i < spans.length; i++) {
6 - var el = spans[i];
7 - if(el.className == 'editsection') {
8 - addRightClickEditHandler(el);
9 - }
10 - }
11 - }
12 -}
13 -
14 -window.addRightClickEditHandler = function(el) {
15 - for (var i = 0; i < el.childNodes.length; i++) {
16 - var link = el.childNodes[i];
17 - if (link.nodeType == 1 && link.nodeName.toLowerCase() == 'a') {
18 - var editHref = link.getAttribute('href');
19 - // find the enclosing (parent) header
20 - var prev = el.parentNode;
21 - if (prev && prev.nodeType == 1 &&
22 - prev.nodeName.match(/^[Hh][1-6]$/)) {
23 - prev.oncontextmenu = function(e) {
24 - if (!e) { e = window.event; }
25 - // e is now the event in all browsers
26 - var targ;
27 - if (e.target) { targ = e.target; }
28 - else if (e.srcElement) { targ = e.srcElement; }
29 - if (targ.nodeType == 3) { // defeat Safari bug
30 - targ = targ.parentNode;
31 - }
32 - // targ is now the target element
33 -
34 - // We don't want to deprive the noble reader of a context menu
35 - // for the section edit link, do we? (Might want to extend this
36 - // to all <a>'s?)
37 - if (targ.nodeName.toLowerCase() != 'a'
38 - || targ.parentNode.className != 'editsection') {
39 - document.location = editHref;
40 - return false;
41 - }
42 - return true;
43 - };
44 - }
45 - }
46 - }
47 -}
\ No newline at end of file
Index: trunk/phase3/resources/Resources.php
@@ -468,10 +468,6 @@
469469 'scripts' => 'skins/common/protect.js',
470470 'dependencies' => 'mediawiki.legacy.wikibits',
471471 ) ),
472 - 'mediawiki.legacy.rightclickedit' => new ResourceLoaderFileModule( array(
473 - 'scripts' => 'skins/common/rightclickedit.js',
474 - 'dependencies' => 'mediawiki.legacy.wikibits',
475 - ) ),
476472 'mediawiki.legacy.search' => new ResourceLoaderFileModule( array(
477473 'scripts' => 'skins/common/search.js',
478474 'styles' => 'skins/common/search.css',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75762Adding mediawiki.advanced.rightclickedit.js...krinkle23:42, 31 October 2010

Status & tagging log