According to the Verge article it seems that there was a partnership in development of VE that should be referenced no? Anyone informed on how it went and how exceptional this was or not from regular WMF practices?
Talk:VisualEditor
The credits file for VisualEditor (as auto-published under Special:Version) lists the engineers from Wikia (Christian and Inez) alongside those from Wikimedia (and those from other organisations).
I presently have a couple of extensions which are integrated with VisualEditor in MW 1.35. I am trying to migrate them to the new version (MW 1.39 RC1, downloaded zip) but I am getting a number of errors: non existing functions (template spec extend, onRawFallbackButtonClick, getParameterNames..). I have not been able to find documentation explaining how to migrate. Is there any available? Any help you can provide? I also could not find a list of extensions integrated in VE, which I could use to perform code comparisons.
And to be ultra precise, here is the error I am getting. Note I have not changed the code and it was working fine in my previous version of MW.
In my extension module, I have implemented the function insertTransclusionNode
. In it, when inserting a new node, once I have build my object (getPlainObject
), I call the following function
surfaceFragment.insertContent( [{type: 'gacdmslinker',attributes: {mw: obj,calaction: 'insert'}},{ type: '/gacdmslinker' }] );
and this is when I get the following error:
VM522:28 Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'VeDmDocument'
| property 'bindings' -> object with constructor 'Object'
| property 'transact' -> object with constructor 'Array'
| ...
| property 'context' -> object with constructor 'VeDmInternalList'
--- property 'document' closes the circle
at JSON.stringify (<anonymous>)
at ve.dm.Surface.storeChanges (load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector&version=1lvvz:180:941)
at OO.EventEmitter.emit (<anonymous>:28:656)
at ve.dm.Surface.breakpoint (load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector&version=1lvvz:175:902)
The weird thing is, my object (gacdmslinkernode) is still created in the sense that, if I save the document and re-edit it with VE, it shows up correcly. However, the error seems to be preventing the insertion of the title of the object (but not of the associated icon) and instead it uses the page title as the title. And also, when I update an existing node, I get no error and it works fine.
I'm studying to create my own extension with Visual Editor, and I'm struggling to figure out how I can make a hook in the dialog pop up for the contents.
For example, I'm making a traditional tag extension, like <ABC> MY TEXT </ABC>
And, When I enter the Visual Editor, the tag can be edit through the pop-up box, and the "Code" section shows "MY TEXT". This is good.
Now, before giving the text of "MY TEXT" to the "Code" section in the pop-up box, I want to manipulate the "MY TEXT" and give the manipulated string to the "Code" section.
For example, I want to give "_MANIPULATED_ MY TEXT _DONE_" to the "Code" section in the pop-up box in the Visual Editor instead of "MY TEXT" string.
Can someone help me how I can achieve the goal, please?
Automatic citation is feature in most Wikis but not in Nepali Wiki. It would be a very handy new tool to have. Any ideas how you enable it?
You need to configure your wiki to handle it: Citoid/Enabling Citoid on your wiki. This can be a little complicated, as it's built around the needs and processes of the bigger Wikipedias at the time, but should be do-able.
How can I add or activate tools (extensions) like graph, math, and etc to the standalone version?
The stand-alone (non-MediaWiki) version of VisualEditor can be extended by writing code along the lines of VisualEditor/Gadgets#Triggering a command using a toolbar tool (though some of the advice there will not apply, because it's talking about the MediaWiki context).
The MediaWiki extensions you mention are each reliant on MediaWiki, and so can't be added to the stand-alone version of VisualEditor.
I want my MediaWiki to appear like this:
Instead of this:
Reason: Since the MediaWiki 1.35 update, which defaults to VisualEditor, I have observed in Special:RecentChanges that many edits are tagged with Visual Editor: Switched, meaning they opened VE and switched to source editing afterwards.
What do I need to change in LocalSettings.php for both tabs to appear?
select 'Show me both editor tabs' in the Preference menu (see → https://www.mediawiki.org/wiki/VisualEditor/Single_edit_tab )
Christian 🇫🇷 FR (talk) 17:20, 28 June 2022 (UTC)
You might be looking for Extension:VisualEditor#Quick_configuration_guide.
It is a separate page.
I think that it depends upon whether you have the VisualEditor/Single edit tab system. Some WMF wikis do, and some don't, and I have no idea what's the default for third-party MediaWiki installations.
I was just glancing at https://stackoverflow.com/questions/44471699/how-to-make-undo-work-in-an-html-textarea-after-setting-the-value and https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#browser_compatibility shows that execCommand is supported by all major web browsers. I noticed on Wikipedia both in the edit area at top (Special Characters), as well as the additional ones on the bottom (dropdown menu for Insert, Wiki markup, Symbols, etc.), that undo states are lost when clicking on any of the characters to insert. Is there a way that future versions can fix this to preserve the undo history?
Note: I see that execCommand is "Deprecated: This feature is no longer recommended." but otherwise still I would like to see a way to insert characters that preserves undo history. Also see https://stackoverflow.com/a/70831583
Do you know whether this is specific to Firefox?
It is not specific to Mozilla Firefox. The issue affects Chrome/Chromium and Opera
So that's most editors. @ESanders (WMF), do you have any thoughts about how this could be done?
What does this have to do with VE?
I assumed that "textarea" was "the area where the text is" (e.g., ContentEditable), but I don't know.
I think @Jasonkhanlar is referring to <textarea>
in the 2010 wikitext editor. That has known issues with the undo stack (T33780), and my go-to answer is to use the 2017 wikitext editor, which has it's own undo stack implementation.
I see. That is correct. It seems that https://en.wikipedia.org/ is using the 2010 wikitext editor, I tried to find the 2017 wikitext editor, and according to 2017 wikitext editor it is part of VisualEditor, which perhaps solves the undo state issue that I mentioned. Unfortunately, since neither Wikipedia seems to use it, nor does my webhost allow me to add "AllowEncodedSlashes NoDecode" to my website's VirtualHost section, and I get "Error contacting the Parsoid/RESTBase server (HTTP 404)" when enabling the VisualEditor extension for my site, I cannot check to see the 2017 wikitext editor in action. I read: https://mediawiki.org/wiki/Extension:VisualEditor#Allowing_VisualEditor_on_page_titles_containing_slashes Also whichever editor is used on Mediawiki.org, also undo does not work here either, when clicking the buttons to add special characters.
Your webhost may allow adding an .htaccess
file?
Q: "Your webhost may allow adding an .htaccess
file?"
A: https://httpd.apache.org/docs/2.4/mod/core.html#allowencodedslashes shows 2 contexts: server config or virtual host. There is no .htaccess context for the AllowEncodedSlashes Directive. Therefore, I am unable to enable encoded slashes from within a .htaccess file in my webhost environment.
When I try to modify a page who contain a tamplate with the VisualEditor I have this error Error contacting the Parsoid/RESTBase server (HTTP 500)
.
what should I do?
Is this a private wiki, or one of the WMF-hosted wikis?
it's a private wiki.
You might have better luck asking at Project:Support desk, since the folks there know something about installing MediaWiki and its extensions.
Hello. I am working on a local mediawiki 1.37.1
At first when I added wfLoadExtension( 'VisualEditor' ); it was okay and i could edit some text
then the "Error contacting the Parsoid-/RESTBase-Server (HTTP 403)" started to appear and it stopped working.
And know when I click on the edit button, nothing happens. just the page refreshes and for a moment u could see the loading bar
WHat should I do?
mediawiki 1.37.1 is the last stable version and I do not intend to upgrade to 1.38 until it is stabe.
I suggest posting this at Project:Support desk. It sounds like you might be having a problem with site configuration.
Hello. I am trying to add a button to Visual Editor, to apply smallcaps template to selected text. So far, I have been able to create the button, following the example at VisualEditor/Gadgets/Add a tool. Now I can insert some fixed text in smallcaps, with this code:
var myTemplate = [ {
type: 'mwTransclusionBlock',
attributes: {
mw: {
parts: [ {
template: {
target: {
href: 'Template:Smallcaps',
wt: 'Smallcaps'
},
params: {
1: {
wt: 'my parameter'
}
}
}
} ]
}
}
}, {
type: '/mwTransclusionBlock'
} ];
And then assigning it to a toolbar button, as described in VisualEditor/Gadgets/Add a tool. Now, the next step is replacing the fixed text 'my parameter', with the selected text from the editor.
I have very little knowledge of Javascript, maybe this is a trivial issue but I don't know how to deal with it. Any help is much appreciated.
I know even less than you do about Javascript, but I wonder if w:en:User:Matma_Rex/nwe-nowiki.js would be a helpful model. It adds nowiki markup for me.
@Whatamidoing (WMF) Thanks for your response. It seems like that method could also work for me, with small modifications. Could you tell me where and how are you inserting that code? I tried to insert it the same way as my previous code, but it didn't work for me.
I found the solution myself. This topic gives an example of exactly what I am trying to achieve, as a gadget: Topic:Vfmg4amjkxvrlhjp
Congratulations. I'm glad that you found that.