jenkins-bot has submitted this change and it was merged.
Change subject: Remove previewDialog
......................................................................
Remove previewDialog
This was never launched, and is no longer working either.
Change-Id: Ic49e84b8a91da701673949a8d441c788a4feaa22
---
M WikiEditor.hooks.php
M WikiEditor.php
M i18n/en.json
M i18n/qqq.json
D modules/ext.wikiEditor.previewDialog.js
D modules/jquery.wikiEditor.previewDialog.css
D modules/jquery.wikiEditor.previewDialog.js
7 files changed, 0 insertions(+), 220 deletions(-)
Approvals:
GOIII: Looks good to me, but someone else must approve
Bartosz Dziewoński: Looks good to me, approved
jenkins-bot: Verified
diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index 9226baa..71ffdaa 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -84,21 +84,6 @@
'ext.wikiEditor.preview',
),
),
- 'previewDialog' => array(
- 'preferences' => array(
- 'wikieditor-previewDialog' => array(
- 'type' => 'toggle',
- 'label-message' =>
'wikieditor-previewDialog-preference',
- 'section' => 'editing/labs',
- ),
- ),
- 'requirements' => array(
- 'wikieditor-previewDialog' => true,
- ),
- 'modules' => array(
- 'ext.wikiEditor.previewDialog',
- ),
- ),
'publish' => array(
'preferences' => array(
'wikieditor-publish' => array(
diff --git a/WikiEditor.php b/WikiEditor.php
index df36911..4d3afc9 100644
--- a/WikiEditor.php
+++ b/WikiEditor.php
@@ -30,8 +30,6 @@
// Adds a tab for previewing in-line
'preview' => array( 'global' => false, 'user' => true ),
- // Adds a button for previewing in a dialog
- 'previewDialog' => array( 'global' => false, 'user' => false ),
// Adds a button and dialog for step-by-step publishing
'publish' => array( 'global' => false, 'user' => true ),
);
@@ -118,14 +116,6 @@
'scripts' => 'jquery.wikiEditor.preview.js',
'styles' => 'jquery.wikiEditor.preview.css',
'dependencies' => 'jquery.wikiEditor',
- ),
- 'jquery.wikiEditor.previewDialog' => $wikiEditorTpl + array(
- 'scripts' => 'jquery.wikiEditor.previewDialog.js',
- 'styles' => 'jquery.wikiEditor.previewDialog.css',
- 'dependencies' => array(
- 'jquery.wikiEditor',
- 'jquery.wikiEditor.dialogs',
- ),
),
'jquery.wikiEditor.publish' => $wikiEditorTpl + array(
'scripts' => 'jquery.wikiEditor.publish.js',
@@ -382,18 +372,6 @@
'wikieditor-preview-tab',
'wikieditor-preview-changes-tab',
'wikieditor-preview-loading',
- ),
- ),
- 'ext.wikiEditor.previewDialog' => $wikiEditorTpl + array(
- 'scripts' => 'ext.wikiEditor.previewDialog.js',
- 'dependencies' => array(
- 'ext.wikiEditor',
- 'jquery.wikiEditor.previewDialog',
- ),
- 'messages' => array(
- 'wikieditor-previewDialog-preference',
- 'wikieditor-previewDialog-tab',
- 'wikieditor-previewDialog-loading',
),
),
'ext.wikiEditor.publish' => $wikiEditorTpl + array(
diff --git a/i18n/en.json b/i18n/en.json
index 5d4ae47..221bde5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -12,9 +12,6 @@
"wikieditor-preview-tab": "Preview",
"wikieditor-preview-changes-tab": "Changes",
"wikieditor-preview-loading": "Loading...",
- "wikieditor-previewDialog-preference": "Enable preview dialog",
- "wikieditor-previewDialog-tab": "Preview",
- "wikieditor-previewDialog-loading": "Loading...",
"wikieditor-publish-preference": "Enable step-by-step publishing",
"wikieditor-publish-button-publish": "Publish",
"wikieditor-publish-button-cancel": "Cancel",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 0451dee..bb4beec 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -30,8 +30,6 @@
"wikieditor-preview-tab": "Caption of the tab containing the
preview\n\n{{Identical|Preview}}",
"wikieditor-preview-changes-tab": "Caption of the tab containing a diff
of the user's changes, à la ''{{int:Showdiff}}''
({{msg-mw|Showdiff|notext=1}}).\n\n{{Identical|Change}}",
"wikieditor-preview-loading": "Alt text for spinner displayed while
preview is being loaded\n{{Identical|Loading}}",
- "wikieditor-previewDialog-tab": "Caption of the tab containing the
preview\n\n{{Identical|Preview}}",
- "wikieditor-previewDialog-loading": "Alt text for spinner displayed
while preview is being loaded\n{{Identical|Loading}}",
"wikieditor-publish-preference": "Option in [[Special:Preferences]],
tab ''{{int:prefs-editing}}''",
"wikieditor-publish-button-publish": "Button to the right of the
Edit/Preview tabs that opens a dialog window that lets the user save their
edit\n\n{{Identical|Publish}}",
"wikieditor-publish-button-cancel": "Button to the right of the
Edit/Preview tabs that has the same effect as the {{msg-mw|Cancel}} link below
the edit box.\n\n{{Identical|Cancel}}",
diff --git a/modules/ext.wikiEditor.previewDialog.js
b/modules/ext.wikiEditor.previewDialog.js
deleted file mode 100644
index 3b1acd7..0000000
--- a/modules/ext.wikiEditor.previewDialog.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * JavaScript for WikiEditor Preview Dialog
- */
-jQuery( document ).ready( function ( $ ) {
- // Add preview module
- $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'previewDialog' );
-} );
diff --git a/modules/jquery.wikiEditor.previewDialog.css
b/modules/jquery.wikiEditor.previewDialog.css
deleted file mode 100644
index f66773b..0000000
--- a/modules/jquery.wikiEditor.previewDialog.css
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * CSS for WikiEditor Preview Dialog jQuery plugin
- */
-
-/* FIXME: This only works for the first wikiEditor on the page! */
-#wikiEditor-0-preview-dialog .wikiEditor-ui-loading {
- background: #f3f3f3;
- z-index: 10;
- position: absolute;
- left: 0;
- text-align: center;
- height: 100%;
- width: 100%;
- overflow: hidden;
- border: none;
-}
-
-/* FIXME: This only works for the first wikiEditor on the page! */
-#wikiEditor-0-preview-dialog .wikiEditor-ui-loading span {
- display: block;
- height: 24px;
- width: 24px;
- /* @embed */
- background: url(images/toolbar/loading.gif) 0 0 no-repeat;
- text-indent: -9999px;
- margin: 50px auto;
-}
-
-.ui-dialog .ui-dialog-buttonpane {
- margin: 0 !important;
-}
-
-.wikiEditor-preview-dialog-contents {
- font-size: 0.9em !important;
-}
-
-.wikiEditor-preview-dialog-contents #firstHeading {
- font-size: 2.1em;
-}
diff --git a/modules/jquery.wikiEditor.previewDialog.js
b/modules/jquery.wikiEditor.previewDialog.js
deleted file mode 100644
index 34f38e3..0000000
--- a/modules/jquery.wikiEditor.previewDialog.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Publish module for wikiEditor */
-/*jshint onevar:false */
-( function ( $, mw ) { $.wikiEditor.modules.previewDialog = {
-
-/**
- * Compatability map
- */
-'browsers': {
- // Left-to-right languages
- 'ltr': {
- 'msie': [['>=', 7]],
- 'firefox': [['>=', 3]],
- 'opera': [['>=', 9.6]],
- 'safari': [['>=', 4]]
- },
- // Right-to-left languages
- 'rtl': {
- 'msie': [['>=', 8]],
- 'firefox': [['>=', 3]],
- 'opera': [['>=', 9.6]],
- 'safari': [['>=', 4]]
- }
-},
-/**
- * Internally used functions
- */
-fn: {
- /**
- * Creates a publish module within a wikiEditor
- * @param context Context object of editor to create module in
- * @param config Configuration object to create module from
- */
- create: function ( context ) {
- // Build the dialog behind the Publish button
- var dialogID = 'wikiEditor-' + context.instance +
'-preview-dialog';
- $.wikiEditor.modules.dialogs.fn.create(
- context,
- {
- preview: {
- id: dialogID,
- titleMsg: 'wikieditor-preview-tab',
- html: '\
- <div
class="wikiEditor-ui-loading"><span></span></div>\
- <div
class="wikiEditor-preview-dialog-contents"></div>\
- ',
- init: function () {
- },
- dialog: {
- buttons: {
-
'wikieditor-publish-dialog-publish': function () {
- var
minorChecked = $( '#wikiEditor-' + context.instance +
-
'-dialog-minor' ).is( ':checked' ) ?
-
'checked' : '';
- var
watchChecked = $( '#wikiEditor-' + context.instance +
-
'-dialog-watch' ).is( ':checked' ) ?
-
'checked' : '';
- $(
'#wpMinoredit' ).attr( 'checked', minorChecked );
- $(
'#wpWatchthis' ).attr( 'checked', watchChecked );
- $( '#wpSummary'
).val( $( '#wikiEditor-' + context.instance +
-
'-dialog-summary' ).val() );
- $( '#editform'
).submit();
- },
-
'wikieditor-publish-dialog-goback': function () {
- $( this
).dialog( 'close' );
- }
- },
- resizable: false,
- height: $( 'body' ).height() -
100,
- width: $( 'body' ).width() -
300,
- position: ['center', 'top'],
- open: function () {
- // Gets the latest copy
of the wikitext
- var wikitext =
context.fn.getContents();
- var $dialog = $( '#' +
dialogID );
- $dialog
- .css(
'position', 'relative' )
- .css( 'height',
$( 'body' ).height() - 200 )
- .parent()
- .css( 'top',
'25px' );
- // $dialog.dialog(
'option', 'width', $( 'body' ).width() - 300 );
- // Aborts when nothing
has changed since the last preview
- if (
context.modules.preview.previewText === wikitext ) {
- return;
- }
-
- $dialog.find(
'.wikiEditor-preview-dialog-contents' ).empty();
- $dialog.find(
'.wikiEditor-ui-loading' ).show();
- $.post(
-
mw.util.wikiScript( 'api' ),
- {
-
'action': 'parse',
-
'title': mw.config.get( 'wgPageName' ),
- 'text':
wikitext,
- 'prop':
'text',
- 'pst':
'',
-
'format': 'json'
- },
- function ( data
) {
- if (
-
typeof data.parse === 'undefined' ||
-
typeof data.parse.text === 'undefined' ||
-
typeof data.parse.text['*'] === 'undefined'
- ) {
-
return;
- }
-
context.modules.preview.previewText = wikitext;
-
$dialog.find( '.wikiEditor-ui-loading' ).hide();
-
$dialog.find( '.wikiEditor-preview-dialog-contents' )
-
.html( '<h1 class="firstHeading" id="firstHeading">' +
-
mw.config.get( 'wgTitle' ) + '</h1>' +
-
data.parse.text['*'] )
-
.find( 'a:not([href^=#])' ).click( function () { return false; } );
- },
- 'json'
- );
- }
- },
- resizeme: false
- }
- }
- );
- context.fn.addButton( {
- 'captionMsg': 'wikieditor-preview-tab',
- 'action': function () {
- context.$textarea.wikiEditor( 'openDialog',
'preview' );
- return false;
- }
- } );
- }
-}
-
-}; } )( jQuery, mediaWiki );
--
To view, visit https://gerrit.wikimedia.org/r/176512
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic49e84b8a91da701673949a8d441c788a4feaa22
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: GOIII <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits