Commit graph

10 commits

Author SHA1 Message Date
Timo Tijhof 7721909f9f WikiEditor: Linting and conventions
* Code clean up in preparation for enabling linting in the future

* Update code to use latest code conventions and best practices:
 - Make use of jQuery.Event (e.g. no need to check both e.keyCode
   and e.which)
 - jQuery: .size() -> .length
 - jQuery: (where appropiate) .attr() -> .prop()
   Setting properties like 'checked' via attr() has been deprecated
   in jQuery.
 - Whitespace
 - Single quotes instead of double quotes
 - Use literal keys in object literals instead of strings
 - Pass mediaWiki to closure, use mw. locally instead of "mediaWiki"
   global directly.
 - Fix indentation
 - Brackets around if, else and for bodies
 - Strict comparison to 0, null, false, true etc.
 - Fix missing radix parameter in parseInt
 - Use local $ instead of global $
 - Use `foo || bar` instead of `foo ? foo : bar`
 - Variable scope hoisting
 - Double/redundant variable declarations
 - ['foo'] is better written in dot notation
 - New line at EOF
 - Consistency in jQuery construction:
   Tag name for element creation $( '<div>' )
   Valid html for html parsing $( '<div foo="bar"></div>' )
 - Fix regex escape warnings per JSLint/JSHint.
   Do escape ][, don't escape ><
 - ..

* Add .jshintrc / .jshintignore

* Updated most files, but not all. Too much at once.

Change-Id: I445639b25a9688b3cdf9e5449e3d31cbcfa9c7ae
2012-07-17 13:27:27 -07:00
Roan Kattouw 432415b129 Followup r96944: rename "Replace next" button to "Replace" cause that's what it does now 2011-10-31 08:38:35 +00:00
Roan Kattouw 280ae464a4 (bug 31499) articlePathRegex (detection of external links within the same wiki) broken when wgServer is protocol-relative 2011-10-25 14:30:33 +00:00
Derk-Jan Hartman 11aabbd4a9 Fix bug 31604.
Table should now load the tablesorter if needed, and make sure that the table is sortable.
2011-10-22 17:21:03 +00:00
Siebrand Mazeland cc71ec5354 * bump version to 0.3.1
* stylize.php
2011-09-13 08:56:32 +00:00
Siebrand Mazeland 868eec7504 (bug 20919) Search & Replace: Change "Replace Next" functionality to "Replace" functionality. Patch by Amir E. Aharoni.
Submitter's comment: "Replace next" now replaces the currently selected text instead of finding the next occurrence and replacing it. To keep the location of the current occurrence, i added matchIndex to $(this).data.

I added some comments renamed a couple of variable for readability:
* s to textRemainder
* replace to actualReplacement

This is my first significant jQuery-style patch so it may have embarrassing mistakes - constructive criticism is welcome.
2011-09-13 08:53:12 +00:00
Mark A. Hershberger b18069c06a Bug #29106: Patch from Michael M. to address JS legacy globals in wikiEditor 2011-06-26 19:25:27 +00:00
Leo Koppelkamm 57721bd94e Followup to r86108 per CR: Fix two calls to legacy tablesorter 2011-04-30 18:58:17 +00:00
Leo Koppelkamm 724dccc131 Fix jumping of textbox in link-dialog. This happened when the link was being checked and the too large spinner image pushed the field down 2011-04-21 08:59:13 +00:00
Jan Paul Posma 8ca58dd46b A bit of a reorganisation that fixes bug 27164. Basically the extensive configuration in the ext.wikieditor.* functions is moved to the jquery plugins, to be able to use these configurations in other extensions which don't have a #wpTextbox1.
Please review this to check if this is the right way to do it!
2011-02-24 01:45:55 +00:00