FANDOM


This is the talk page for discussing improvements to the ViewDeleted page.

Suggestions

  • I think a space is missing before the "[view content]" link.
  • Can the preview modal be a bit bigger, like the one used to preview page edits?
  • When I tried to preview an image, script got stuck on "loading".leviathan_89 @fandom 12:46, July 26, 2017 (UTC)
  • I just added one. If you need more, just increase the left margin of .view-content-wrapper by a few pixels.
  • Yes! You can now edit the width (and height, and all other properties of the modal) by changing ViewDeleted.modal.
  • I'm aware, it should only happen when the file was a redirect before being deleted. If that's not the case, then please tell me more, preferably with a link to the image. -- Dorumin 19:10, July 26, 2017 (UTC)
  • Thank you!
  • Actually, I've tried to preview many images but none worked (examples: [1], [2]). I'm using chrome.
  • Something is not clear, when I restore a page using the link of your script, are all revisions restored by default? Or just the last one? (I have yet to try it). leviathan_89 @fandom 20:07, July 26, 2017 (UTC)
  • Well, the part of "permanently loading" I'm not sure. Works fine for me (using Opera, which is really Chrome with a paintjob). Are you sure you're clicking the preview button? The image won't display on the first modal, only the actual wikitext on the file page will appear. [3]
  • Yes, it will restore all revisions, since it's usually very rare to restore selected revisions. -- Dorumin 22:46, July 26, 2017 (UTC)

────────────────────────────────────────────────────────────────────────────────────────────────────

  • I went ahead and found the same image you used in your example, this is what happens to me (for all files actually): [4]. I'm not sure what is causing it... I don't see anything unusual in the console either.
  • Another (minor) thing: if you try doing a query with the logs (like this) the script won't run. I believe that's because you used as condition "/delete" to be present in "wgPageName", however if someone do a query, wgPageName will be simply "Special:Log". I don't know how exactly, but maybe you should add as secondary condition something like ("wgCanonicalSpecialPageName = Log" AND "&type=delete in the url query"). leviathan_89 @fandom 23:34, July 26, 2017 (UTC)
  • Oh, that must be because it returns the wrong element when looking it up in the page. Since I can't piggyback your account, could you please run this script and post the result here? Don't worry, the sensitive stuff is redacted, but you can contact me in the chat if you've got doubts.
$.get('/wiki/Special:Undelete?target=' + encodeURIComponent('File:Look.jpg'), function(page) {
    var $page = $(page),
    url = $page.find('#undelete');
    console.log(
        url[0].outerHTML
            .split(mw.user.tokens.get('editToken')).join('[REDACTED]')
            .replace(/token=.+?%5C/g, '[REDACTED]')
    );
});
  • Implemented! I completely overlooked index.php. -- Dorumin 00:11, July 27, 2017 (UTC)
<form method="post" action="/wiki/Special:Undelete?action=submit" id="undelete"><h2>Cancellazioni</h2>
<ul>
<li class="mw-logline-delete"><span class="mw-revdelundel-link">(<a href="/wiki/Special:RevisionDelete?target=Special%3ALog%2Fdelete&amp;type=logging&amp;ids=7519" title="Special:RevisionDelete">mostra/nascondi</a>)</span> 21:05, 18 gen 2017 <a href="/wiki/User:AmonFatalis" title="User:AmonFatalis" class="mw-userlink">AmonFatalis</a> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:AmonFatalis" title="User talk:AmonFatalis">Discussione</a> | <a href="/wiki/Special:Contributions/AmonFatalis" title="Special:Contributions/AmonFatalis">contributi</a> | <a href="/wiki/Special:Block/AmonFatalis" title="Special:Block/AmonFatalis">blocca</a>)</span> ha cancellato la pagina <a href="/wiki/File:Look.jpg?action=edit&amp;redlink=1" class="new" title="File:Look.jpg (la pagina non esiste)">File:Look.jpg</a> <span class="comment" dir="auto">(Clean-up)</span> <span class="mw-logevent-actionlink">(<a href="/wiki/Special:Undelete?target=File%3ALook.jpg" title="Special:Undelete">visualizza/ripristina</a>)</span> </li>
</ul>
<h2>Log delle soppressioni</h2>
<div class="mw-warning-logempty">Il registro non contiene elementi corrispondenti alla ricerca.</div><fieldset>
<legend>Recupera revisioni</legend>
<table id="mw-undelete-table"><tbody><tr>
						<td colspan="2" class="mw-undelete-extrahelp"><p>Per recuperare l'intera cronologia della pagina, lasciare tutte le caselle deselezionate e fare clic su <i><b>Ripristina</b></i>.
Per effettuare un ripristino selettivo, selezionare le caselle corrispondenti alle revisioni da ripristinare e fare clic su <i><b>Ripristina</b></i>.
</p></td>
					</tr>
					<tr>
						<td class="mw-label"><label for="wpComment">Motivo:</label></td>
						<td class="mw-input"><input name="wpComment" size="50" value="" id="wpComment"></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td class="mw-submit"><input type="submit" value="Ripristina" name="restore" id="mw-undelete-submit"> <input type="submit" value="Inverti selezione" name="invert" id="mw-undelete-invert"></td>
					</tr><tr>
						<td>&nbsp;</td>
						<td class="mw-input"><input name="wpUnsuppress" type="checkbox" value="1" id="mw-undelete-unsuppress">&nbsp;<label for="mw-undelete-unsuppress">Elimina le limitazioni sulle revisioni ripristinate</label></td>
					</tr></tbody></table></fieldset><h2>Cronologia della pagina</h2>
<ul><li><input name="ts20140111145836" type="checkbox" value="1"> <span class="mw-revdelundel-link">(<a href="/wiki/Special:RevisionDelete?type=revision&amp;target=File%3ALook.jpg&amp;ids=16947" title="Special:RevisionDelete">mostra/nascondi</a>)</span> (diff) <a href="/wiki/Special:Undelete?target=File%3ALook.jpg&amp;timestamp=20140111145836" title="Special:Undelete">15:58, 11 gen 2014</a> . . <a href="/wiki/User:AmonFatalis" title="User:AmonFatalis" class="mw-userlink">AmonFatalis</a>  <span class="mw-usertoollinks">(<a href="/wiki/User_talk:AmonFatalis" title="User talk:AmonFatalis">Discussione</a> | <a href="/wiki/Special:Contributions/AmonFatalis" title="Special:Contributions/AmonFatalis">contributi</a> | <a href="/wiki/Special:Block/AmonFatalis" title="Special:Block/AmonFatalis">blocca</a>)</span> <span class="history-size">(vuota)</span> </li></ul><h2>Cronologia del file</h2>
<ul><li><input name="fileid34" type="checkbox" value="1"> <span class="mw-revdelundel-link">(<a href="/wiki/Special:RevisionDelete?type=filearchive&amp;target=File%3ALook.jpg&amp;ids=34" title="Special:RevisionDelete">mostra/nascondi</a>)</span> <a href="/wiki/Special:Undelete?target=File%3ALook.jpg&amp;file=il1cbdn3wnv9kvn47n2b3f6drwjh5w6.jpg&amp;[REDACTED]" title="Special:Undelete">15:58, 11 gen 2014</a> . . <a href="/wiki/User:AmonFatalis" title="User:AmonFatalis" class="mw-userlink">AmonFatalis</a> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:AmonFatalis" title="User talk:AmonFatalis">Discussione</a> | <a href="/wiki/Special:Contributions/AmonFatalis" title="Special:Contributions/AmonFatalis">contributi</a> | <a href="/wiki/Special:Block/AmonFatalis" title="Special:Block/AmonFatalis">blocca</a>)</span> 535 × 28 (11&nbsp;716 byte) </li>
</ul><input type="hidden" value="File:Look.jpg" name="target"><input type="hidden" value="[REDACTED]" name="wpEditToken"></form>

leviathan_89 @fandom 01:11, July 27, 2017 (UTC)

<span class="mw-revdelundel-link">(<a href="/wiki/Special:RevisionDelete?type=revision&amp;target=File%3ALook.jpg&amp;ids=16947" title="Special:RevisionDelete">mostra/nascondi</a>)</span>
That's our issue! I didn't foresee revision delete links getting in the way. Fixed. Oh, and sorry for not responding in chat, I got distracted :P -- Dorumin 01:54, July 27, 2017 (UTC)

Space

The space you added before is not present if there is also the deletion summary. leviathan_89 @fandom 16:18, August 1, 2017 (UTC)

Bodged it in. I've got no idea why, but I can't find in the page history the edit in which I added the space. Did someone revdelete me? -- Dorumin 17:04, August 1, 2017 (UTC)
I actually tried to look for that edit in order to fix it myself, but since I couldn't find it I posted here. leviathan_89 @fandom 18:29, August 1, 2017 (UTC)

Admin only

Is this script admin only, i mean i can't see [View content] button where i'm not an admin. Clash.BikashTalk 20:18, November 26, 2017 (UTC)

Yes, it's role restricted for admins and content moderators. Some global groups too, but you shouldn't worry about those. -- Dorumin 20:22, November 26, 2017 (UTC)

Image size

The image quite often overflows the modal since it's much bigger. That can be fixed by adding some CSS like

.view-content-image-preview {
	max-width: 700px; /* or whatever the modal's width is */
	object-fit: contain;
}

I can use personal CSS for that, but can something like that be implemented in the script itself, maybe with the right width? leviathan_89 @fandom 18:39, December 16, 2017 (UTC)

Added! Sorry for the delay, I hadn't noticed your post, and I don't use email so I didn't get the notification :P -- Dorumin 01:24, December 29, 2017 (UTC)
Ty! I added the object-fit property, though, to maintain the image ratio. leviathan_89 @fandom 12:45, December 29, 2017 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+