# Distribution

MochiKit - makes JavaScript suck a bit less

[click to expand all]

- MochiKit.Async - manage asynchronous tasks
  [+]
  [–]

  AlreadyCalledError
  BrowserComplianceError
  CancelledError
  GenericError
  XMLHttpRequestError
  Deferred()
  Deferred.prototype.addBoth(func)
  Deferred.prototype.addCallback(func[, ...])
  Deferred.prototype.addCallbacks(callback, errback)
  Deferred.prototype.addErrback(func)
  Deferred.prototype.callback([result])
  Deferred.prototype.cancel()
  Deferred.prototype.errback([result])
  Deferred
  DeferredLock()
  DeferredLock.prototype.acquire()
  DeferredLock.prototype.release()
  DeferredList(list, [fireOnOneCallback, fireOnOneErrback, consumeErrors, canceller])
  callLater(seconds, func[, args...])
  doXHR(url[, {option: value, ...}])
  doSimpleXMLHttpRequest(url[, queryArguments...])
  evalJSONRequest(req)
  fail([result])
  gatherResults(deferreds)
  getXMLHttpRequest()
  maybeDeferred(func[, argument...])
  loadJSONDoc(url[, queryArguments...])
  sendXMLHttpRequest(req[, sendContent])
  succeed([result])
  wait(seconds[, res])

- MochiKit.Base - functional programming and useful comparisons
  [+]
  [–]

  NotFound
  AdapterRegistry
  AdapterRegistry.prototype.register(name, check, wrap[, override])
  AdapterRegistry.prototype.match(obj[, ...])
  AdapterRegistry.prototype.unregister(name)
  NamedError
  arrayEqual(self, arr)
  average(lst[, ...])
  bind(func, self[, arg, ...])
  bindMethods(self)
  camelize(str)
  clone(obj)
  compare(a, b)
  compose(f1, f2, ..., fN)
  concat(lst[, ...])
  counter(n=1)
  extend(self, obj, skip=0)
  evalJSON(aJSONString)
  filter(fn, lst)
  findValue(lst, value, start=0, end=lst.length)
  findIdentical(lst, value, start=0, end=lst.length)
  flattenArguments(arg[, ...])
  flattenArray(lst)
  forwardCall(name)
  isArrayLike(obj[, ...])
  isDateLike(obj[, ...])
  isEmpty(obj[, ...])
  isNotEmpty(obj[, ...])
  isNull(obj[, ...])
  isUndefinedOrNull(obj[, ...])
  itemgetter(name)
  items(obj)
  keyComparator(key[, ...])
  keys(obj)
  listMax(lst)
  listMin(lst)
  listMinMax(which, lst)
  map(fn, lst[, ...])
  mean(lst[, ...])
  median(lst[, ...])
  merge(obj[, ...])
  method(self, func, ...)
  methodcaller(name[, args...])
  nameFunctions(namespace)
  noop()
  objEqual(a, b)
  nodeWalk(node, visitor)
  objMax(obj[, ...])
  objMin(obj[, ...])
  operator
  parseQueryString(encodedString[, useArrays=false])
  partial(func, arg[, ...])
  queryString(names, values)
  registerComparator(name, check, comparator[, override])
  registerJSON(name, check, simplifier[, override])
  registerRepr(name, check, wrap[, override])
  repr(obj)
  reverseKeyComparator(key)
  serializeJSON(anObject)
  setdefault(self, obj[, ...])
  typeMatcher(typ[, ...])
  update(self, obj[, ...])
  updatetree(self, obj[, ...])
  urlEncode(unencoded)
  values(obj)
  xfilter(fn, obj[, ...])
  xmap(fn, obj[, ...)

- MochiKit.DOM - painless DOM manipulation API
  [+]
  [–]

  $(id[, ...])
  addElementClass(element, className)
  addLoadEvent(func)
  addToCallStack(target, path, func[, once])
  appendChildNodes(node[, childNode[, ...]])
  insertSiblingNodesBefore(node[, siblingNode[, ...]])
  insertSiblingNodesAfter(node[, siblingNode[, ...]])
  createDOM(name[, attrs[, node[, ...]]])
  createDOMFunc(tag[, attrs[, node[, ...]]])
  currentDocument()
  currentWindow()
  emitHTML(dom[, lst])
  escapeHTML(s)
  focusOnLoad(element)
  formContents(elem=document.body)
  getElement(id[, ...])
  getElementsByTagAndClassName(tagName, className, parent=document)
  getFirstElementByTagAndClassName(tagName, className, parent=document)
  getFirstParentByTagAndClassName(elem, tagName='*', className=null)
  getNodeAttribute(node, attr)
  hasElementClass(element, className[, ...])
  isChildNode(node, maybeParent)
  isParent(child, element)
  makeClipping(element)
  makePositioned(element)
  registerDOMConverter(name, check, wrap[, override])
  removeElement(node)
  removeElementClass(element, className)
  removeEmptyTextNodes(node)
  replaceChildNodes(node[, childNode[, ...]])
  scrapeText(node[, asArray=false])
  setElementClass(element, className)
  setNodeAttribute(node, attr, value)
  swapDOM(dest, src)
  swapElementClass(element, fromClass, toClass)
  toggleElementClass(className[, element[, ...]])
  toHTML(dom)
  undoClipping(element, overflow)
  undoPositioned(element, overflow)
  updateNodeAttributes(node, attrs)
  withWindow(win, func)
  withDocument(doc, func)
  computedStyle(htmlElement, cssProperty, mozillaEquivalentCSS)
  elementDimensions(element)
  elementPosition(element[, relativeTo={x: 0, y: 0}])
  getViewportDimensions()
  hideElement(element, ...)
  setElementDimensions(element, dimensions[, units='px'])
  setElementPosition(element, position[, units='px'])
  setDisplayForElement(display, element[, ...])
  setOpacity(element, opacity)
  showElement(element, ...)
  Coordinates(x, y)
  Dimensions(w, h)

- MochiKit.DragAndDrop - drag and drop
  [+]
  [–]

  Draggable(element[, options])
  Droppable(element[, options])

- MochiKit.Color - color abstraction with CSS3 support
  [+]
  [–]

  Color()
  Color.fromBackground(elem)
  Color.fromComputedStyle(elem, style)
  Color.fromHexString(hexString)
  Color.fromHSL(hue, saturation, lightness, alpha=1.0)
  Color.fromHSLString(hslString)
  Color.fromHSV(hue, saturation, value, alpha=1.0)
  Color.fromName(colorName)
  Color.fromRGB(red, green, blue, alpha=1.0)
  Color.fromRGBString(rgbString)
  Color.fromText(elem)
  Color.fromString(rgbOrHexString)
  Color.namedColors()
  Color.prototype.colorWithAlpha(alpha)
  Color.prototype.colorWithHue(hue)
  Color.prototype.colorWithSaturation(saturation)
  Color.prototype.colorWithLightness(lightness)
  Color.prototype.darkerColorWithLevel(level)
  Color.prototype.lighterColorWithLevel(level)
  Color.prototype.blendedColor(other, fraction=0.5)
  Color.prototype.isLight()
  Color.prototype.isDark()
  Color.prototype.toRGBString()
  Color.prototype.toHSLString()
  Color.prototype.toHexString()
  Color.prototype.asRGB()
  Color.prototype.asHSL()
  Color.prototype.asHSV()
  Color.blackColor()
  Color.blueColor()
  Color.brownColor()
  Color.cyanColor()
  Color.darkGrayColor()
  Color.grayColor()
  Color.greenColor()
  Color.lightGrayColor()
  Color.magentaColor()
  Color.orangeColor()
  Color.purpleColor()
  Color.redColor()
  Color.whiteColor()
  Color.yellowColor()
  Color.transparentColor()
  clampColorComponent(num, scale)
  hslToRGB(hue, saturation, lightness, alpha)
  hsvToRGB(hue, saturation, value, alpha)
  toColorPart(num)
  rgbToHSL(red, green, blue, alpha)
  rgbToHSV(red, green, blue, alpha)

- MochiKit.DateTime - "what time is it anyway?"
  [+]
  [–]

  isoDate(str)
  isoTimestamp(str)
  toISOTime(date)
  toISOTimestamp(date, realISO=false)
  toISODate(date)
  americanDate(str)
  toPaddedAmericanDate(date)
  toAmericanDate(date)

- MochiKit.Format - string formatting goes here
  [+]
  [–]

  formatLocale(locale="default")
  lstrip(str, chars="\s")
  numberFormatter(pattern, placeholder="", locale="default")
  percentFormat(someFloat)
  roundToFixed(aNumber, precision)
  rstrip(str, chars="\s")
  strip(str, chars="\s")
  truncToFixed(aNumber, precision)
  twoDigitAverage(numerator, denominator)
  twoDigitFloat(someFloat)

- MochiKit.Iter - itertools for JavaScript; iteration made HARD, and then easy
  [+]
  [–]

  StopIteration
  applymap(fun, seq[, self])
  chain(p, q[, ...])
  count(n=0)
  cycle(p)
  dropwhile(pred, seq)
  every(iterable, func)
  exhaust(iterable)
  forEach(iterable, func[, self])
  groupby(iterable[, keyfunc])
  groupby_as_array(iterable[, keyfunc])
  iextend(lst, iterable)
  ifilter(pred, seq)
  ifilterfalse(pred, seq)
  imap(fun, p, q[, ...])
  islice(seq, [start,] stop[, step])
  iter(iterable[, sentinel])
  izip(p, q[, ...])
  list(iterable)
  next(iterator)
  range([start,] stop[, step])
  reduce(fn, iterable[, initial])
  registerIteratorFactory(name, check, iterfactory[, override])
  repeat(elem[, n])
  reversed(iterable)
  some(iterable, func)
  sorted(iterable[, cmp])
  sum(iterable, start=0)
  takewhile(pred, seq)
  tee(iterable, n=2)

- MochiKit.Logging - we're all tired of `alert()`
  [+]
  [–]

  LogMessage(num, level, info)
  Logger([maxSize])
  Logger.prototype.addListener(ident, filter, listener)
  Logger.prototype.baseLog(level, message[, ...])
  Logger.prototype.clear()
  Logger.prototype.debuggingBookmarklet()
  Logger.prototype.dispatchListeners(msg)
  Logger.prototype.getMessages(howMany)
  Logger.prototype.getMessageText(howMany)
  Logger.prototype.removeListener(ident)
  alertListener(msg)
  log(message[, info[, ...]])
  logDebug(message[, info[, ...]])
  logError(message[, info[, ...]])
  logFatal(message[, info[, ...]])
  logLevelAtLeast(minLevel)
  logWarning(message[, info[, ...]])

- MochiKit.LoggingPane - interactive MochiKit.Logging pane
  [+]
  [–]

  LoggingPane(inline=false, logger=MochiKit.Logging.logger)
  LoggingPane.prototype.closePane()
  createLoggingPane(inline=false)

- MochiKit.Selector - selecting elements by CSS selector syntax
  [+]
  [–]

  $$(expression[, ...])
  findChildElements(element, expressions)
  Selector(simpleExpression)
  Selector.findElements(scope[, axis=""])

- MochiKit.Signal - simple universal event handling
  [+]
  [–]

  connect(src, signal, dest[, func])
  disconnect(ident)
  disconnectAll(src[, signal, ...])
  disconnectAllTo(dest[, func])
  signal(src, signal, ...)
  event()
  src()
  type()
  target()
  modifier()
  stopPropagation()
  preventDefault()
  stop()
  key()
  mouse()
  relatedTarget()
  confirmUnload(msg)

- MochiKit.Style - painless CSS manipulation API
  [+]
  [–]

  getStyle(element, cssSelector)
  setStyle(element, styles)
  setOpacity(element, opacity)
  getElementDimensions(element)
  setElementDimensions(element, dimensions[, units='px'])
  getElementPosition(element[, relativeTo={x: 0, y: 0}])
  setElementPosition(element, position[, units='px'])
  setDisplayForElement(display, element[, ...])
  showElement(element, ...)
  hideElement(element, ...)
  getViewportDimensions()
  getViewportPosition()
  Coordinates(x, y)
  Dimensions(w, h)

- MochiKit.Sortable - sortable
  [+]
  [–]

  SortableObserver
  Sortable.create(element [, options])
  Sortable.destroy(element)
  Sortable.serialize(element [, options])

- MochiKit.Visual - visual effects
  [+]
  [–]

  roundClass(tagName[, className[, options]])
  roundElement(element[, options])
  toggle(element[, effect[, options]])
  tagifyText(element[, tagifyStyle])
  multiple(elements, effect[, options])
  DefaultOptions
  Base()
  Parallel(effects [, options])
  Opacity(element [, options])
  Move(element [, options])
  Scale(element, percent [, options])
  Highlight(element [, options])
  ScrollTo(element [, options])
  fade(element [, options])
  appear(element [, options])
  puff(element [, options])
  blindUp(element [, options])
  blindDown(element [, options])
  switchOff(element [, options])
  dropOut(element [, options])
  shake(element [, options])
  slideDown(element [, options])
  slideUp(element [, options])
  squish(element [, options])
  grow(element [, options])
  shrink(element [, options])
  pulsate(element [, options])
  fold(element [, options])

# Notes

To turn off MochiKit's export feature (which may be necessary for compatibility with some existing code), do this before loading MochiKit:

    <script type="text/javascript">MochiKit = {__export__: false};</script>

When export mode is off, you must use fully qualified names for all MochiKit functions (e.g. `MochiKit.Base.map(...)`).

# Screencasts

- MochiKit 1.1 Intro

# See Also

- Google Groups: MochiKit: The official mailing list for discussions related to development of and with MochiKit
- mochikit.com: MochiKit's home on the web
- from __future__ import *: Bob Ippolito's blog
- MochiKit on JSAN: the JSAN distribution page for MochiKit
- MochiKit tag on del.icio.us: Recent bookmarks related to MochiKit
- MochiKit tag on Technorati: Recent blog entries related to MochiKit

# Version History

2006-XX-XX v1.4

- New removeNodeAttribute function in MochiKit.DOM.
- MochiKit.Async.doXHR and dependent functions now accept 201 CREATED and 204 NO CONTENT as valid.
- MochiKit.DOM.formContents now treats option tags the same way that form posts do in the case of missing and empty string value attributes, even in IE.
- MochiKit.Base.queryString now accepts third queryString([names, values]) form.
- MochiKit.DOM.formContents now defaults to document.body if no element is given.
- New MochiKit.Selector module
- MochiKit.LoggingPane fixes for Internet Explorer
- MochiKit.DOM now creates XHTML nodes in XUL documents.
- MochiKit.LoggingPane now works on pages with '#' in the URL on IE
- New MochiKit.Async.doXHR as a convenient method for doing custom XMLHttpRequests (e.g. extra headers, overrideMimeType, etc.)
- New __connect__ protocol for MochiKit.Signal.connect source notifications
- Added colSpan, bgColor to the list of DOM renames for Internet Explorer
- New MochiKit.Signal.disconnectAllTo function
- MochiKit.Base.parseQueryString now accepts leading question mark
- New MochiKit.Base.values function
- Fixed MochiKit.Signal.disconnect when called from a signal handler invoked by MochiKit.Signal.signal
- parseQueryString now splits on HTML entities equivalent to ampersand as well
- Better XHTML compatibility (removed obvious cases where uppercase tagName or nodeName was assumed)
- MochiKit.Base.queryString now handles array values in the same way HTML forms handle multiple elements of the same name.
- MochiKit.Base.parseQueryString now returns {} for empty query string instead of {"": "undefined"}
- MochiKit.DOM.formContents now handles option value="" correctly.
- MochiKit.DOM now checks for undefined className.
- MochiKit.Iter.groupby() now uses compare() to group rather than == and !=
- serializeJSON no longer serializes undefined, as per the JSON spec
- Fixed an infinite recursion bug in serializeJSON if an adapter returns the object itself.
- New MochiKit.Base.operator.seq and sne to support strict comparison
- MochiKit.Base.isArrayLike no longer returns true for DOM text nodes
- Added readonly-readOnly to the list of DOM renames for Internet Explorer
- New MochiKit.Signal event method: confirmUnload (sets returnValue for onbeforeunload)
- Fix interpreter help() function for Firefox and IE
- API version compatibility notes added
- New MochiKit.Base functions methodcaller and compose
- Support IE-based native console logging (Debugger, Atlas)
- Refactored style functions from MochiKit.DOM to MochiKit.Style
- MochiKit.Async.DeferredList is now a proper Deferred
- MochiKit.DOM.formContents now supports SELECT multiple tags
- Re-use StopIteration Error if the browser already has it
- Workaround IE type="" bug for INPUT elements
- Allow LoggingPane to work in IE with hyphen-containing URLs
- Replace percents for Safari native logging to avoid crashing
- New MochiKit.DOM.coerceToDOM .dom(node) / .__dom__(node) protocol
- MochiKit.DOM's MochiKit.Iter dependency is now optional
- Added expand all link to the documentation index
- Added MochiKit.DOM.isChildNode
- Added synthesizing for onmouseenter/onmouseleave

2006-04-29 v1.3.1 (bug fix release)

- Fix sendXMLHttpRequest sendContent regression
- Internet Explorer fix in MochiKit.Logging (printfire exception)
- Internet Explorer XMLHttpRequest object leak fixed in MochiKit.Async

2006-04-26 v1.3 "warp zone"

- IMPORTANT: Renamed MochiKit.Base.forward to forwardCall (for export)
- IMPORTANT: Renamed MochiKit.Base.find to findValue (for export)
- New MochiKit.Base.method as a convenience form of bind that takes the object before the method
- New MochiKit.Base.flattenArguments for flattening a list of arguments to a single Array
- Refactored MochiRegExp example to use MochiKit.Signal
- New key_events example demonstrating use of MochiKit.Signal's key handling capabilities.
- MochiKit.DOM.createDOM API change for convenience: if attrs is a string, null is used and the string will be considered the first node. This allows for the more natural P("foo") rather than P(null, "foo").
- MochiKit Interpreter example refactored to use MochiKit.Signal and now provides multi-line input and a help() function to get MochiKit function signature from the documentation.
- Native Console Logging for the default MochiKit.Logging logger
- New MochiKit.Async.DeferredList, gatherResults, maybeDeferred
- New MochiKit.Signal example: draggable
- Added sanity checking to Deferred to ensure that errors happen when chaining is used incorrectly
- Opera sendXMLHttpRequest fix (sends empty string instead of null by default)
- Fix a bug in MochiKit.Color that incorrectly generated hex colors for component values smaller than 16/255.
- Fix a bug in MochiKit.Logging that prevented logs from being capped at a maximum size
- MochiKit.Async.Deferred will now wrap thrown objects that are not instanceof Error, so that the errback chain is used instead of the callback chain.
- MochiKit.DOM.appendChildNodes and associated functions now append iterables in the correct order.
- New MochiKit-based SimpleTest test runner as a replacement for Test.Simple
- MochiKit.Base.isNull no longer matches undefined
- example doctypes changed to HTML4
- isDateLike no longer throws error on null
- New MochiKit.Signal module, modeled after the slot/signal mechanism in Qt
- updated elementDimensions to calculate width from offsetWidth instead of clientWidth
- formContents now works with FORM tags that have a name attribute
- Documentation now uses MochiKit to generate a function index

2006-01-26 v1.2 "the ocho"

- Fixed MochiKit.Color.Color.lighterColorWithLevel
- Added new MochiKit.Base.findIdentical function to find the index of an element in an Array-like object. Uses === for identity comparison.
- Added new MochiKit.Base.find function to find the index of an element in an Array-like object. Uses compare for rich comparison.
- MochiKit.Base.bind will accept a string for func, which will be immediately looked up as self[func].
- MochiKit.DOM.formContents no longer skips empty form elements for Zope compatibility
- MochiKit.Iter.forEach will now catch StopIteration to break
- New MochiKit.DOM.elementDimensions(element) for determining the width and height of an element in the document
- MochiKit.DOM's initialization is now compatible with HTMLUnit + JWebUnit + Rhino
- MochiKit.LoggingPane will now re-use a `_MochiKit_LoggingPane` DIV element currently in the document instead of always creating one.
- MochiKit.Base now has operator.mul
- MochiKit.DOM.formContents correctly handles unchecked checkboxes that have a custom value attribute
- Added new MochiKit.Color constructors fromComputedStyle and fromText
- MochiKit.DOM.setNodeAttribute should work now
- MochiKit.DOM now has a workaround for an IE bug when setting the style property to a string
- MochiKit.DOM.createDOM now has workarounds for IE bugs when setting the name and for properties
- MochiKit.DOM.scrapeText now walks the DOM tree in-order
- MochiKit.LoggingPane now sanitizes the window name to work around IE bug
- MochiKit.DOM now translates usemap to useMap to work around IE bug
- MochiKit.Logging is now resistant to Prototype's dumb Object.prototype hacks
- Added new MochiKit.DOM documentation on element visibility
- New MochiKit.DOM.elementPosition(element[, relativeTo={x: 0, y: 0}]) for determining the position of an element in the document
- Added new MochiKit.DOM createDOMFunc aliases: CANVAS, STRONG

2005-11-14 v1.1

- Fixed a bug in numberFormatter with large numbers
- Massively overhauled documentation
- Fast-path for primitives in MochiKit.Base.compare
- New groupby and groupby_as_array in MochiKit.Iter
- Added iterator factory adapter for objects that implement iterateNext()
- Fixed isoTimestamp to handle timestamps with time zone correctly
- Added new MochiKit.DOM createDOMFunc aliases: SELECT, OPTION, OPTGROUP, LEGEND, FIELDSET
- New MochiKit.DOM formContents and enhancement to queryString to support it
- Updated view_source example to use dp.SyntaxHighlighter 1.3.0
- MochiKit.LoggingPane now uses named windows based on the URL so that a given URL will get the same LoggingPane window after a reload (at the same position, etc.)
- MochiKit.DOM now has currentWindow() and currentDocument() context variables that are set with withWindow() and withDocument(). These context variables affect all MochiKit.DOM functionality (getElement, createDOM, etc.)
- MochiKit.Base.items will now catch and ignore exceptions for properties that are enumerable but not accessible (e.g. permission denied)
- MochiKit.Async.Deferred's addCallback/addErrback/addBoth now accept additional arguments that are used to create a partially applied function. This differs from Twisted in that the callback/errback result becomes the last argument, not the first when this feature is used.
- MochiKit.Async's doSimpleXMLHttpRequest will now accept additional arguments which are used to create a GET query string
- Did some refactoring to reduce the footprint of MochiKit by a few kilobytes
- escapeHTML to longer escapes ' (apos) and now uses String.replace instead of iterating over every char.
- Added DeferredLock to Async
- Renamed getElementsComputedStyle to computedStyle and moved it from MochiKit.Visual to MochiKit.DOM
- Moved all color support out of MochiKit.Visual and into MochiKit.Color
- Fixed range() to accept a negative step
- New alias to MochiKit.swapDOM called removeElement
- New MochiKit.DOM.setNodeAttribute(node, attr, value) which sets an attribute on a node without raising, roughly equivalent to: updateNodeAttributes(node, {attr: value})
- New MochiKit.DOM.getNodeAttribute(node, attr) which gets the value of a node's attribute or returns null without raising
- Fixed a potential IE memory leak if using MochiKit.DOM.addToCallStack directly (addLoadEvent did not leak, since it clears the handler)

2005-10-24 v1.0

- New interpreter example that shows usage of MochiKit.DOM to make an interactive JavaScript interpreter
- New MochiKit.LoggingPane for use with the MochiKit.Logging debuggingBookmarklet, with logging_pane example to show its usage
- New mochiregexp example that demonstrates MochiKit.DOM and MochiKit.Async in order to provide a live regular expression matching tool
- Added advanced number formatting capabilities to MochiKit.Format: numberFormatter(pattern, placeholder="", locale="default") and formatLocale(locale="default")
- Added updatetree(self, obj[, ...]) to MochiKit.Base, and changed MochiKit.DOM's updateNodeAttributes(node, attrs) to use it when appropiate.
- Added new MochiKit.DOM createDOMFunc aliases: BUTTON, TT, PRE
- Added truncToFixed(aNumber, precision) and roundToFixed(aNumber, precision) to MochiKit.Format
- MochiKit.DateTime can now handle full ISO 8601 timestamps, specifically isoTimestamp(isoString) will convert them to Date objects, and toISOTimestamp(date, true) will return an ISO 8601 timestamp in UTC
- Fixed missing errback for sendXMLHttpRequest when the server does not respond
- Fixed infinite recusion bug when using roundClass("DIV", ...)
- Fixed a bug in MochiKit.Async wait (and callLater) that prevented them from being cancelled properly
- Workaround in MochiKit.Base bind (and partial) for functions that don't have an apply method, such as alert
- Reliably return null from the string parsing/manipulation functions if the input can't be coerced to a string (s + "") or the input makes no sense; e.g. isoTimestamp(null) and isoTimestamp("") return null

2005-10-08 v0.90

- Fixed ISO compliance with toISODate
- Added missing operator.sub
- Placated Mozilla's strict warnings a bit
- Added JSON serialization and unserialization support to MochiKit.Base: serializeJSON, evalJSON, registerJSON. This is very similar to the repr API.
- Fixed a bug in the script loader that failed in some scenarios when a script tag did not have a "src" attribute (thanks Ian!)
- Added new MochiKit.DOM createDOMFunc aliases: H1, H2, H3, BR, HR, TEXTAREA, P, FORM
- Use encodeURIComponent / decodeURIComponent for MochiKit.Base urlEncode and parseQueryString, when available.

2005-08-12 v0.80

- Source highlighting in all examples, moved to a view-source example
- Added some experimental syntax highlighting for the Rounded Corners example, via the LGPL dp.SyntaxHighlighter 1.2.0 now included in examples/common/lib
- Use an indirect binding for the logger conveniences, so that the global logger could be replaced by setting MochiKit.Logger.logger to something else (though an observer is probably a better choice).
- Allow MochiKit.DOM.getElementsByTagAndClassName to take a string for parent, which will be looked up with getElement
- Fixed bug in MochiKit.Color.fromBackground (was using node.parent instead of node.parentNode)
- Consider a 304 (NOT_MODIFIED) response from XMLHttpRequest to be success
- Disabled Mozilla map(...) fast-path due to Deer Park compatibility issues
- Possible workaround for Safari issue with swapDOM, where it would get confused because two elements were in the DOM at the same time with the same id
- Added missing THEAD convenience function to MochiKit.DOM
- Added lstrip, rstrip, strip to MochiKit.Format
- Added updateNodeAttributes, appendChildNodes, replaceChildNodes to MochiKit.DOM
- MochiKit.Iter.iextend now has a fast-path for array-like objects
- Added HSV color space support to MochiKit.Visual
- Fixed a bug in the sortable_tables example, it now converts types correctly
- Fixed a bug where MochiKit.DOM referenced MochiKit.Iter.next from global scope

2005-08-04 v0.70

- New ajax_tables example, which shows off XMLHttpRequest, ajax, json, and a little TAL-ish DOM templating attribute language.
- sendXMLHttpRequest and functions that use it (loadJSONDoc, etc.) no longer ignore requests with status == 0, which seems to happen for cached or local requests
- Added sendXMLHttpRequest to MochiKit.Async.EXPORT, d'oh.
- Changed scrapeText API to return a string by default. This is API-breaking! It was dumb to have the default return value be the form you almost never want. Sorry.
- Added special form to swapDOM(dest, src). If src is null, dest is removed (where previously you'd likely get a DOM exception).
- Added three new functions to MochiKit.Base for dealing with URL query strings: urlEncode, queryString, parseQueryString
- MochiKit.DOM.createDOM will now use attr[k] = v for all browsers if the name starts with "on" (e.g. "onclick"). If v is a string, it will set it to new Function(v).
- Another workaround for Internet "worst browser ever" Explorer's setAttribute usage in MochiKit.DOM.createDOM (checked -> defaultChecked).
- Added UL, OL, LI convenience createDOM aliases to MochiKit.DOM
- Packing is now done by Dojo's custom Rhino interpreter, so it's much smaller now!

2005-07-29 v0.60

- Beefed up the MochiKit.DOM test suite
- Fixed return value for MochiKit.DOM.swapElementClass, could return false unexpectedly before
- Added an optional "parent" argument to MochiKit.DOM.getElementsByTagAndClassName
- Added a "packed" version in packed/MochiKit/MochiKit.js
- Changed build script to rewrite the URLs in tests to account for the JSAN-required reorganization
- MochiKit.Compat to potentially work around IE 5.5 issues (5.0 still not supported). Test.Simple doesn't seem to work there, though.
- Several minor documentation corrections

2005-07-27 v0.50

- Initial Release

# Copyright

Copyright 2005 Bob Ippolito <bob@redivi.com>. This program is dual-licensed free software; you can redistribute it and/or modify it under the terms of the MIT License or the Academic Free License v2.1.