mediawiki-extensions-Visual.../modules/ve/test
Timo Tijhof f06952f2f3 Refactor ve.js utilities and improve documentation
Refactor:
* ve.indexOf
  Renamed from ve.inArray.
  This was named after the jQuery method which in turn has a longer
  story about why it is so unfortunately named. It doesn't return
  a boolean, but an index. Hence the native method being called
  indexOf as well.

* ve.bind
  Renamed from ve.proxy.
  I considered making it use Function.prototype.bind if available.
  As it performs better than $.proxy (which doesn't use to the native
  bind if available). However since bind needs to be bound itself in
  order to use it detached, it turns out with the "call()" and
  "bind()"  it is slower than the $.proxy shim:
  http://jsperf.com/function-bind-shim-perf
  It would've been like this:
  ve.bind = Function.prototype.bind ?
      Function.prototype.call.bind( Function.prototype.bind ) :
      $.proxy;
  But instead sticking to ve.bind = $.proxy;

* ve.extendObject
  Documented the parts of jQuery.extend that we use. This makes it
  easier to replace in the future.

Documentation:
* Added function documentation blocks.
* Added annotations to  functions that we will be able to remove
  in the future in favour of the native methods.
  With "@until + when/how".
  In this case "ES5". Meaning, whenever we drop support for browsers
  that don't support ES5. Although in the developer community ES5 is
  still fairly fresh, browsers have been aware for it long enough
  that thee moment we're able to drop it may be sooner than we think.
  The only blocker so far is IE8. The rest of the browsers have had
  it long enough that the traffic we need to support of non-IE
  supports it.

Misc.:
* Removed 'node: true' from .jshintrc since Parsoid is no longer in
  this repo and thus no more nodejs files.
 - This unraveled two lint errors: Usage of 'module' and 'console'.
   (both were considered 'safe globals' due to nodejs, but not in
   browser code).

* Replaced usage (before renaming):
 - $.inArray -> ve.inArray
 - Function.prototype.bind -> ve.proxy
 - Array.isArray -> ve.isArray
 - [].indexOf -> ve.inArray
 - $.fn.bind/live/delegate/unbind/die/delegate -> $.fn.on/off

Change-Id: Idcf1fa6a685b6ed3d7c99ffe17bd57a7bc586a2c
2012-08-12 20:32:45 +02:00
..
ce After much research on error objects, native = good, custom = bad 2012-08-08 10:48:53 -07:00
dm Make use of new jshint options 2012-08-10 02:50:30 +02:00
image.png Move test files 2012-07-25 14:35:49 -07:00
index.html Merge "Add ve.dm.BreakNode to represent <br>" 2012-08-09 21:50:41 +00:00
ve.BranchNode.test.js After much research on error objects, native = good, custom = bad 2012-08-08 10:48:53 -07:00
ve.Document.test.js Kranitor #1: On-boarding 2012-07-27 14:40:00 -07:00
ve.example.js Puttin' em white-spacers where they aught'a be 2012-08-06 18:52:19 -07:00
ve.Factory.test.js After much research on error objects, native = good, custom = bad 2012-08-08 10:48:53 -07:00
ve.LeafNode.test.js Refactor ve.js utilities and improve documentation 2012-08-12 20:32:45 +02:00
ve.Node.test.js Kranitor #1: On-boarding 2012-07-27 14:40:00 -07:00
ve.qunit.js Puttin' em white-spacers where they aught'a be 2012-08-06 18:52:19 -07:00