Last modified: 2013-03-15 16:41:20 UTC
When you invoke the dialog to insert a link after you selected a link in the wikitext, the fields in the dialog are filled accordingly. The same would be nice for the image dialog, too. This is not possible (or at least quite difficult) for some cases, since there are much more possible keywords and localizations, but in those cases where only known keywords are used, this should be possible. An example use case: A user adds an image using the dialog, previews the page and decides to move the image to the left side. Then he should be able to select the code for the image, invoke the dialog again and just change the position.
Created attachment 11138 [details] JavaScript snippet The attached file contains a function that takes a string as argument and returns either false if it wasn't able to parse it, or an object with the following members: pre - whitespace before the image post - whitespace after fileName - normalized name of the file (without namespace) caption - caption (if present) fileSize - size without px (if present) fileFloat - English keyword for the float parameter (if present) fileFormat - English keyword for the format parameter (if present) Whoever is going to fix this bug "only" has to integrate this function into the code, i.e. call it when the dialog is opened with the selected text and set the <input>s and <select>s to the returned values.