Last modified: 2013-03-15 16:41:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40829, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38829 - When dialog to insert an image is invoked on a selection, prefill the fields accordingly
When dialog to insert an image is invoked on a selection, prefill the fields ...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-30 08:14 UTC by Michael M.
Modified: 2013-03-15 16:41 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
JavaScript snippet (1.95 KB, text/javascript)
2012-09-24 08:36 UTC, Michael M.
Details

Description Michael M. 2012-07-30 08:14:15 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.
Comment 1 Michael M. 2012-09-24 08:36:42 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links