Commit graph

16 commits

Author SHA1 Message Date
Fomafix cfcfa69fe4 Apply coding conventions for JavaScript
Change-Id: Ibae64ca7aa52c2283ff81bd942be80c83a4089f7
2014-04-30 10:59:01 +00:00
Derk-Jan Hartman 952d6b9d8f WikiEditor: Remove unmaintained beta iframe mode
Change-Id: I2d7369116b92d674d791e420750a906a17a46bac
2014-04-03 17:20:49 +02:00
Timo Tijhof 1a2daca06a Kranitor: Make JSHint pass
eqeqeq:
* Change loose comparisons to strict comparisons where
  it seems safe to use a strict comparision instead.
  Mostly comparisons to strings or objects, and comparisons to
  numbers where the other value is known to be a number, too.
  E.g. foo == 'string', bar == node, indexOf() != -1.
* Add eqeqeq:false to files where there are non-obvious usages
  left.

onevar, quotmark:
* Disabled in files with lots of style violations.

unused:
* Remove unused variables that have no side-effects in their
  assigned expression.

Coding style cleanups on affected lines where trivial.

Change-Id: I5db155a632740e24cb52dba2177c7fc35d5aebd5
2013-11-10 07:36:03 +00:00
Derk-Jan Hartman 7a498e18fb (bug 24566) Make the search and replace dialog non-modal
This has been a popular request, because people often have to
interrupt their search to make certain changes and then want to
resume.

Change-Id: Id537ffe439d4522add300d8c1355758774dca1c9
2012-08-04 16:16:25 +02:00
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
Siebrand Mazeland cc71ec5354 * bump version to 0.3.1
* stylize.php
2011-09-13 08:56:32 +00:00
Roan Kattouw 0af1258eef Followup r82900: per CR, use .length instead of size(), strict comparison with zero, and re-select from the DOM after removal to guard against weird interaction between .remove() and .length 2011-08-20 12:47:00 +00:00
Krinkle 40bb0c72b5 Extension:WikiEditor Code quality, JSHint validation and JSPERF
- Leaked globals
- Strict comparison to 0, false and ''
- Missing semicolon
- Variable name collision
- Minor improvements in caching (in a few places "var $that" cached $(this), but wasn't actually used)
- Replace calls to deprecated $j with $
- Checking undefined by strictly comparing references instead of a string comparison and typeof (speed)

(see bug 29106)
2011-06-06 23:18:13 +00:00
Derk-Jan Hartman d0b6d276cf Because this element has margins, the scrollWidth will be larger by definition, causing the box to continiously grow in size when opening it multiple times.
Fixes bug 27566
2011-03-28 21:11:17 +00:00
Jan Paul Posma 9df5838aa5 Fixes bug when having multiple textareas, which is caused by the fact that dialogs are kept in memory for performance, even when selecting a different textarea. 2011-02-27 17:14:01 +00:00
Roan Kattouw 4b89c4440b WikiEditor: Fix templateEditor dialogs, which were broken by lazy creation in the dialogs module, by allowing them to specify they need immediate creation. Also add a few missing var keywords and explicitly pass a variable that was previously passed by accident because it leaked into the global scope without the var on it. 2011-01-04 12:53:20 +00:00
Roan Kattouw 0d78534735 Remove RegExp.escape() in favor of String.prototype.escapeRE() 2010-10-28 15:32:43 +00:00
Trevor Parscal bb88f087b4 Mostly reverted r75487, making use of a new version of mediaWiki.msg. 2010-10-27 00:16:32 +00:00
Trevor Parscal 55a8f66322 Updated use of mediaWiki.msg to mediaWiki.message 2010-10-26 23:42:23 +00:00
Trevor Parscal a9c45c88e0 Lots of refactoring. This still does not work! But it's getting close. 2010-09-15 22:40:50 +00:00
Trevor Parscal 9d278e8dee Copied over all the resources needed to make WikiEditor stand on it's own two feet. Lots more to do as far as organizing and fleshing out the extensions's PHP bits. 2010-09-15 03:08:35 +00:00