User talk:Lifebaka/closedrv.js

Legacy JavaScript

edit

Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook( ... ) needs to be replaced with $( ... ) or $( function() { ... } ) (depending on use); all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' ); and addPortletLink needs to be called with mw.util.addPortletLink. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. — {{U|Technical 13}} (etc) 21:41, 19 January 2015 (UTC)Reply

Delete All account Briana Vanessa Magana (talk) 11:57, 30 July 2017 (UTC)Reply

Syntax highlighting breaks closedrv?

edit

It looks like the new syntax highlighting breaks this. I assume this is looking for some specific class pattern in the DOM and syntax highlighting changed what it's looking for. -- RoySmith (talk) 15:51, 17 June 2018 (UTC)Reply

Four years later, syntax highlighting still breaks this. — Ceso femmuin mbolgaig mbung, mellohi! (投稿) 19:43, 16 August 2022 (UTC)Reply
This can be fixed by modifying the actual text selection stuff with $( '#wpTextbox1' ).textSelection('getContents'); like so:
::function autodrv_result()
::{
::  var close = prompt("Result of debate?");
::  var t = $( '#wpTextbox1' ).textSelection('getContents');
::  t = t.split(/==== *\[/).join('{{subst:' + 'drt|1=[');
::  t = t.split(/\] *====/).join(']|2=' + close + '}}');
::  if (t.length > 0 && t.slice(-1) !== '\n')
::    t += '\n';
::  t += "{{subst:" + "drb" + "}}";
::  $( '#wpTextbox1' ).textSelection('setContents',t);
::  document.editform.wpSummary.value += "closing: " + close;
::}
::
No idea how it actually works, I just copied it from Wikipedia:AutoEd, haven't bothered reading documentation, and I'm not sure I'd want to bother copying it to my own userspace any time soon. Alpha3031 (tc) 13:00, 3 October 2023 (UTC)Reply

Script broken

edit

@Lifebaka: Thanks for this great script, but for some days now it's not been working for me any more; the "close" command has disappeared. Has something broken somewhere? Sandstein 06:03, 23 October 2020 (UTC)Reply