Extension talk:VisualEditor

About this board

Please note that the Wikimedia Foundation does not provide support for installing VisualEditor on third-party wikis. However, if you have a question we may try to help.

How to hide namespace in internal link string?

2
95.26.111.205 (talkcontribs)

I add internal link to some namespace page using widget. This widget insert link with text "Namespace:Page". Where is option or extension that will add link without namespace in text? Just "Page".

Cavila (talkcontribs)

Visual Editor allows you to use a custom label for any link, though I'm guessing you want the label to be added automatically, right? In that case, you may be better off using the DisplayTitle extension to customise the link label for any wiki page (provided that the page exists on the wiki).

Reply to "How to hide namespace in internal link string?"
Arachnosuchus (talkcontribs)

How do I activate this for Wiktionary?

Reply to "Wiktionary"

Set "Edit Source" as default, but still have VisualEditor as option.

1
Medicinestorm (talkcontribs)

How do I allow my users to choose wikitext/source-edit or VisualEditor AND use the wikitext/source-edit by default, not VisualEditor?

My users like VisualEditor, but it isn't always the right feature for editing pages that are primarily transclusions or conditional code. I would like MediaWiki to default to using "Edit Source" aka raw wikitext, but still keep the option to click the (Visual) "Edit" button to switch to VisualEditor.

I have tried many things in settings, but most just seem to remove the option for using VisualEditor entirely.

On all existing pages, things work fine: There are two buttons shown:

  • "Edit" (VisualEditor) and
  • "Edit source" (wikitext).

Users may click whichever button they prefer. However, following a redlink (URL ends in ./{pagename}&action=edit&redlink=1) always opens up a page in VisualEditor and furthermore does not allow the user to switch to "Edit source". Source editing button does not work

Thank you for your time.

P.S. I am using Skin:Citizen, a known compatible skin.

Reply to "Set "Edit Source" as default, but still have VisualEditor as option."

Invalid Response from Server Error

3
Dapachy (talkcontribs)

As soon as I save changes made with the VisualEditor the error message "Invalid response from Server" is displayed. When the page is reloaded the changes are there and were therefore made.

This error happens everytime I save and is very confusing for our users.

Any solutions to this problem?

Klymets (talkcontribs)

I also have this error when try download images. When the page reloaded the image are there.

Stefahn (talkcontribs)

Got the same error. In my case switching the PHP version from 8.3 to 8.1. removed the error.

Reply to "Invalid Response from Server Error"

Skipping the save confirmation dialog

7
MyWikis-JeffreyWang (talkcontribs)

One of our clients does not want the save confirmation dialog to appear; they would like for the save to happen immediately.

They proposed using this code on their wiki:

ve.init.mw.ArticleTarget.prototype.showSaveDialog = function ( action, checkboxName ) {
    this.save(this.getDocToSave(), this.getSaveOptions());
    this.tryTeardown(true);
    return;
}

However, it only executes in the browser's console. When adding it to MediaWiki:Common.js, it doesn't do anything.

How can this snippet of code be modified to execute such that it can be stored in MediaWiki:Common.js?

Krabina (talkcontribs)
MyWikis-JeffreyWang (talkcontribs)

It seems like that extension is for uploads of files only, whereas here we are trying to save pages without the summary/confirmation appearing. Am I mistaken?

Krabina (talkcontribs)

ah, yes. I was not reading this properly. Yes, EnhanceUpload does onyl fix several options when uploading files with VE

This post was hidden by Thomas-topway-it (history)
Thomas-topway-it (talkcontribs)

hello @MyWikis-JeffreyWang could you try the following ?

(function () {

    // @see https://www.mediawiki.org/w/index.php?title=Topic%3AY42xiwa26cl6d1zl&topic_showPostId=y4cmacnoqiruyy2x&fromnotif=1#flow-post-y4cmacnoqiruyy2x
	mw.loader.using('ext.visualEditor.targetLoader', function () {
		// Register plugins to VE. will be loaded once the user opens VE
		mw.libs.ve.targetLoader.addPlugin(function () {

			ve.init.mw.ArticleTarget.prototype.showSaveDialog = function (
				action,
				checkboxName
			) {
				// @see ve.ui.MWSaveDialog.js -> getActionProcess
				var saveDeferred = ve.createDeferred();
				this.emit('save', saveDeferred);
				var saveOptions = this.getSaveOptions();

				// @see ve.init.mw.ArticleTarget.js -> onSaveDialogSave
				this.emit('saveInitiated');
				this.startSave(saveOptions);
				this.saveDeferred = saveDeferred;
			};
		});
	});
})();

MyWikis-JeffreyWang (talkcontribs)

That works well for me, I've passed it on to the client. Let's hope it works for them!

Thanks a bunch @Thomas-topway-it!

Reply to "Skipping the save confirmation dialog"
185.24.187.196 (talkcontribs)

hi

is it possible to upload images as anonymous user with visualeditor?

thanks

8.3.127.189 (talkcontribs)

I am also trying this . Changing LocalSettings only worked in regular upload page. Visual Editor Seems to have a problem and asking for the owner of the file.


Could not store upload in the stash (UploadStashNotLoggedInException): "UploadStash::stashFile No user is logged in, files must belong to users".

82.64.12.155 (talkcontribs)

Same. Anonymous file upload can't work with visualeditor apparently...

Reply to "anonymous upload"

Signature is disabled

1
Bernard543 (talkcontribs)

I have Installed VisualEditor version 0.1.2 on MediaWiki version 1.41.0 with LocalSettings.php configuration:

wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['VisualEditor-enable'] = 1;

and some additional access to namespaces.

On Wikipedia VisualEditor is also in use, but has a total different look-and-feel. There the signature function does work.

What can be the reason? And how can I solve it?

Reply to "Signature is disabled"

How does e.g. $wgVisualEditorAvailableNamespaces work?

4
Summary by Kghbln
Kghbln (talkcontribs)

I have set the following to my "LocalSettings.php"

$wgVisualEditorAvailableNamespaces = [
        NS_MAIN => true,
        NS_USER => true,
        NS_EXTRA => true
        ];

What I expected was that VisualEditor is only available for the namespaces MAIN, USER and EXTRA. What is happening is that also the namespaces CATEGORY and FILE are available for editing with VisualEditor.

Changing the setting to the following does not change the set of available namespaces:

$wgVisualEditorAvailableNamespaces = [
        NS_MAIN => true,
        NS_USER => true,
        NS_EXTRA => true,
        '_merge_strategy' => 'array_plus'
        ];

So my question is: Which values are available to "_merge_strategy"? or What do I have to add to get VisualEditor only for the namespaces MAIN, USER and EXTRA?

Thanks for some insights.

Kghbln (talkcontribs)

Doing something like the following does not change anything either:

$wgVisualEditorAvailableNamespaces = [
        NS_MAIN => true,
        NS_USER => true,
        NS_FILE => false,
        NS_CATEGORY => false,
        NS_EXTRA => true
        ];

Adding something like 'array_replace' to '_merge_strategy' does not work either. Currently I just do not get it.

Osnard (talkcontribs)

I believe the merge strategies are only available on extension.json. For the available values see Manual:Extension.json/Schema#Merge strategies.

Have you tried manipulating the value in an "extension function"? e.g.

$wgExtensionFunctions[] = function() {
  unset( $GLOBALS['wgVisualEditorAvailableNamespaces'][NS_CATEGORY] );
};


(Code not tested)

Kghbln (talkcontribs)

Thanks for you info. @Tgr: came up with the decisive hint for easy configuring. This was probably too obvious. Current docu is pretty bad so I will improve that. The info about the merge strategies was very interesting too. So this is nothing for use in "LocalSettings.php".

That's how to enable and disable namespaces:

$wgVisualEditorAvailableNamespaces = [
        "File" => false, 
        "Category" => false, 
        "Extra" => true
        ];

Template search shows /doc subpages

2
Summary by TomRamm

solution found

TomRamm (talkcontribs)

If i try to Insert a template, the template search shows me my template but also all the /Doku (germen translate of /Doc) subpages with the documentation for the template.

How can i hide the /doc Subpages?

Example:

if i search for "Löschen" (name of the template)

the dropdown shows me:

Löschen

Marks a Page as delete candidate

Löschen/Doku

Marks a page as delete candidate

TomRamm (talkcontribs)
Nanash (talkcontribs)

The default signature function in the visual editor currently uses the timestamp signature (~~~~). I would like it to use the signature without timestamp (~~~).

Is it possible to configure this function?

Reply to "Signatures format"
Return to "VisualEditor" page.