summaryrefslogtreecommitdiff
path: root/resources/mediawiki.action
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /resources/mediawiki.action
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'resources/mediawiki.action')
-rw-r--r--resources/mediawiki.action/mediawiki.action.edit.js2
-rw-r--r--resources/mediawiki.action/mediawiki.action.edit.preview.js6
-rw-r--r--resources/mediawiki.action/mediawiki.action.history.diff.css80
-rw-r--r--resources/mediawiki.action/mediawiki.action.history.js2
-rw-r--r--resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js14
-rw-r--r--resources/mediawiki.action/mediawiki.action.view.postEdit.js15
-rw-r--r--resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js14
7 files changed, 69 insertions, 64 deletions
diff --git a/resources/mediawiki.action/mediawiki.action.edit.js b/resources/mediawiki.action/mediawiki.action.edit.js
index 1c51c974..2835c9cc 100644
--- a/resources/mediawiki.action/mediawiki.action.edit.js
+++ b/resources/mediawiki.action/mediawiki.action.edit.js
@@ -71,7 +71,7 @@
* Apply tagOpen/tagClose to selection in textarea,
* use sampleText instead of selection if there is none.
*/
- insertTags: function ( tagOpen, tagClose, sampleText, selectText ) {
+ insertTags: function ( tagOpen, tagClose, sampleText ) {
if ( currentFocused && currentFocused.length ) {
currentFocused.textSelection(
'encapsulateSelection', {
diff --git a/resources/mediawiki.action/mediawiki.action.edit.preview.js b/resources/mediawiki.action/mediawiki.action.edit.preview.js
index cddf6ccf..602aadb0 100644
--- a/resources/mediawiki.action/mediawiki.action.edit.preview.js
+++ b/resources/mediawiki.action/mediawiki.action.edit.preview.js
@@ -102,6 +102,12 @@
}
$( document ).ready( function () {
+ // Do not enable on user .js/.css pages, as there's no sane way of "previewing"
+ // the scripts or styles without reloading the page.
+ if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length ) {
+ return;
+ }
+
// The following elements can change in a preview but are not output
// by the server when they're empty until the preview reponse.
// TODO: Make the server output these always (in a hidden state), so we don't
diff --git a/resources/mediawiki.action/mediawiki.action.history.diff.css b/resources/mediawiki.action/mediawiki.action.history.diff.css
index 10473be7..31ca1078 100644
--- a/resources/mediawiki.action/mediawiki.action.history.diff.css
+++ b/resources/mediawiki.action/mediawiki.action.history.diff.css
@@ -1,8 +1,36 @@
/*
** Diff rendering
*/
-table.diff, td.diff-otitle, td.diff-ntitle {
+table.diff {
background-color: white;
+ border: none;
+ border-spacing: 4px;
+ margin: 0;
+ width: 100%;
+ /* Ensure that colums are of equal width */
+ table-layout: fixed;
+}
+
+table.diff td {
+ padding: 0.33em 0.5em;
+}
+
+table.diff td.diff-marker {
+ /* Compensate padding for increased font-size */
+ padding: 0.25em;
+}
+
+table.diff col.diff-marker {
+ width: 2%;
+}
+
+table.diff col.diff-content {
+ width: 48%;
+}
+
+table.diff td div {
+ /* Force-wrap very long lines such as URLs or page-widening char strings */
+ word-wrap: break-word;
}
td.diff-otitle,
@@ -10,14 +38,14 @@ td.diff-ntitle {
text-align: center;
}
-td.diff-marker {
- text-align: right;
+td.diff-lineno {
font-weight: bold;
- font-size: 1.25em;
}
-td.diff-lineno {
+td.diff-marker {
+ text-align: right;
font-weight: bold;
+ font-size: 1.25em;
}
td.diff-addedline,
@@ -27,10 +55,6 @@ td.diff-context {
vertical-align: top;
white-space: -moz-pre-wrap;
white-space: pre-wrap;
-}
-
-td.diff-addedline,
-td.diff-deletedline {
border-style: solid;
border-width: 1px 1px 1px 4px;
border-radius: 0.33em;
@@ -45,12 +69,9 @@ td.diff-deletedline {
}
td.diff-context {
- background: #f3f3f3;
- color: #333333;
- border-style: solid;
- border-width: 1px 1px 1px 4px;
+ background: #f9f9f9;
border-color: #e6e6e6;
- border-radius: 0.33em;
+ color: #333333;
}
.diffchange {
@@ -58,15 +79,6 @@ td.diff-context {
text-decoration: none;
}
-table.diff {
- border: none;
- width: 98%;
- border-spacing: 4px;
-
- /* Ensure that colums are of equal width */
- table-layout: fixed;
-}
-
td.diff-addedline .diffchange,
td.diff-deletedline .diffchange {
border-radius: 0.33em;
@@ -80,25 +92,3 @@ td.diff-addedline .diffchange {
td.diff-deletedline .diffchange {
background: #feeec8;
}
-
-table.diff td {
- padding: 0.33em 0.66em;
-}
-
-table.diff col.diff-marker {
- width: 2%;
-}
-
-table.diff col.diff-content {
- width: 48%;
-}
-
-table.diff td div {
- /* Force-wrap very long lines such as URLs or page-widening char strings.*/
- word-wrap: break-word;
-
- /* As fallback (FF<3.5, Opera <10.5), scrollbars will be added for very wide cells
- instead of text overflowing or widening
- */
- overflow: auto;
-}
diff --git a/resources/mediawiki.action/mediawiki.action.history.js b/resources/mediawiki.action/mediawiki.action.history.js
index 55f799e5..e9d320c1 100644
--- a/resources/mediawiki.action/mediawiki.action.history.js
+++ b/resources/mediawiki.action/mediawiki.action.history.js
@@ -119,7 +119,7 @@ jQuery( document ).ready( function ( $ ) {
e.preventDefault();
return false; // Because the submit is special, return false as well.
}
-
+
// Continue natural browser handling other wise
return true;
} );
diff --git a/resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js b/resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js
index 7a9ceee5..727a5251 100644
--- a/resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js
+++ b/resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js
@@ -1,14 +1,12 @@
/**
- * This module enables double-click-to-edit functionality
+ * This module enables double-click-to-edit functionality.
*/
( function ( mw, $ ) {
$( function () {
- var url = $( '#ca-edit a' ).attr( 'href' );
- if ( url ) {
- mw.util.$content.dblclick( function ( e ) {
- e.preventDefault();
- window.location = url;
- } );
- }
+ mw.util.$content.dblclick( function ( e ) {
+ e.preventDefault();
+ // Trigger native HTMLElement click instead of opening URL (bug 43052)
+ $( '#ca-edit a' ).get( 0 ).click();
+ } );
} );
}( mediaWiki, jQuery ) );
diff --git a/resources/mediawiki.action/mediawiki.action.view.postEdit.js b/resources/mediawiki.action/mediawiki.action.view.postEdit.js
new file mode 100644
index 00000000..a11233fa
--- /dev/null
+++ b/resources/mediawiki.action/mediawiki.action.view.postEdit.js
@@ -0,0 +1,15 @@
+( function ( mw, $ ) {
+ // Only a view can be a post-edit.
+ if ( mw.config.get( 'wgAction' ) !== 'view' ) {
+ return;
+ }
+
+ // Matches EditPage::POST_EDIT_COOKIE_KEY_PREFIX
+ var cookieKey = mw.config.get( 'wgCookiePrefix' ) + 'PostEditRevision' + mw.config.get( 'wgCurRevisionId' );
+
+ if ( $.cookie( cookieKey ) === '1' ) {
+ // We just saved this page
+ $.cookie( cookieKey, null, { path: '/' } );
+ mw.config.set( 'wgPostEdit', true );
+ }
+} ( mediaWiki, jQuery ) );
diff --git a/resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js b/resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js
index d02d4327..61d9d150 100644
--- a/resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js
+++ b/resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js
@@ -1,4 +1,4 @@
-/*
+/**
* JavaScript to enable right click edit functionality.
* When the user right-clicks in a heading, it will open the
* edit screen.
@@ -8,23 +8,19 @@ jQuery( function ( $ ) {
// Don't use the ":has:(.editsection a)" selector because it performs very bad.
// http://jsperf.com/jq-1-7-2-vs-jq-1-8-1-performance-of-mw-has/2
$( document ).on( 'contextmenu', 'h1, h2, h3, h4, h5, h6', function ( e ) {
- var $edit, href;
-
- $edit = $( this ).find( '.editsection a' );
+ var $edit = $( this ).find( '.editsection a' );
if ( !$edit.length ) {
return;
}
- // Get href of the editsection link
- href = $edit.prop( 'href' );
-
// Headings can contain rich text.
// Make sure to not block contextmenu events on (other) anchor tags
// inside the heading (e.g. to do things like copy URL, open in new tab, ..).
// e.target can be the heading, but it can also be anything inside the heading.
- if ( href && e.target.nodeName.toLowerCase() !== 'a' ) {
- window.location = href;
+ if ( e.target.nodeName.toLowerCase() !== 'a' ) {
+ // Trigger native HTMLElement click instead of opening URL (bug 43052)
e.preventDefault();
+ $edit.get( 0 ).click();
}
} );
} );