MediaWiki talk:Gadget-HotArticleRate2.js

From RationalWiki
Jump to navigation Jump to search

Todo:

  • Implement saving
    • Replace {{copper}}/{{bronze}}/{{silver}}/{{gold}} on the article
    • Build the rated template and replace the talk page text with that + this.textToSave done
    • Handle edit conflicts done
      • return value is: {"error":{"code":"editconflict","info":"Edit conflict detected"}}
      • Reload talk page, check if rated parameters have changed. If they haven't, resubmit. If they have, display them next to inputs (append comments to commentsInput.value) and let the user review the changes and submit again. done
  • Get the categories via the api when we're on the talk page
  • Figure out how to do captchas
    • The api returns a simple captcha instead of recaptcha, i.e. something like "what's 18+23" plus a captcha id. Just show the question to the user with an inputbox then resubmit with the result and the captcha id.
    • {"edit":{"captcha":{"type":"simple","mime":"text\/plain","id":"676842286","question":"70 - 6"},"result":"Failure"}}
  • only add \n\n after rated if necessary, otherwise changing a rated template on a page will keep adding line breaks fixed by ltrimming page text
  • preview icon (use code from User:Nx/Scripts/LinkSuggest.js)
  • display all icons from Category:Portal icons and allow user to pick one, similar to the smiley toolbar gadget.

Ponder Stibbons talk Wizard's hat.svg 03:05, 6 October 2011 (UTC)