diff -Nru ipython-0.12/debian/changelog ipython-0.12.1+dfsg/debian/changelog --- ipython-0.12/debian/changelog 2012-01-08 13:58:38.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/changelog 2012-04-22 14:27:04.000000000 +0000 @@ -1,3 +1,21 @@ +ipython (0.12.1+dfsg-0ubuntu1) precise; urgency=low + + * New upstream release (Closes: #655413, #663256) + Repackaged to remove minified javascript files from source. + * add get-orig-source target to rules + * ipython-notebook: depend on libjs-mathjax instead of recommending. + mathjax can't be securely served from cloudfront. + * debian/rules: delete build directory in clean + * remove transitional ipython-parallel package + * set HOME to build folder for doc build and tests (Closes: #665224) + * move all examples to ipython-doc + * move python-argparse to suggests (Closes: #653650) + * update standard version to 3.9.3, no changes needed + * override lintian desktop-command-not-in-package + * remove python-pymongo build dep, tests skipped without running mongod + + -- Julian Taylor Sun, 22 Apr 2012 16:26:59 +0200 + ipython (0.12-1) unstable; urgency=low [ Julian Taylor ] diff -Nru ipython-0.12/debian/control ipython-0.12.1+dfsg/debian/control --- ipython-0.12/debian/control 2012-01-08 16:40:06.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/control 2012-04-22 14:27:04.000000000 +0000 @@ -14,7 +14,6 @@ python-nose, python-pexpect, python-pygments, - python-pymongo, python-pyparsing, python-qt4, python-simplegeneric, @@ -31,13 +30,12 @@ Homepage: http://ipython.org/ Vcs-Svn: svn://svn.debian.org/python-modules/packages/ipython/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/ipython/trunk/ -Standards-Version: 3.9.2 +Standards-Version: 3.9.3 DM-Upload-Allowed: yes Package: ipython Architecture: all -Depends: python-argparse, - python-configobj, +Depends: python-configobj, python-decorator, python-pexpect, python-simplegeneric, @@ -46,12 +44,11 @@ Suggests: ipython-doc, ipython-notebook, ipython-qtconsole, + python-argparse, python-matplotlib, python-numpy, python-profiler, python-zmq (>= 2.0.10.1) -Replaces: ipython-parallel (<< 0.12~20111208~ee40ebe0-2) -Breaks: ipython-parallel(<< 0.12~20111208~ee40ebe0-2) Description: enhanced interactive Python shell IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific @@ -61,6 +58,10 @@ session logging, session restoring, complete system shell access, verbose and colored traceback reports, auto-parentheses, auto-quoting, and is embeddable in other Python programs. + . + This package contains the basic terminal shell. For the qt console + install ipython-qtconsole and for the html notebook install + ipython-notebook. Package: ipython3 Architecture: all @@ -68,8 +69,8 @@ python3-pkg-resources, ${misc:Depends}, ${python3:Depends} -Suggests: python3-zmq (>= 2.0.10.1) -Description: enhanced interactive Python3 shell +Suggests: ipython3-qtconsole, python3-zmq (>= 2.0.10.1) +Description: enhanced interactive Python 3 shell IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard @@ -79,16 +80,8 @@ verbose and colored traceback reports, auto-parentheses, auto-quoting, and is embeddable in other Python programs. . - This package contains the Python3 variant of ipython. - -Package: ipython-parallel -Depends: ipython (>= 0.12~), ${misc:Depends} -Architecture: all -Priority: extra -Section: oldlibs -Description: transitional dummy package - This is a transitional package and can be safely removed - after the installation is complete. + This package contains the Python 3 variant of ipython terminal shell. + For the qt console install ipython3-qtconsole. Package: ipython-qtconsole Architecture: all @@ -100,7 +93,7 @@ python-zmq (>= 2.0.10.1), ${misc:Depends}, ${python:Depends} -Description: enhanced interactive Python shell +Description: enhanced interactive Python shell - Qt console IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard @@ -123,7 +116,7 @@ python3-zmq (>= 2.0.10.1), ${misc:Depends}, ${python3:Depends} -Description: enhanced interactive Python3 shell +Description: enhanced interactive Python 3 shell - Qt console IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard @@ -140,12 +133,12 @@ Depends: ipython (= ${binary:Version}), libjs-jquery, libjs-jquery-ui, + libjs-mathjax, python-tornado (>= 2.1.0), python-zmq (>= 2.1.4), ${misc:Depends}, ${python:Depends} -Recommends: libjs-mathjax -Description: enhanced interactive Python shell +Description: interactive Python html notebook IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard @@ -161,10 +154,8 @@ Package: ipython-doc Section: doc Architecture: all -Depends: ipython (= ${binary:Version}), ${misc:Depends}, ${sphinxdoc:Depends} -Replaces: ipython-parallel (<< 0.12~20111208~ee40ebe0-2) -Breaks: ipython-parallel(<< 0.12~20111208~ee40ebe0-2) -Description: enhanced interactive Python shell +Depends: ${misc:Depends}, ${sphinxdoc:Depends} +Description: enhanced interactive Python shell - Documentation IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard diff -Nru ipython-0.12/debian/ipython-doc.examples ipython-0.12.1+dfsg/debian/ipython-doc.examples --- ipython-0.12/debian/ipython-doc.examples 2012-01-07 20:56:53.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/ipython-doc.examples 2012-04-22 14:27:04.000000000 +0000 @@ -1,3 +1,4 @@ debian/tmp/usr/share/doc/ipython/examples/core debian/tmp/usr/share/doc/ipython/examples/lib debian/tmp/usr/share/doc/ipython/examples/parallel +debian/tmp/usr/share/doc/ipython/examples/notebooks diff -Nru ipython-0.12/debian/ipython-doc.lintian-overrides ipython-0.12.1+dfsg/debian/ipython-doc.lintian-overrides --- ipython-0.12/debian/ipython-doc.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/ipython-doc.lintian-overrides 2012-04-22 14:27:04.000000000 +0000 @@ -0,0 +1,3 @@ +# I prefer single doc dir over the ability to install -doc without the package +# arch argument does not apply +ipython-doc binary: doc-package-depends-on-main-package diff -Nru ipython-0.12/debian/ipython-notebook.dirs ipython-0.12.1+dfsg/debian/ipython-notebook.dirs --- ipython-0.12/debian/ipython-notebook.dirs 2012-01-07 20:56:53.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/ipython-notebook.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/usr/share/doc/ipython diff -Nru ipython-0.12/debian/ipython-notebook.examples ipython-0.12.1+dfsg/debian/ipython-notebook.examples --- ipython-0.12/debian/ipython-notebook.examples 2012-01-07 20:56:53.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/ipython-notebook.examples 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/share/doc/ipython/examples/notebooks diff -Nru ipython-0.12/debian/README.source ipython-0.12.1+dfsg/debian/README.source --- ipython-0.12/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/README.source 2012-04-22 14:27:04.000000000 +0000 @@ -0,0 +1,10 @@ +Files removed from upstream source: + +Minified javascript without source: +IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js +IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js + +replaced minified +IPython/frontend/html/notebook/static/prettify/prettify.js +with unminified +ipython.git/IPython/frontend/html/notebook/static/unminified/prettify.js diff -Nru ipython-0.12/debian/rules ipython-0.12.1+dfsg/debian/rules --- ipython-0.12/debian/rules 2012-01-08 16:31:59.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/rules 2012-04-22 14:27:04.000000000 +0000 @@ -14,21 +14,27 @@ rm -f test_hist.sqlite if cd $(CURDIR)/docs; then $(MAKE) clean; fi dh_auto_clean + rm -rf $(CURDIR)/build override_dh_auto_build: dh_auto_build -- --executable '/usr/bin/env python' set -e && for pyvers in $(PY3VERS); do \ $$pyvers setup.py build --executable '/usr/bin/env python3'; \ done + # so dh_python2 symlinks the missing stuff + touch IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js + touch IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS))) - PYTHONPATH=$(CURDIR) $(MAKE) -C $(CURDIR)/docs html + HOME=$(CURDIR)/build PYTHONPATH=$(CURDIR) $(MAKE) -C $(CURDIR)/docs html endif override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # IPython.frontend requires X set -e && for pyvers in $(PYVERS); do \ - LC_ALL=C.UTF-8 PATH=$(CURDIR)/IPython/scripts/:$(PATH) PYTHONPATH=$(CURDIR) xvfb-run -s "-screen 0 1280x1024x24 -noreset" \ + LC_ALL=C.UTF-8 HOME=$(CURDIR)/build \ + PATH=$(CURDIR)/IPython/scripts/:$(PATH) PYTHONPATH=$(CURDIR) \ + xvfb-run -s "-screen 0 1280x1024x24 -noreset" \ python$$pyvers $(CURDIR)/IPython/scripts/iptest -v -e test_not_writable_ipdir; \ done endif @@ -115,15 +121,15 @@ dh_installdocs -pipython-doc --link-doc=ipython find $(CURDIR)/debian/ipython -type d -empty -delete - # remove before wheezy release - dh_installdocs -pipython-parallel - rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/ms_visual_studio.png dh_link -pipython-doc usr/share/doc/ipython/html/_static/ms_visual_studio.png \ usr/share/doc/ipython/html/_images/ms_visual_studio.png rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/qtconsole.png dh_link -pipython-doc usr/share/doc/ipython/html/_static/qtconsole.png \ usr/share/doc/ipython/html/_images/qtconsole.png + rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/qtconsole1.png + dh_link -pipython-doc usr/share/doc/ipython/html/_static/qtconsole.png \ + usr/share/doc/ipython/html/_images/qtconsole1.png rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/qtconsole_tabbed.png dh_link -pipython-doc usr/share/doc/ipython/html/_static/qtconsole_tabbed.png \ usr/share/doc/ipython/html/_images/qtconsole_tabbed.png @@ -151,3 +157,20 @@ ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS))) dh_sphinxdoc endif + +VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-\+]+)+(\+dfsg)*.*,\1,p') +COMMIT = $(shell dpkg-parsechangelog | grep Commit | sed -e "s/^\s*Commit //") +get-orig-source: + #git clone --depth 1 git://github.com/ipython/ipython ipython.git + #cd ipython.git && git archive --format=tar --prefix=ipython/ $(COMMIT) | gzip -9 -c > ../ipython_$(VERSION).orig.tar.gz + #rm -rf ipython.git + #tar xfz ipython_$(VERSION).orig.tar.gz + mkdir ipython + uscan --force-download --destdir=. --download-version=$(VERSION) + tar -C ipython -xz -f rel-$(VERSION).tar.gz --strip 1 + rm -f ipython/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js + rm -f ipython/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js + mv ipython/IPython/frontend/html/notebook/static/unminified/prettify.js \ + ipython/IPython/frontend/html/notebook/static/prettify/prettify.js + tar cfz ipython_$(VERSION)+dfsg.orig.tar.gz ipython + rm -rf ipython diff -Nru ipython-0.12/debian/watch ipython-0.12.1+dfsg/debian/watch --- ipython-0.12/debian/watch 2011-11-22 20:44:45.000000000 +0000 +++ ipython-0.12.1+dfsg/debian/watch 2012-04-22 14:27:04.000000000 +0000 @@ -1,3 +1,4 @@ version=3 +opts=dversionmangle=s/\+dfsg// \ http://githubredir.debian.net/github/ipython/ipython /rel-(.*).tar.gz diff -Nru ipython-0.12/docs/examples/notebooks/00_notebook_tour.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/00_notebook_tour.ipynb --- ipython-0.12/docs/examples/notebooks/00_notebook_tour.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/00_notebook_tour.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -40,7 +40,7 @@ "output_type": "pyout", "prompt_number": 1, "text": [ - "u'/home/fperez/ipython/ipython/docs/examples/notebooks'" + "u'/home/fperez/ipython/ipython/docs/examples/notebooks'" ] } ], @@ -157,7 +157,7 @@ "output_type": "stream", "stream": "stderr", "text": [ - "ERROR: File `non_existent_file.py` not found." + "ERROR: File `non_existent_file.py` not found." ] } ], @@ -178,9 +178,9 @@ "evalue": "integer division or modulo by zero", "output_type": "pyerr", "traceback": [ - "---------------------------------------------------------------------------\nZeroDivisionError Traceback (most recent call last)", - "/home/fperez/ipython/ipython/docs/examples/notebooks/<ipython-input-7-dc39888fd1d2> in <module>()\n 1 x = 1\n 2 y = 4\n----> 3 z = y/(1-x)\n", - "ZeroDivisionError: integer division or modulo by zero" + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/home/fperez/ipython/ipython/docs/examples/notebooks/\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" ] } ], @@ -915,8 +915,7 @@ "collapsed": true, "input": [], "language": "python", - "outputs": [], - "prompt_number": " " + "outputs": [] } ] } diff -Nru ipython-0.12/docs/examples/notebooks/01_notebook_introduction.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/01_notebook_introduction.ipynb --- ipython-0.12/docs/examples/notebooks/01_notebook_introduction.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/01_notebook_introduction.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -43,13 +43,13 @@ "outputs": [ { "output_type": "pyout", - "prompt_number": 4, + "prompt_number": 1, "text": [ - "'This is the new IPython notebook'" + "'This is the new IPython notebook'" ] } ], - "prompt_number": 4 + "prompt_number": 1 }, { "cell_type": "markdown", @@ -82,7 +82,7 @@ ] } ], - "prompt_number": 3 + "prompt_number": 2 }, { "cell_type": "markdown", @@ -113,14 +113,14 @@ ] } ], - "prompt_number": 11 + "prompt_number": 3 }, { "cell_type": "markdown", "source": [ "## User interface", "", - "When you start a new notebook server with `ipytyhon notebook`, your", + "When you start a new notebook server with `ipython notebook`, your", "browser should open into the *Dashboard*, a page listing all notebooks", "available in the current directory as well as letting you create new", "notebooks. In this page, you can also drag and drop existing `.py` files", @@ -237,8 +237,7 @@ "list(" ], "language": "python", - "outputs": [], - "prompt_number": " " + "outputs": [] }, { "cell_type": "markdown", @@ -277,32 +276,32 @@ "stream": "stdout", "text": [ "{", - " "stdin_port": 39725, ", - " "ip": "127.0.0.1", ", - " "hb_port": 52883, ", - " "key": "e7b658da-b60b-42f6-b6b0-5098f5d2e533", ", - " "shell_port": 51742, ", - " "iopub_port": 41869", + " \"stdin_port\": 53970, ", + " \"ip\": \"127.0.0.1\", ", + " \"hb_port\": 53971, ", + " \"key\": \"30daac61-6b73-4bae-a7d9-9dca538794d5\", ", + " \"shell_port\": 53968, ", + " \"iopub_port\": 53969", "}", "", "Paste the above JSON into a file, and connect with:", - " $> ipython <app> --existing <file>", + " $> ipython --existing ", "or, if you are local, you can connect with just:", - " $> ipython <app> --existing kernel-faac4917-d0e0-467a-8467-d3c4d86a3ecc.json ", + " $> ipython --existing kernel-dd85d1cc-c335-44f4-bed8-f1a2173a819a.json ", "or even just:", - " $> ipython <app> --existing ", + " $> ipython --existing ", "if this is the most recent IPython session you have started." ] } ], - "prompt_number": 8 + "prompt_number": 4 }, { "cell_type": "markdown", "source": [ "## The kernel's `raw_input` and `%debug`", "", - "The one feature the notebook currently doesn't support as a client is the ability to send data to the kerne's", + "The one feature the notebook currently doesn't support as a client is the ability to send data to the kernel's", "standard input socket. That is, if the kernel requires information to be typed interactively by calling the", "builtin `raw_input` function, the notebook will be blocked. This happens for example if you run a script", "that queries interactively for parameters, and very importantly, is how the interactive IPython debugger that ", @@ -361,14 +360,14 @@ "text": [ "", "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].", - "For more information, type 'help(pylab)'." + "For more information, type 'help(pylab)'." ] }, { "output_type": "pyout", - "prompt_number": 12, + "prompt_number": 5, "text": [ - "[<matplotlib.lines.Line2D at 0x43a2890>]" + "[]" ] }, { @@ -376,7 +375,7 @@ "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD3CAYAAAAXDE8fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztfXuUFdWd7nf63c2jG2hEEEGRNjQan0DjFaFvdJAsos6M\nmkhmnCw0czsmuWASTUImc5XMWomTuXfEMETbleDNqNHJmGRMfA7otO1dCS/HidpAEBFB3k032O9n\n3T+2m7NPnb2r9q7aVbXPOftbq1d3n1N1ap+qvb/66vv99m+nHMdxYGFhYWGRdyhKugEWFhYWFtHA\nEryFhYVFnsISvIWFhUWewhK8hYWFRZ7CEryFhYVFnsISvIWFhUWewpPg77jjDkyZMgWf/OQnhdus\nWbMGs2bNwpVXXondu3drb6CFhYWFRTB4EvzKlSvx0ksvCd/ftm0bXn/9dezYsQP33HMP7rnnHu0N\ntLCwsLAIBk+Cv+aaazBhwgTh+1u3bsUtt9yCiRMnYsWKFdi1a5f2BlpYWFhYBENJmJ23bduG22+/\n/cz/kydPxnvvvYcLLrgga9tUKhXmUBYWFhYFi6AFB0IFWR3HyTqwF5E7joNXX3XwyU86Z/YtxJ/7\n7rsv8TaY8mPPRf6ei/fec1Bdnfy5eP55B7t2JX8+gv6EQSiCb2howM6dO8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HCD4ziFkw7nxh//+EenoaHBufTS\nS51vfOMbTnd3d8Gei8cee8xZvHixM2/ePOe73/2uMzIyUjDn4rbbbnOmTp3qlJWVOdOnT3c2btzo\n+d3XrVvnXHDBBU59fb3T2trq+/kpxylgs8vCwsIij2GDrBYWFhZ5CkvwFhYWFnkKS/AWFhYWeQpL\n8BYWFhZ5CkvwFhYWFnkKS/AWFhYWeYr/D/Y0b3ewfmEHAAAAAElFTkSuQmCC\n" } ], - "prompt_number": 12 + "prompt_number": 5 }, { "cell_type": "markdown", @@ -412,8 +411,7 @@ "collapsed": true, "input": [], "language": "python", - "outputs": [], - "prompt_number": " " + "outputs": [] } ] } diff -Nru ipython-0.12/docs/examples/notebooks/display_protocol.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/display_protocol.ipynb --- ipython-0.12/docs/examples/notebooks/display_protocol.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/display_protocol.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -44,9 +44,9 @@ }, { "cell_type": "code", - "collapsed": true, + "collapsed": false, "input": [ - "from IPython.lib.pylabtools import print_figure", + "from IPython.core.pylabtools import print_figure", "from IPython.core.display import Image, SVG, Math", "", "class Gaussian(object):", @@ -272,7 +272,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 11 + "prompt_number": 9 }, { "cell_type": "markdown", @@ -288,7 +288,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 12 + "prompt_number": 10 }, { "cell_type": "markdown", @@ -307,7 +307,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 13 + "prompt_number": 11 }, { "cell_type": "markdown", @@ -329,7 +329,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 14 + "prompt_number": 12 }, { "cell_type": "markdown", @@ -351,7 +351,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 15 + "prompt_number": 13 }, { "cell_type": "code", @@ -362,7 +362,7 @@ ], "language": "python", "outputs": [], - "prompt_number": 16 + "prompt_number": 14 }, { "cell_type": "code", diff -Nru ipython-0.12/docs/examples/notebooks/formatting.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/formatting.ipynb --- ipython-0.12/docs/examples/notebooks/formatting.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/formatting.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -117,7 +117,7 @@ "collapsed": true, "input": [], "language": "python", - "outputs": [], + "outputs": [], "prompt_number": " " } ] diff -Nru ipython-0.12/docs/examples/notebooks/sympy.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/sympy.ipynb --- ipython-0.12/docs/examples/notebooks/sympy.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/sympy.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -40,7 +40,7 @@ "text": [ "", "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].", - "For more information, type 'help(pylab)'." + "For more information, type 'help(pylab)'." ] } ], @@ -123,7 +123,7 @@ "output_type": "pyout", "prompt_number": 6, "text": [ - "Add(Symbol('x'), Mul(Integer(2), Symbol('y')))" + "Add(Symbol('x'), Mul(Integer(2), Symbol('y')))" ] } ], @@ -317,10 +317,11 @@ "", " b ", " ___ ", - " \\ ` ", - " \\ \u239b n 2\u239e", - " / \u239d2 + 6\u22c5n \u23a0", - " /__, ", + " \u2572 ", + " \u2572 \u239b n 2\u239e", + " \u2571 \u239d2 + 6\u22c5n \u23a0", + " \u2571 ", + " \u203e\u203e\u203e ", "n = a " ] } diff -Nru ipython-0.12/docs/examples/notebooks/trapezoid_rule.ipynb ipython-0.12.1+dfsg/docs/examples/notebooks/trapezoid_rule.ipynb --- ipython-0.12/docs/examples/notebooks/trapezoid_rule.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/notebooks/trapezoid_rule.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -110,8 +110,7 @@ "collapsed": true, "input": [], "language": "python", - "outputs": [], - "prompt_number": " " + "outputs": [] } ] } diff -Nru ipython-0.12/docs/examples/parallel/helloworld.ipynb ipython-0.12.1+dfsg/docs/examples/parallel/helloworld.ipynb --- ipython-0.12/docs/examples/parallel/helloworld.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/parallel/helloworld.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -1,65 +1,92 @@ { - "nbformat": 2, - "metadata": { - "name": "helloworld" + "metadata": { + "name": "helloworld" + }, + "nbformat": 2, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Distributed hello world", + "", + "Originally by Ken Kinder (ken at kenkinder dom com)" + ] }, - "worksheets": [ - { - "cells": [ - { - "source": "# Distributed hello world\n\nOriginally by Ken Kinder (ken at kenkinder dom com)", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 3, - "input": "from IPython.parallel import Client" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 4, - "input": "rc = Client()\nview = rc.load_balanced_view()" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 5, - "input": "def sleep_and_echo(t, msg):\n import time\n time.sleep(t)\n return msg" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 6, - "input": "world = view.apply_async(sleep_and_echo, 3, 'World!')\nhello = view.apply_async(sleep_and_echo, 2, 'Hello')\n" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "text": "Submitted tasks: ['9e533683-d54e-4588-929e-984dd3eb6dc4'] ['90395f15-723f-44df-a743-a5d88cdeb6a0']\nHello" - }, - { - "output_type": "stream", - "text": "World!" - } - ], - "collapsed": false, - "prompt_number": 7, - "input": "print \"Submitted tasks:\", hello.msg_ids, world.msg_ids\nprint hello.get(), world.get()" - } - ] - } - ] + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from IPython.parallel import Client" + ], + "language": "python", + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "rc = Client()", + "view = rc.load_balanced_view()" + ], + "language": "python", + "outputs": [], + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "def sleep_and_echo(t, msg):", + " import time", + " time.sleep(t)", + " return msg" + ], + "language": "python", + "outputs": [], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "world = view.apply_async(sleep_and_echo, 3, 'World!')", + "hello = view.apply_async(sleep_and_echo, 2, 'Hello')" + ], + "language": "python", + "outputs": [], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"Submitted tasks:\", hello.msg_ids, world.msg_ids", + "print hello.get(), world.get()" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Submitted tasks: ['dd1052e0-aa75-4b25-9d35-ecbdaf6e3ed7'] ['1b46aa21-20d1-459c-bc36-2d8d03336f74']", + "Hello" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " World!" + ] + } + ], + "prompt_number": 5 + } + ] + } + ] } \ No newline at end of file diff -Nru ipython-0.12/docs/examples/parallel/parallel_mpi.ipynb ipython-0.12.1+dfsg/docs/examples/parallel/parallel_mpi.ipynb --- ipython-0.12/docs/examples/parallel/parallel_mpi.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/parallel/parallel_mpi.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -1,139 +1,224 @@ { - "worksheets": [ - { - "cells": [ - { - "source": "# Simple usage of a set of MPI engines\n\nThis example assumes you've started a cluster of N engines (4 in this example) as part\nof an MPI world. \n\nOur documentation describes [how to create an MPI profile](http://ipython.org/ipython-doc/dev/parallel/parallel_process.html#using-ipcluster-in-mpiexec-mpirun-mode)\nand explains [basic MPI usage of the IPython cluster](http://ipython.org/ipython-doc/dev/parallel/parallel_mpi.html).\n\n\nFor the simplest possible way to start 4 engines that belong to the same MPI world, \nyou can run this in a terminal or antoher notebook:\n\n
\nipcluster start --engines=MPIExecEngineSetLauncher -n 4\n
\n\nNote: to run the above in a notebook, use a *new* notebook and prepend the command with `!`, but do not run\nit in *this* notebook, as this command will block until you shut down the cluster. To stop the cluster, use \nthe 'Interrupt' button on the left, which is the equivalent of sending `Ctrl-C` to the kernel.\n\nOnce the cluster is running, we can connect to it and open a view into it:", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 21, - "input": "from IPython.parallel import Client\nc = Client()\nview = c[:]" - }, - { - "source": "Let's define a simple function that ", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 22, - "input": "@view.remote(block=True)\ndef mpi_rank():\n from mpi4py import MPI\n comm = MPI.COMM_WORLD\n return comm.Get_rank()" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "pyout", - "prompt_number": 23, - "text": "[3, 0, 2, 1]" - } - ], - "collapsed": false, - "prompt_number": 23, - "input": "mpi_rank()" - }, - { - "source": "For interactive convenience, we load the parallel magic extensions and make this view\nthe active one for the automatic parallelism magics.\n\nThis is not necessary and in production codes likely won't be used, as the engines will \nload their own MPI codes separately. But it makes it easy to illustrate everything from\nwithin a single notebook here.", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 4, - "input": "%load_ext parallelmagic\nview.activate()" - }, - { - "source": "Use the autopx magic to make the rest of this cell execute on the engines instead\nof locally", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 24, - "input": "view.block = True" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": "%autopx enabled\n\n" - } - ], - "collapsed": false, - "prompt_number": 32, - "input": "%autopx" - }, - { - "source": "With autopx enabled, the next cell will actually execute *entirely on each engine*:", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 29, - "input": "from mpi4py import MPI\n\ncomm = MPI.COMM_WORLD\nsize = comm.Get_size()\nrank = comm.Get_rank()\n\nif rank == 0:\n data = [(i+1)**2 for i in range(size)]\nelse:\n data = None\ndata = comm.scatter(data, root=0)\n\nassert data == (rank+1)**2, 'data=%s, rank=%s' % (data, rank)" - }, - { - "source": "Though the assertion at the end of the previous block validated the code, we can now \npull the 'data' variable from all the nodes for local inspection.\nFirst, don't forget to toggle off `autopx` mode so code runs again in the notebook:\n", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": "%autopx disabled\n\n" - } - ], - "collapsed": false, - "prompt_number": 33, - "input": "%autopx" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "pyout", - "prompt_number": 34, - "text": "[16, 1, 9, 4]" - } - ], - "collapsed": false, - "prompt_number": 34, - "input": "view['data']" - }, - { - "input": "", - "cell_type": "code", - "collapsed": true, - "language": "python", - "outputs": [] - } - ] - } - ], - "metadata": { - "name": "parallel_mpi" + "metadata": { + "name": "parallel_mpi" + }, + "nbformat": 2, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Simple usage of a set of MPI engines", + "", + "This example assumes you've started a cluster of N engines (4 in this example) as part", + "of an MPI world. ", + "", + "Our documentation describes [how to create an MPI profile](http://ipython.org/ipython-doc/dev/parallel/parallel_process.html#using-ipcluster-in-mpiexec-mpirun-mode)", + "and explains [basic MPI usage of the IPython cluster](http://ipython.org/ipython-doc/dev/parallel/parallel_mpi.html).", + "", + "", + "For the simplest possible way to start 4 engines that belong to the same MPI world, ", + "you can run this in a terminal or antoher notebook:", + "", + "
", 
+      "ipcluster start --engines=MPI -n 4", 
+      "
", + "", + "Note: to run the above in a notebook, use a *new* notebook and prepend the command with `!`, but do not run", + "it in *this* notebook, as this command will block until you shut down the cluster. To stop the cluster, use ", + "the 'Interrupt' button on the left, which is the equivalent of sending `Ctrl-C` to the kernel.", + "", + "Once the cluster is running, we can connect to it and open a view into it:" + ] }, - "nbformat": 2 + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from IPython.parallel import Client", + "c = Client()", + "view = c[:]" + ], + "language": "python", + "outputs": [], + "prompt_number": 21 + }, + { + "cell_type": "markdown", + "source": [ + "Let's define a simple function that gets the MPI rank from each engine." + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "@view.remote(block=True)", + "def mpi_rank():", + " from mpi4py import MPI", + " comm = MPI.COMM_WORLD", + " return comm.Get_rank()" + ], + "language": "python", + "outputs": [], + "prompt_number": 22 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "mpi_rank()" + ], + "language": "python", + "outputs": [ + { + "output_type": "pyout", + "prompt_number": 23, + "text": [ + "[3, 0, 2, 1]" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "markdown", + "source": [ + "For interactive convenience, we load the parallel magic extensions and make this view", + "the active one for the automatic parallelism magics.", + "", + "This is not necessary and in production codes likely won't be used, as the engines will ", + "load their own MPI codes separately. But it makes it easy to illustrate everything from", + "within a single notebook here." + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "%load_ext parallelmagic", + "view.activate()" + ], + "language": "python", + "outputs": [], + "prompt_number": 4 + }, + { + "cell_type": "markdown", + "source": [ + "Use the autopx magic to make the rest of this cell execute on the engines instead", + "of locally" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "view.block = True" + ], + "language": "python", + "outputs": [], + "prompt_number": 24 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%autopx" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "%autopx enabled" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "markdown", + "source": [ + "With autopx enabled, the next cell will actually execute *entirely on each engine*:" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from mpi4py import MPI", + "", + "comm = MPI.COMM_WORLD", + "size = comm.Get_size()", + "rank = comm.Get_rank()", + "", + "if rank == 0:", + " data = [(i+1)**2 for i in range(size)]", + "else:", + " data = None", + "data = comm.scatter(data, root=0)", + "", + "assert data == (rank+1)**2, 'data=%s, rank=%s' % (data, rank)" + ], + "language": "python", + "outputs": [], + "prompt_number": 29 + }, + { + "cell_type": "markdown", + "source": [ + "Though the assertion at the end of the previous block validated the code, we can now ", + "pull the 'data' variable from all the nodes for local inspection.", + "First, don't forget to toggle off `autopx` mode so code runs again in the notebook:" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%autopx" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "%autopx disabled" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "view['data']" + ], + "language": "python", + "outputs": [ + { + "output_type": "pyout", + "prompt_number": 34, + "text": [ + "[16, 1, 9, 4]" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "code", + "collapsed": true, + "input": [], + "language": "python", + "outputs": [] + } + ] + } + ] } \ No newline at end of file diff -Nru ipython-0.12/docs/examples/parallel/taskmap.ipynb ipython-0.12.1+dfsg/docs/examples/parallel/taskmap.ipynb --- ipython-0.12/docs/examples/parallel/taskmap.ipynb 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/parallel/taskmap.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -1,71 +1,109 @@ { - "nbformat": 2, - "metadata": { - "name": "taskmap" + "metadata": { + "name": "taskmap" + }, + "nbformat": 2, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Load balanced map and parallel function decorator" + ] }, - "worksheets": [ - { - "cells": [ - { - "source": "# Load balanced map and parallel function decorator", - "cell_type": "markdown" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 4, - "input": "from IPython.parallel import Client" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [], - "collapsed": true, - "prompt_number": 5, - "input": "rc = Client()\nv = rc.load_balanced_view()" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "text": "Simple, default map: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" - } - ], - "collapsed": false, - "prompt_number": 6, - "input": "result = v.map(lambda x: 2*x, range(10))\nprint \"Simple, default map: \", list(result)" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "text": "Submitted tasks, got ids: ['2a25ff3f-f0d0-4428-909a-3fe808ca61f9', 'edd42168-fac2-4b3f-a696-ce61b37aa71d', '8a548908-7812-44e6-a8b1-68e941bee608', '26435a77-fe86-49b6-b59f-de864d59c99f', '6750c7b4-2168-49ec-bcc4-feb1e17c5e53', '117240d1-5dfc-4783-948f-e9523b2b2f6a', '6de16d46-f2e2-49bd-8180-e43d1d875529', '3d372b84-0c68-4315-92c8-a080c68478b7', '43acedae-e35c-4a17-87f0-9e5e672500f7', 'eb71dd1f-9500-4375-875d-c2c42999848c']\nUsing a mapper: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" - } - ], - "collapsed": false, - "prompt_number": 7, - "input": "ar = v.map_async(lambda x: 2*x, range(10))\nprint \"Submitted tasks, got ids: \", ar.msg_ids\nresult = ar.get()\nprint \"Using a mapper: \", result" - }, - { - "cell_type": "code", - "language": "python", - "outputs": [ - { - "output_type": "stream", - "text": "Using a parallel function: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" - } - ], - "collapsed": false, - "prompt_number": 8, - "input": "@v.parallel(block=True)\ndef f(x): return 2*x\n\nresult = f.map(range(10))\nprint \"Using a parallel function: \", result" - } - ] - } - ] + { + "cell_type": "code", + "collapsed": true, + "input": [ + "from IPython.parallel import Client" + ], + "language": "python", + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rc = Client()", + "v = rc.load_balanced_view()" + ], + "language": "python", + "outputs": [], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "result = v.map(lambda x: 2*x, range(10))", + "print \"Simple, default map: \", list(result)" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Simple, default map: " + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ar = v.map_async(lambda x: 2*x, range(10))", + "print \"Submitted tasks, got ids: \", ar.msg_ids", + "result = ar.get()", + "print \"Using a mapper: \", result" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Submitted tasks, got ids: ['5100a4c7-73a4-4832-aa91-e774f6f3ede8', 'd0cae1cf-2b32-4092-9eb7-f17b43fb3849', 'e08d3ee2-f221-47fe-9556-ed938e692030', '065585e4-cdf9-4240-a5fe-e44b2ae5d023', 'd2162f23-68e5-4318-ba1e-e34fd03a72ac', '5b3b835f-2099-4a70-9896-d1aa810c77e6', 'e2c2a823-bd44-4f91-8db3-c154d0d86e56', '991e0c25-f98a-44b5-9d9e-889d4180b9a5', '4ad41221-28bd-482f-a300-97c404648161', '5b730eb3-e0bb-4cdd-b228-c3b8d158828a']", + "Using a mapper: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "@v.parallel(block=True)", + "def f(x): return 2*x", + "", + "result = f.map(range(10))", + "print \"Using a parallel function: \", result" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Using a parallel function: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]" + ] + } + ], + "prompt_number": 6 + } + ] + } + ] } \ No newline at end of file diff -Nru ipython-0.12/docs/examples/tests/heartbeat/gilsleep.ipynb ipython-0.12.1+dfsg/docs/examples/tests/heartbeat/gilsleep.ipynb --- ipython-0.12/docs/examples/tests/heartbeat/gilsleep.ipynb 1970-01-01 00:00:00.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/tests/heartbeat/gilsleep.ipynb 2012-04-22 05:10:27.000000000 +0000 @@ -0,0 +1,56 @@ +{ + "metadata": { + "name": "gilsleep" + }, + "nbformat": 2, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "source": [ + "Holding the GIL for too long could disrupt the heartbeat due to non-copying sends.", + "", + "The following cell repeatedly calls a function that holds the GIL for five seconds.", + "", + "The heartbeat will fail after a few iterations prior to fixing Issue [#1260](https://github.com/ipython/ipython/issues/1260)." + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import sys", + "import time", + "", + "from cython import inline", + "", + "def gilsleep(t):", + " \"\"\"gil-holding sleep with cython.inline\"\"\"", + " code = '\\n'.join([", + " 'from posix cimport unistd',", + " 'unistd.sleep(t)',", + " ])", + " while True:", + " inline(code, quiet=True, t=t)", + " print time.time()", + " sys.stdout.flush() # this is important", + "", + "gilsleep(5)" + ], + "language": "python", + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": true, + "input": [], + "language": "python", + "outputs": [], + "prompt_number": " " + } + ] + } + ] +} \ No newline at end of file diff -Nru ipython-0.12/docs/examples/tests/heartbeat/hb_gil.py ipython-0.12.1+dfsg/docs/examples/tests/heartbeat/hb_gil.py --- ipython-0.12/docs/examples/tests/heartbeat/hb_gil.py 1970-01-01 00:00:00.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/examples/tests/heartbeat/hb_gil.py 2012-04-22 05:10:27.000000000 +0000 @@ -0,0 +1,31 @@ +""" +Run this script in the qtconsole with one of: + + %loadpy hb_gil.py + +or + %run hb_gil.py + +Holding the GIL for too long could disrupt the heartbeat. + +See Issue #1260: https://github.com/ipython/ipython/issues/1260 + +""" + +import sys +import time + +from cython import inline + +def gilsleep(t): + """gil-holding sleep with cython.inline""" + code = '\n'.join([ + 'from posix cimport unistd', + 'unistd.sleep(t)', + ]) + while True: + inline(code, quiet=True, t=t) + print time.time() + sys.stdout.flush() # this is important + +gilsleep(5) diff -Nru ipython-0.12/docs/gh-pages.py ipython-0.12.1+dfsg/docs/gh-pages.py --- ipython-0.12/docs/gh-pages.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/gh-pages.py 2012-04-22 05:10:27.000000000 +0000 @@ -104,14 +104,16 @@ # sh('make html') if tag != 'dev': # only build pdf for non-dev targets - sh2('make pdf') + #sh2('make pdf') + pass # This is pretty unforgiving: we unconditionally nuke the destination # directory, and then copy the html tree in there shutil.rmtree(dest, ignore_errors=True) shutil.copytree(html_dir, dest) if tag != 'dev': - shutil.copy(pjoin(pdf_dir, 'ipython.pdf'), pjoin(dest, 'ipython.pdf')) + #shutil.copy(pjoin(pdf_dir, 'ipython.pdf'), pjoin(dest, 'ipython.pdf')) + pass try: cd(pages_dir) diff -Nru ipython-0.12/docs/source/development/messaging.txt ipython-0.12.1+dfsg/docs/source/development/messaging.txt --- ipython-0.12/docs/source/development/messaging.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/development/messaging.txt 2012-04-22 05:10:27.000000000 +0000 @@ -144,9 +144,9 @@ # Source code to be executed by the kernel, one or more lines. 'code' : str, - # A boolean flag which, if True, signals the kernel to execute this - # code as quietly as possible. This means that the kernel will compile - # the code witIPython/core/tests/h 'exec' instead of 'single' (so + # A boolean flag which, if True, signals the kernel to execute + # this code as quietly as possible. This means that the kernel + # will compile the code with 'exec' instead of 'single' (so # sys.displayhook will not fire), and will *not*: # - broadcast exceptions on the PUB socket # - do any logging diff -Nru ipython-0.12/docs/source/development/release.txt ipython-0.12.1+dfsg/docs/source/development/release.txt --- ipython-0.12/docs/source/development/release.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/development/release.txt 2012-04-22 05:10:27.000000000 +0000 @@ -26,8 +26,7 @@ installer. It posts them to the site and registers the release with PyPI. #. Update the website with announcements and links to the updated changes.txt - in html form. Remember to put a short note both on the news page of the - site and on Launcphad. + in html form. Remember to put a short note on the news page of the site. #. Drafting a short release announcement with i) highlights and ii) a link to the html version of the :ref:`Whats new ` section of the @@ -43,4 +42,4 @@ - Run ``git add`` for all the new files and commit. - Run ``git push`` to update the public version of the docs on gh-pages. -#. Celebrate! \ No newline at end of file +#. Celebrate! diff -Nru ipython-0.12/docs/source/install/install.txt ipython-0.12.1+dfsg/docs/source/install/install.txt --- ipython-0.12/docs/source/install/install.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/install/install.txt 2012-04-22 05:10:27.000000000 +0000 @@ -7,7 +7,6 @@ install them separately. However, to use a given subpackage, you will need to install all of its dependencies. - Please let us know if you have problems installing IPython or any of its dependencies. Officially, IPython requires Python 2.6, 2.7, 3.1, or 3.2. @@ -17,38 +16,39 @@ longer work on Python <= 2.5. You can find older versions of IPython which supported Python <= 2.5 `here `_ -Some of the installation approaches use the :mod:`setuptools` package and its +Some of the installation approaches use the :mod:`distribute` package and its :command:`easy_install` command line program. In many scenarios, this provides -the most simple method of installing IPython and its dependencies. It is not -required though. More information about :mod:`setuptools` can be found on its -website. +the most simple method of installing IPython and its dependencies. More +information about :mod:`distribute` can be found on its website. .. note:: - On Windows, IPython *does* depend on :mod:`setuptools`, and it is recommended - that you install the :mod:`distribute` package, which improves - :mod:`setuptools` and fixes various bugs. Installing on Python 3 requires - :mod:`distribute` on all platforms. - - We hope to remove this dependency in the future. + On Windows, IPython has a hard dependency on :mod:`distribute`. We hope to + change this in the future, but for now on Windows, you *must* install + :mod:`distribute`. More general information about installing Python packages can be found in -Python's documentation at http://www.python.org/doc/. +`Python's documentation `_. + Quickstart ========== -If you have :mod:`setuptools` installed and you are on OS X or Linux (not +If you have :mod:`distribute` installed and you are on OS X or Linux (not Windows), the following will download and install IPython *and* the main optional dependencies: .. code-block:: bash - $ easy_install ipython[zmq,test] + $ easy_install ipython[zmq,qtconsole,notebook,test] -This will get pyzmq, which is needed for -IPython's parallel computing features as well as the nose package, which will -enable you to run IPython's test suite. +This will get: + +- pyzmq, needed for IPython's parallel computing features, qt console and + notebook. +- pygments, used by the Qt console for syntax highlighting. +- tornado, needed by the web-based notebook +- nose, used by the test suite. To run IPython's test suite, use the :command:`iptest` command: @@ -56,8 +56,7 @@ $ iptest -Read on for more specific details and instructions for Windows. - + Installing IPython itself ========================= @@ -66,15 +65,16 @@ (particularly on Windows and OS X), don't come with a working :mod:`readline` module. The IPython shell will work without :mod:`readline`, but will lack many features that users depend on, such as tab completion and command line -editing. If you install IPython with :mod:`setuptools`, (e.g. with `easy_install`), -then the appropriate :mod:`readline` for your platform will be installed. -See below for details of how to make sure you have a working :mod:`readline`. +editing. If you install IPython with :mod:`distribute`, (e.g. with +`easy_install`), then the appropriate :mod:`readline` for your platform will be +installed. See below for details of how to make sure you have a working +:mod:`readline`. Installation using easy_install ------------------------------- -If you have :mod:`setuptools` installed, the easiest way of getting IPython is -to simple use :command:`easy_install`: +If you have :mod:`distribute` installed, the easiest way of getting IPython is +to simply use :command:`easy_install`: .. code-block:: bash @@ -101,24 +101,22 @@ Windows ------- -.. note:: - - On Windows, IPython requires :mod:`setuptools` or :mod:`distribute`. - - We hope to remove this dependency in the future. - -There are a few caveats for Windows users. The main issue is that a basic -``python setup.py install`` approach won't create ``.bat`` file or Start Menu -shortcuts, which most users want. To get an installation with these, you can -use any of the following alternatives: - -1. Install using :command:`easy_install`. - -2. Install using our binary ``.exe`` Windows installer, which can be found - `here `_ - -3. Install from source, but using :mod:`setuptools` (``python setupegg.py - install``). +As mentioned above, on Windows, IPython requires :mod:`distribute`, and it also +requires the PyReadline library to properly support coloring and keyboard +management (features that the default windows console doesn't have). So on +Windows, the installation procedure is: + +1. Install `distribute `_. + +2. Install `pyreadline `_. You can use + the command ``easy_install pyreadline`` from a terminal, or the binary + installer appropriate for your platform from the PyPI page. + +3. Install IPython itself, which you can download from `PyPI + `_ or from `our site + `_. Note that on Windows 7, you *must* + right-click and 'Run as administrator' for the Start menu shortcuts to be + created. IPython by default runs in a terminal window, but the normal terminal application supplied by Microsoft Windows is very primitive. You may want to @@ -129,14 +127,6 @@ .. _Console: http://sourceforge.net/projects/console -Note for Windows 64 bit users: you may have difficulties with the stock -installer on 64 bit systems; in this case (since we currently do not have 64 -bit builds of the Windows installer) your best bet is to install from source -with the setuptools method indicated in #3 above. See `this bug report`_ for -further details. - -.. _this bug report: https://bugs.launchpad.net/ipython/+bug/382214 - Installing the development version ---------------------------------- @@ -151,11 +141,8 @@ $ cd ipython $ python setup.py install -Again, this last step on Windows won't create ``.bat`` files or Start Menu -shortcuts, so you will have to use one of the other approaches listed above. - Some users want to be able to follow the development branch as it changes. If -you have :mod:`setuptools` installed, this is easy. Simply replace the last +you have :mod:`distribute` installed, this is easy. Simply replace the last step by: .. code-block:: bash @@ -170,6 +157,7 @@ $ git pull + Basic optional dependencies =========================== @@ -186,33 +174,24 @@ readline -------- -In principle, all Python distributions should come with a working -:mod:`readline` module. But, reality is not quite that simple. There are two -common situations where you won't have a working :mod:`readline` module: - -* If you are using the built-in Python on Mac OS X. - -* If you are running Windows, which doesn't have a :mod:`readline` module. - -When IPython is installed with :mod:`setuptools`, (e.g. with `easy_install`), -readline is added as a dependency on OS X, and PyReadline on Windows, and will -be installed on your system. However, if you do not use setuptools, you may -have to install one of these packages yourself. - -On OS X, the built-in Python doesn't not have :mod:`readline` because of -license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has -a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9, -many of the issues related to the differences between readline and libedit seem -to have been resolved. While you may find libedit sufficient, we have -occasional reports of bugs with it and several developers who use OS X as their -main environment consider libedit unacceptable for productive, regular use with -IPython. +As indicated above, on Windows, PyReadline is a *mandatory* dependency. +PyReadline is a separate, Windows only implementation of readline that uses +native Windows calls through :mod:`ctypes`. The easiest way of installing +PyReadline is you use the binary installer available `here +`_. + +On OSX, if you are using the built-in Python shipped by Apple, you will be +missing a full readline implementation as Apple ships instead a library called +``libedit`` that provides only some of readline's functionality. While you may +find libedit sufficient, we have occasional reports of bugs with it and several +developers who use OS X as their main environment consider libedit unacceptable +for productive, regular use with IPython. Therefore, we *strongly* recommend that on OS X you get the full :mod:`readline` module. We will *not* consider completion/history problems to be bugs for IPython if you are using libedit. -To get a working :mod:`readline` module, just do (with :mod:`setuptools` +To get a working :mod:`readline` module, just do (with :mod:`distribute` installed): .. code-block:: bash @@ -225,14 +204,11 @@ python.org binaries) already have readline installed so you likely don't have to do this step. -If needed, the readline egg can be build and installed from source (see the -wiki page at -http://web.archive.org/web/20090614162410/ipython.scipy.org/moin/InstallationOSXLeopard). - -On Windows, you will need the PyReadline module. PyReadline is a separate, -Windows only implementation of readline that uses native Windows calls through -:mod:`ctypes`. The easiest way of installing PyReadline is you use the binary -installer available `here `_. +When IPython is installed with :mod:`distribute`, (e.g. using the +``easy_install`` command), readline is added as a dependency on OS X, and +PyReadline on Windows, and will be installed on your system. However, if you +do not use distribute, you may have to install one of these packages yourself. + nose ---- @@ -281,13 +257,12 @@ :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`, which uses ZeroMQ for all communication. -IPython.parallel provides a nice architecture for parallel computing. The -main focus of this architecture is on interactive parallel computing. These -features require just one package: PyZMQ. See the next section for PyZMQ -details. +IPython.parallel provides a nice architecture for parallel computing, with a +focus on fluid interactive workflows. These features require just one package: +PyZMQ. See the next section for PyZMQ details. On a Unix style platform (including OS X), if you want to use -:mod:`setuptools`, you can just do: +:mod:`distribute`, you can just do: .. code-block:: bash @@ -346,8 +321,8 @@ pyzmq ----- -Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console` packages, -the HTML notebook requires ZeroMQ and PyZMQ. +Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console` +packages, the HTML notebook requires ZeroMQ and PyZMQ. Tornado ------- @@ -370,8 +345,9 @@ from IPython.external.mathjax import install_mathjax install_mathjax() -This function does require write access to the IPython install directory, so if you -have a system-wide Python install, it may need to be done from a ``sudo python`` session. +This function does require write access to the IPython install directory, so if +you have a system-wide Python install, it may need to be done from a ``sudo +python`` session. Browser Compatibility --------------------- diff -Nru ipython-0.12/docs/source/parallel/parallel_task.txt ipython-0.12.1+dfsg/docs/source/parallel/parallel_task.txt --- ipython-0.12/docs/source/parallel/parallel_task.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/parallel/parallel_task.txt 2012-04-22 05:10:27.000000000 +0000 @@ -404,6 +404,31 @@ Pick two engines at random using the number of outstanding tasks as inverse weights, and use the one with the lower load. +Greedy Assignment +----------------- + +Tasks are assigned greedily as they are submitted. If their dependencies are +met, they will be assigned to an engine right away, and multiple tasks can be +assigned to an engine at a given time. This limit is set with the +``TaskScheduler.hwm`` (high water mark) configurable: + +.. sourcecode:: python + + # the most common choices are: + c.TaskSheduler.hwm = 0 # (minimal latency, default) + # or + c.TaskScheduler.hwm = 1 # (most-informed balancing) + +The default is 0, or no-limit. That is, there is no limit to the number of +tasks that can be outstanding on a given engine. This greatly benefits the +latency of execution, because network traffic can be hidden behind computation. +However, this means that workload is assigned without knowledge of how long +each task might take, and can result in poor load-balancing, particularly for +submitting a collection of heterogeneous tasks all at once. You can limit this +effect by setting hwm to a positive integer, 1 being maximum load-balancing (a +task will never be waiting if there is an idle engine), and any larger number +being a compromise between load-balance and latency-hiding. + Pure ZMQ Scheduler ------------------ diff -Nru ipython-0.12/docs/source/whatsnew/github-stats-0.12.txt ipython-0.12.1+dfsg/docs/source/whatsnew/github-stats-0.12.txt --- ipython-0.12/docs/source/whatsnew/github-stats-0.12.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/whatsnew/github-stats-0.12.txt 2012-04-22 05:10:27.000000000 +0000 @@ -3,6 +3,98 @@ Issues closed in the 0.12 development cycle =========================================== +Issues closed in 0.12.1 +----------------------- + +GitHub stats for bugfix release 0.12.1 (12/28/2011-04/16/2012), backporting +pull requests from 0.13. + +We closed a total of 71 issues: 44 pull requests and 27 issues; this is the +full list (generated with the script `tools/github_stats.py`). + +This list is automatically generated, and may be incomplete: + +Pull Requests (44): + +* :ghpull:`1175`: core.completer: Clean up excessive and unused code. +* :ghpull:`1187`: misc notebook: connection file cleanup, first heartbeat, startup flush +* :ghpull:`1190`: Fix link to Chris Fonnesbeck blog post about 0.11 highlights. +* :ghpull:`1196`: docs: looks like a file path might have been accidentally pasted in the middle of a word +* :ghpull:`1206`: don't preserve fixConsole output in json +* :ghpull:`1207`: fix loadpy duplicating newlines +* :ghpull:`1213`: BUG: Minor typo in history_console_widget.py +* :ghpull:`1218`: Added -q option to %prun for suppression of the output, along with editing the dochelp string. +* :ghpull:`1222`: allow Reference as callable in map/apply +* :ghpull:`1229`: Fix display of SyntaxError in Python 3 +* :ghpull:`1246`: Skip tests that require X, when importing pylab results in RuntimeError. +* :ghpull:`1253`: set auto_create flag for notebook apps +* :ghpull:`1257`: use self.kernel_manager_class in qtconsoleapp +* :ghpull:`1262`: Heartbeat no longer shares the app's Context +* :ghpull:`1283`: HeartMonitor.period should be an Integer +* :ghpull:`1284`: a fix for GH 1269 +* :ghpull:`1289`: Make autoreload extension work on Python 3. +* :ghpull:`1306`: Fix %prun input parsing for escaped characters (closes #1302) +* :ghpull:`1312`: minor heartbeat tweaks +* :ghpull:`1318`: make Ctrl-D in qtconsole act same as in terminal (ready to merge) +* :ghpull:`1341`: Don't attempt to tokenize binary files for tracebacks +* :ghpull:`1353`: Save notebook as script using unicode file handle. +* :ghpull:`1363`: Fix some minor color/style config issues in the qtconsole +* :ghpull:`1364`: avoid jsonlib returning Decimal +* :ghpull:`1369`: load header with engine id when engine dies in TaskScheduler +* :ghpull:`1370`: allow draft76 websockets (Safari) +* :ghpull:`1374`: remove calls to meaningless ZMQStream.on_err +* :ghpull:`1377`: Saving non-ascii history +* :ghpull:`1396`: Fix for %tb magic. +* :ghpull:`1402`: fix symlinked /home issue for FreeBSD +* :ghpull:`1413`: get_home_dir expands symlinks, adjust test accordingly +* :ghpull:`1414`: ignore errors in shell.var_expand +* :ghpull:`1430`: Fix for tornado check for tornado < 1.1.0 +* :ghpull:`1445`: Don't build sphinx docs for sdists +* :ghpull:`1463`: Fix completion when importing modules in the cwd. +* :ghpull:`1477`: fix dangling `buffer` in IPython.parallel.util +* :ghpull:`1495`: BUG: Fix pretty-printing for overzealous objects +* :ghpull:`1496`: BUG: LBYL when clearing the output history on shutdown. +* :ghpull:`1514`: DOC: Fix references to IPython.lib.pretty instead of the old location +* :ghpull:`1517`: Fix indentation bug in IPython/lib/pretty.py +* :ghpull:`1538`: store git commit hash in utils._sysinfo instead of hidden data file +* :ghpull:`1599`: Fix for %run -d in Python 3 +* :ghpull:`1602`: Fix %env for Python 3 +* :ghpull:`1607`: cleanup sqlitedb temporary db file after tests + +Issues (27): + +* :ghissue:`676`: IPython.embed() from ipython crashes twice on exit +* :ghissue:`846`: Autoreload extension doesn't work with Python 3.2 +* :ghissue:`1187`: misc notebook: connection file cleanup, first heartbeat, startup flush +* :ghissue:`1191`: profile/startup files not executed with "notebook" +* :ghissue:`1197`: Interactive shell trying to: from ... import history +* :ghissue:`1198`: Kernel Has Died error in Notebook +* :ghissue:`1201`: %env magic fails with Python 3.2 +* :ghissue:`1204`: double newline from %loadpy in python notebook (at least on mac) +* :ghissue:`1208`: should dv.sync_import print failed imports ? +* :ghissue:`1225`: SyntaxError display broken in Python 3 +* :ghissue:`1232`: Dead kernel loop +* :ghissue:`1241`: When our debugger class is used standalone `_oh` key errors are thrown +* :ghissue:`1254`: typo in notebooklist.js breaks links +* :ghissue:`1260`: heartbeat failure on long gil-holding operation +* :ghissue:`1268`: notebook %reset magic fails with StdinNotImplementedError +* :ghissue:`1269`: Another strange input handling error +* :ghissue:`1281`: in Hub: registration_timeout must be an integer, but heartmonitor.period is CFloat +* :ghissue:`1302`: Input parsing with %prun clobbers escapes +* :ghissue:`1304`: controller/server load can disrupt heartbeat +* :ghissue:`1317`: Very slow traceback construction from Cython extension +* :ghissue:`1345`: notebook can't save unicode as script +* :ghissue:`1375`: %history -g -f file encoding issue +* :ghissue:`1401`: numpy arrays cannot be used with View.apply() in Python 3 +* :ghissue:`1408`: test_get_home_dir_3 failed on Mac OS X +* :ghissue:`1412`: Input parsing issue with %prun +* :ghissue:`1421`: ipython32 %run -d breaks with NameError name 'execfile' is not defined +* :ghissue:`1484`: unhide .git_commit_info.ini + + +Issues closed in 0.12 +--------------------- + In this cycle, from August 1 to December 28 2011, we closed a total of 515 issues, 257 pull requests and 258 regular issues; this is the full list (generated with the script `tools/github_stats.py`). diff -Nru ipython-0.12/docs/source/whatsnew/index.txt ipython-0.12.1+dfsg/docs/source/whatsnew/index.txt --- ipython-0.12/docs/source/whatsnew/index.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/whatsnew/index.txt 2012-04-22 05:10:27.000000000 +0000 @@ -20,6 +20,7 @@ .. toctree:: :maxdepth: 1 + development version0.12 github-stats-0.12 version0.11 diff -Nru ipython-0.12/docs/source/whatsnew/version0.11.txt ipython-0.12.1+dfsg/docs/source/whatsnew/version0.11.txt --- ipython-0.12/docs/source/whatsnew/version0.11.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/whatsnew/version0.11.txt 2012-04-22 05:10:27.000000000 +0000 @@ -29,7 +29,7 @@ read it as it provides an illustrated, high-level overview complementing the detailed feature breakdown in this document. -.. __: http://stronginference.com/weblog/2011/7/15/innovations-in-ipython.html +.. __: http://fonnesbeck.calepin.co/innovations-in-ipython.html A quick summary of the major changes (see below for details): diff -Nru ipython-0.12/docs/source/whatsnew/version0.12.txt ipython-0.12.1+dfsg/docs/source/whatsnew/version0.12.txt --- ipython-0.12/docs/source/whatsnew/version0.12.txt 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/docs/source/whatsnew/version0.12.txt 2012-04-22 05:10:27.000000000 +0000 @@ -2,6 +2,15 @@ 0.12 Series ============= +Release 0.12.1 +============== + +IPython 0.12.1 is a bugfix release of 0.12, pulling only bugfixes and minor +cleanup from 0.13, timed for the Ubuntu 12.04 LTS release. + +See the :ref:`list of fixed issues ` for specific backported issues. + + Release 0.12 ============ diff -Nru ipython-0.12/IPython/core/completerlib.py ipython-0.12.1+dfsg/IPython/core/completerlib.py --- ipython-0.12/IPython/core/completerlib.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/completerlib.py 2012-04-22 05:10:27.000000000 +0000 @@ -61,6 +61,9 @@ Return the list containing the names of the modules available in the given folder. """ + # sys.path has the cwd as an empty string, but isdir/listdir need it as '.' + if path == '': + path = '.' if os.path.isdir(path): folder_list = os.listdir(path) diff -Nru ipython-0.12/IPython/core/completer.py ipython-0.12.1+dfsg/IPython/core/completer.py --- ipython-0.12/IPython/core/completer.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/completer.py 2012-04-22 05:10:27.000000000 +0000 @@ -130,19 +130,6 @@ return "".join([(ch in PROTECTABLES and '\\' + ch or ch) for ch in s]) - -def mark_dirs(matches): - """Mark directories in input list by appending '/' to their names.""" - out = [] - isdir = os.path.isdir - for x in matches: - if isdir(x): - out.append(x+'/') - else: - out.append(x) - return out - - def expand_user(path): """Expand '~'-style usernames in strings. @@ -191,28 +178,6 @@ else: return path - -def single_dir_expand(matches): - "Recursively expand match lists containing a single dir." - - if len(matches) == 1 and os.path.isdir(matches[0]): - # Takes care of links to directories also. Use '/' - # explicitly, even under Windows, so that name completions - # don't end up escaped. - d = matches[0] - if d[-1] in ['/','\\']: - d = d[:-1] - - subdirs = os.listdir(d) - if subdirs: - matches = [ (d + '/' + p) for p in subdirs] - return single_dir_expand(matches) - else: - return matches - else: - return matches - - class Bunch(object): pass DELIMS = ' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?' @@ -604,7 +569,10 @@ protect_filename(f) for f in m0] #io.rprint('mm', matches) # dbg - return mark_dirs(matches) + + # Mark directories in input list by appending '/' to their names. + matches = [x+'/' if os.path.isdir(x) else x for x in matches] + return matches def magic_matches(self, text): """Match magics""" diff -Nru ipython-0.12/IPython/core/displayhook.py ipython-0.12.1+dfsg/IPython/core/displayhook.py --- ipython-0.12/IPython/core/displayhook.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/displayhook.py 2012-04-22 05:10:27.000000000 +0000 @@ -252,7 +252,11 @@ try: del self.shell.user_ns[key] except: pass - self.shell.user_ns['_oh'].clear() + # In some embedded circumstances, the user_ns doesn't have the + # '_oh' key set up. + oh = self.shell.user_ns.get('_oh', None) + if oh is not None: + oh.clear() # Release our own references to objects: self._, self.__, self.___ = '', '', '' diff -Nru ipython-0.12/IPython/core/formatters.py ipython-0.12.1+dfsg/IPython/core/formatters.py --- ipython-0.12/IPython/core/formatters.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/formatters.py 2012-04-22 05:10:27.000000000 +0000 @@ -319,9 +319,9 @@ class PlainTextFormatter(BaseFormatter): """The default pretty-printer. - This uses :mod:`IPython.external.pretty` to compute the format data of + This uses :mod:`IPython.lib.pretty` to compute the format data of the object. If the object cannot be pretty printed, :func:`repr` is used. - See the documentation of :mod:`IPython.external.pretty` for details on + See the documentation of :mod:`IPython.lib.pretty` for details on how to write pretty printers. Here is a simple example:: def dtype_pprinter(obj, p, cycle): @@ -412,7 +412,7 @@ numpy.set_printoptions(precision=8) self.float_format = fmt - # Use the default pretty printers from IPython.external.pretty. + # Use the default pretty printers from IPython.lib.pretty. def _singleton_printers_default(self): return pretty._singleton_pprinters.copy() diff -Nru ipython-0.12/IPython/core/history.py ipython-0.12.1+dfsg/IPython/core/history.py --- ipython-0.12/IPython/core/history.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/history.py 2012-04-22 05:10:27.000000000 +0000 @@ -15,6 +15,7 @@ # Stdlib imports import atexit import datetime +from io import open as io_open import os import re try: @@ -24,6 +25,7 @@ import threading # Our own packages +from IPython.core.error import StdinNotImplementedError from IPython.config.configurable import Configurable from IPython.external.decorator import decorator from IPython.testing.skipdoctest import skip_doctest @@ -761,8 +763,10 @@ the default is the last 10 lines. -f FILENAME: instead of printing the output to the screen, redirect it to - the given file. The file is always overwritten, though IPython asks for - confirmation first if it already exists. + the given file. The file is always overwritten, though *when it can*, + IPython asks for confirmation first. In particular, running the command + "history -f FILENAME" from the IPython Notebook interface will replace + FILENAME even if it already exists *without* confirmation. Examples -------- @@ -797,11 +801,15 @@ close_at_end = False else: if os.path.exists(outfname): - if not io.ask_yes_no("File %r exists. Overwrite?" % outfname): + try: + ans = io.ask_yes_no("File %r exists. Overwrite?" % outfname) + except StdinNotImplementedError: + ans = True + if not ans: print('Aborting.') return - - outfile = open(outfname,'w') + print("Overwriting file.") + outfile = io_open(outfname, 'w', encoding='utf-8') close_at_end = True print_nums = 'n' in opts @@ -844,10 +852,10 @@ multiline = "\n" in inline line_sep = '\n' if multiline else ' ' if print_nums: - print('%s:%s' % (_format_lineno(session, lineno).rjust(width), - line_sep), file=outfile, end='') + print(u'%s:%s' % (_format_lineno(session, lineno).rjust(width), + line_sep), file=outfile, end=u'') if pyprompts: - print(">>> ", end="", file=outfile) + print(u">>> ", end=u"", file=outfile) if multiline: inline = "\n... ".join(inline.splitlines()) + "\n..." print(inline, file=outfile) diff -Nru ipython-0.12/IPython/core/interactiveshell.py ipython-0.12.1+dfsg/IPython/core/interactiveshell.py --- ipython-0.12/IPython/core/interactiveshell.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/interactiveshell.py 2012-04-22 05:10:27.000000000 +0000 @@ -1682,20 +1682,12 @@ sys.last_traceback = last_traceback if filename and etype is SyntaxError: - # Work hard to stuff the correct filename in the exception try: - msg, (dummy_filename, lineno, offset, line) = value + value.filename = filename except: # Not the format we expect; leave it alone pass - else: - # Stuff in the right filename - try: - # Assume SyntaxError is a class exception - value = SyntaxError(msg, (filename, lineno, offset, line)) - except: - # If that failed, assume SyntaxError is a string - value = msg, (filename, lineno, offset, line) + stb = self.SyntaxTB.structured_traceback(etype, value, []) self._showtraceback(etype, value, stb) @@ -1953,7 +1945,7 @@ # even need a centralize colors management object. self.magic_colors(self.colors) # History was moved to a separate module - from . import history + from IPython.core import history history.init_ipython(self) def magic(self, arg_s, next_input=None): @@ -1978,14 +1970,9 @@ if next_input: self.set_next_input(next_input) - args = arg_s.split(' ',1) - magic_name = args[0] + magic_name, _, magic_args = arg_s.partition(' ') magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) - try: - magic_args = args[1] - except IndexError: - magic_args = '' fn = getattr(self,'magic_'+magic_name,None) if fn is None: error("Magic function `%s` not found." % magic_name) @@ -2631,7 +2618,12 @@ ns = self.user_ns.copy() ns.update(sys._getframe(depth+1).f_locals) ns.pop('self', None) - return formatter.format(cmd, **ns) + try: + cmd = formatter.format(cmd, **ns) + except Exception: + # if formatter couldn't format, just let it go untransformed + pass + return cmd def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. diff -Nru ipython-0.12/IPython/core/magic.py ipython-0.12.1+dfsg/IPython/core/magic.py --- ipython-0.12/IPython/core/magic.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/magic.py 2012-04-22 05:10:27.000000000 +0000 @@ -45,6 +45,7 @@ from IPython.core import debugger, oinspect from IPython.core.error import TryNext from IPython.core.error import UsageError +from IPython.core.error import StdinNotImplementedError from IPython.core.fakemodule import FakeModule from IPython.core.profiledir import ProfileDir from IPython.core.macro import Macro @@ -651,7 +652,7 @@ Options: -a: makes the pattern match even objects whose names start with a - single underscore. These names are normally ommitted from the + single underscore. These names are normally omitted from the search. -i/-c: make the pattern case insensitive/sensitive. If neither of @@ -661,7 +662,7 @@ internal default is to do a case sensitive search. -e/-s NAMESPACE: exclude/search a given namespace. The pattern you - specifiy can be searched in any of the following namespaces: + specify can be searched in any of the following namespaces: 'builtin', 'user', 'user_global','internal', 'alias', where 'builtin' and 'user' are the search defaults. Note that you should not use quotes when specifying namespaces. @@ -683,7 +684,7 @@ %psearch r*.e* -> objects that start with e in modules starting in r %psearch r*.* string -> all strings in modules beginning with r - Case sensitve search: + Case sensitive search: %psearch -c a* list all object beginning with lower case a @@ -983,13 +984,22 @@ In [1]: 'a' in _ip.user_ns Out[1]: False + + Notes + ----- + Calling this magic from clients that do not implement standard input, + such as the ipython notebook interface, will reset the namespace + without confirmation. """ opts, args = self.parse_options(parameter_s,'sf') if 'f' in opts: ans = True else: - ans = self.shell.ask_yes_no( + try: + ans = self.shell.ask_yes_no( "Once deleted, variables cannot be recovered. Proceed (y/[n])? ", default='n') + except StdinNotImplementedError: + ans = True if not ans: print 'Nothing done.' return @@ -1052,6 +1062,12 @@ In [11]: who_ls Out[11]: ['a'] + + Notes + ----- + Calling this magic from clients that do not implement standard input, + such as the ipython notebook interface, will reset the namespace + without confirmation. """ opts, regex = self.parse_options(parameter_s,'f') @@ -1059,9 +1075,12 @@ if opts.has_key('f'): ans = True else: - ans = self.shell.ask_yes_no( + try: + ans = self.shell.ask_yes_no( "Once deleted, variables cannot be recovered. Proceed (y/[n])? ", default='n') + except StdinNotImplementedError: + ans = True if not ans: print 'Nothing done.' return @@ -1144,7 +1163,7 @@ logger = self.shell.logger # if no args are given, the defaults set in the logger constructor by - # ipytohn remain valid + # ipython remain valid if par: try: logfname,logmode = par.split() @@ -1356,10 +1375,12 @@ file. The profile is still shown on screen. -D : save (via dump_stats) profile statistics to given - filename. This data is in a format understod by the pstats module, and + filename. This data is in a format understood by the pstats module, and is generated by a call to the dump_stats() method of profile objects. The profile is still shown on screen. + -q: suppress output to the pager. Best used with -T and/or -D above. + If you want to run complete programs under the profiler's control, use '%run -p [prof_opts] filename.py [args to program]' where prof_opts contains profiler specific options as described here. @@ -1370,12 +1391,10 @@ """ opts_def = Struct(D=[''],l=[],s=['time'],T=['']) - # protect user quote marks - parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'") if user_mode: # regular user call - opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:', - list_all=1) + opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:q', + list_all=1, posix=False) namespace = self.shell.user_ns else: # called to run a program by %run -p try: @@ -1438,7 +1457,8 @@ output = stdout_trap.getvalue() output = output.rstrip() - page.page(output) + if 'q' not in opts: + page.page(output) print sys_exit, dump_file = opts.D[0] @@ -1548,7 +1568,7 @@ something (not a comment or docstring) for it to stop execution. When the pdb debugger starts, you will see a (Pdb) prompt. You must - first enter 'c' (without qoutes) to start execution up to the first + first enter 'c' (without quotes) to start execution up to the first breakpoint. Entering 'help' gives information about the use of the debugger. You @@ -1695,8 +1715,9 @@ # Start file run print "NOTE: Enter 'c' at the", print "%s prompt to start your script." % deb.prompt + ns = {'execfile': py3compat.execfile, 'prog_ns': prog_ns} try: - deb.run('execfile("%s")' % filename, prog_ns) + deb.run('execfile("%s", prog_ns)' % filename, ns) except: etype, value, tb = sys.exc_info() @@ -2173,12 +2194,13 @@ # logic, going with utf-8 is a simple solution likely to be right # in most real-world cases. linesource = fileobj.read().decode('utf-8', 'replace').splitlines() + fileobj.close() else: - fileobj = linesource = open(arg_s) + with open(arg_s) as fileobj: + linesource = fileobj.read().splitlines() # Strip out encoding declarations lines = [l for l in linesource if not _encoding_declaration_re.match(l)] - fileobj.close() self.set_next_input(os.linesep.join(lines)) @@ -2371,7 +2393,7 @@ Arguments: - If arguments are given, the following possibilites exist: + If arguments are given, the following possibilities exist: - If the argument is a filename, IPython will load that into the editor. It will execute its contents with execfile() when you exit, @@ -2697,7 +2719,7 @@ This version explicitly checks that every entry in $PATH is a file with execute access (os.X_OK), so it is much slower than %rehash. - Under Windows, it checks executability as a match agains a + Under Windows, it checks executability as a match against a '|'-separated string of extensions, stored in the IPython config variable win_exec_ext. This defaults to 'exe|com|bat'. @@ -2921,7 +2943,7 @@ def magic_env(self, parameter_s=''): """List environment variables.""" - return os.environ.data + return dict(os.environ) def magic_pushd(self, parameter_s=''): """Place the current dir on stack and change directory. @@ -3062,7 +3084,7 @@ 146 setup.py 130 win32_manual_post_install.py - Similiarly, the lists returned by the -l option are also special, in + Similarly, the lists returned by the -l option are also special, in the sense that you can equally invoke the .s attribute on them to automatically get a whitespace-separated string from their contents: @@ -3074,7 +3096,7 @@ In [9]: b.s Out[9]: 'setup.py win32_manual_post_install.py' - In summary, both the lists and strings used for ouptut capture have + In summary, both the lists and strings used for output capture have the following special attributes: .l (or .list) : value as list. @@ -3089,7 +3111,7 @@ # output, which uses shlex.split to strip options out. var,_ = args.split('=',1) var = var.strip() - # But the the command has to be extracted from the original input + # But the command has to be extracted from the original input # parameter_s, not on what parse_options returns, to avoid the # quote stripping which shlex.split performs on it. _,cmd = parameter_s.split('=',1) @@ -3518,7 +3540,7 @@ '-f', '--format', help='Convert an existing IPython notebook to a new format. This option ' 'specifies the new format and can have the values: xml, json, py. ' - 'The target filename is choosen automatically based on the new ' + 'The target filename is chosen automatically based on the new ' 'format. The filename argument gives the name of the source file.' ) @magic_arguments.argument( @@ -3587,7 +3609,7 @@ Examples -------- - To see what classes are availabe for config, pass no arguments:: + To see what classes are available for config, pass no arguments:: In [1]: %config Available objects for config: diff -Nru ipython-0.12/IPython/core/prompts.py ipython-0.12.1+dfsg/IPython/core/prompts.py --- ipython-0.12/IPython/core/prompts.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/prompts.py 2012-04-22 05:10:27.000000000 +0000 @@ -423,7 +423,7 @@ self.txtwidth = _lenlastline(res) - invis_chars just = self.justify if (just is None) else just # If the prompt spans more than one line, don't try to justify it: - if just and ('\n' not in res) and ('\r' not in res): + if just and name != 'in' and ('\n' not in res) and ('\r' not in res): res = res.rjust(self.width + invis_chars) self.width = _lenlastline(res) - invis_chars return res diff -Nru ipython-0.12/IPython/core/release.py ipython-0.12.1+dfsg/IPython/core/release.py --- ipython-0.12/IPython/core/release.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/release.py 2012-04-22 05:10:27.000000000 +0000 @@ -2,7 +2,7 @@ """Release data for the IPython project.""" #----------------------------------------------------------------------------- -# Copyright (c) 2008-2011, IPython Development Team. +# Copyright (c) 2008-2012, IPython Development Team. # Copyright (c) 2001-2007, Fernando Perez # Copyright (c) 2001, Janko Hauser # Copyright (c) 2001, Nathaniel Gray @@ -21,8 +21,8 @@ # version _version_major = 0 _version_minor = 12 -_version_micro = '' # use '' for first of series, number for 1 and above -#_version_extra = 'rc1' +_version_micro = 1 # use '' for first of series, number for 1 and above +#_version_extra = 'rc2' _version_extra = '' # Uncomment this for full releases # Construct full version string from these. @@ -44,9 +44,12 @@ interactively. Its main components are: * Powerful interactive Python shells (terminal- and Qt-based). +* A web-based interactive notebook environment with all shell features plus + support for embedded figures, animations and rich media. * Support for interactive data visualization and use of GUI toolkits. * Flexible, embeddable interpreters to load into your own projects. -* Tools for high level and interactive parallel computing. +* A high-performance library for high level and interactive parallel computing + that works in multicore systems, clusters, supercomputing and cloud scenarios. The enhanced interactive Python shells have the following main features: @@ -57,13 +60,14 @@ * Caching of output results during a session with automatically generated references. -* Readline based name completion. +* Extensible tab completion, with support by default for completion of python + variables and keywords, filenames and function keywords. * Extensible system of 'magic' commands for controlling the environment and performing many tasks related either to IPython or the operating system. -* Configuration system with easy switching between different setups (simpler - than changing $PYTHONSTARTUP environment variables every time). +* A rich configuration system with easy switching between different setups + (simpler than changing $PYTHONSTARTUP environment variables every time). * Session logging and reloading. @@ -71,7 +75,7 @@ * Access to the system shell with user-extensible alias system. -* Easily embeddable in other Python programs and wxPython GUIs. +* Easily embeddable in other Python programs and GUIs. * Integrated access to the pdb debugger and the Python profiler. @@ -107,7 +111,8 @@ 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'), 'Ville' : ('Ville Vainio','vivainio@gmail.com'), 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'), - 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com') + 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'), + 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'), } author = 'The IPython Development Team' @@ -120,13 +125,14 @@ # those are the ones we want pip/easy_install to be able to find. download_url = 'http://archive.ipython.org/release/%s' % version -platforms = ['Linux','Mac OSX','Windows XP/2000/NT'] +platforms = ['Linux','Mac OSX','Windows XP/2000/NT/Vista/7'] -keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed'] +keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed', + 'Web-based computing', 'Qt console', 'Embedding'] classifiers = [ 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research' + 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', diff -Nru ipython-0.12/IPython/core/shellapp.py ipython-0.12.1+dfsg/IPython/core/shellapp.py --- ipython-0.12/IPython/core/shellapp.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/shellapp.py 2012-04-22 05:10:27.000000000 +0000 @@ -184,6 +184,10 @@ self._run_exec_files() self._run_cmd_line_code() + # flush output, so itwon't be attached to the first cell + sys.stdout.flush() + sys.stderr.flush() + # Hide variables defined here from %who etc. self.shell.user_ns_hidden.update(self.shell.user_ns) diff -Nru ipython-0.12/IPython/core/tests/test_formatters.py ipython-0.12.1+dfsg/IPython/core/tests/test_formatters.py --- ipython-0.12/IPython/core/tests/test_formatters.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/tests/test_formatters.py 2012-04-22 05:10:27.000000000 +0000 @@ -10,6 +10,7 @@ import nose.tools as nt from IPython.core.formatters import FormatterABC, PlainTextFormatter +from IPython.lib import pretty class A(object): def __repr__(self): @@ -19,6 +20,16 @@ def __repr__(self): return 'B()' +class BadPretty(object): + _repr_pretty_ = None + +class GoodPretty(object): + def _repr_pretty_(self, pp, cycle): + pp.text('foo') + + def __repr__(self): + return 'GoodPretty()' + def foo_printer(obj, pp, cycle): pp.text('foo') @@ -27,9 +38,15 @@ f.for_type(A, foo_printer) nt.assert_equals(f(A()), 'foo') nt.assert_equals(f(B()), 'foo') + nt.assert_equals(f(GoodPretty()), 'foo') + # Just don't raise an exception for the following: + f(BadPretty()) + f.pprint = False nt.assert_equals(f(A()), 'A()') nt.assert_equals(f(B()), 'B()') + nt.assert_equals(f(GoodPretty()), 'GoodPretty()') + def test_deferred(): f = PlainTextFormatter() diff -Nru ipython-0.12/IPython/core/tests/test_history.py ipython-0.12.1+dfsg/IPython/core/tests/test_history.py --- ipython-0.12/IPython/core/tests/test_history.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/tests/test_history.py 2012-04-22 05:10:27.000000000 +0000 @@ -7,6 +7,7 @@ # stdlib import os +import shutil import sys import tempfile import unittest @@ -31,7 +32,7 @@ hist_file = os.path.join(tmpdir, 'history.sqlite') try: ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file) - hist = ['a=1', 'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"] + hist = [u'a=1', u'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"] for i, h in enumerate(hist, start=1): ip.history_manager.store_inputs(i, h) @@ -51,6 +52,12 @@ # Check whether specifying a range beyond the end of the current # session results in an error (gh-804) ip.magic('%hist 2-500') + + # Check that we can write non-ascii characters to a file + ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1")) + ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2")) + ip.magic("%%hist -nf %s" % os.path.join(tmpdir, "test3")) + ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test4")) # New session ip.history_manager.reset() diff -Nru ipython-0.12/IPython/core/tests/test_interactiveshell.py ipython-0.12.1+dfsg/IPython/core/tests/test_interactiveshell.py --- ipython-0.12/IPython/core/tests/test_interactiveshell.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/tests/test_interactiveshell.py 2012-04-22 05:10:27.000000000 +0000 @@ -236,10 +236,24 @@ ip = get_ipython() ip.user_ns['f'] = u'Ca\xf1o' self.assertEqual(ip.var_expand(u'echo $f'), u'echo Ca\xf1o') + self.assertEqual(ip.var_expand(u'echo {f}'), u'echo Ca\xf1o') + self.assertEqual(ip.var_expand(u'echo {f[:-1]}'), u'echo Ca\xf1') + self.assertEqual(ip.var_expand(u'echo {1*2}'), u'echo 2') ip.user_ns['f'] = b'Ca\xc3\xb1o' # This should not raise any exception: ip.var_expand(u'echo $f') + + def test_bad_var_expand(self): + """var_expand on invalid formats shouldn't raise""" + ip = get_ipython() + + # SyntaxError + self.assertEqual(ip.var_expand(u"{'a':5}"), u"{'a':5}") + # NameError + self.assertEqual(ip.var_expand(u"{asdf}"), u"{asdf}") + # ZeroDivisionError + self.assertEqual(ip.var_expand(u"{1/0}"), u"{1/0}") class TestSafeExecfileNonAsciiPath(unittest.TestCase): diff -Nru ipython-0.12/IPython/core/tests/test_magic.py ipython-0.12.1+dfsg/IPython/core/tests/test_magic.py --- ipython-0.12/IPython/core/tests/test_magic.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/tests/test_magic.py 2012-04-22 05:10:27.000000000 +0000 @@ -353,3 +353,14 @@ _ip.magic('timeit -r1 -n1 ("a " + "b")') _ip.magic('timeit -r1 -n1 f("a " + "b")') _ip.magic('timeit -r1 -n1 f("a " + "b ")') + + +def test_timeit_arguments(): + "Test valid timeit arguments, should not cause SyntaxError (GH #1269)" + _ip.magic("timeit ('#')") + +@dec.skipif(_ip.magic_prun == _ip.profile_missing_notice) +def test_prun_quotes(): + "Test that prun does not clobber string escapes (GH #1302)" + _ip.magic(r"prun -q x = '\t'") + nt.assert_equal(_ip.user_ns['x'], '\t') diff -Nru ipython-0.12/IPython/core/tests/test_magic_terminal.py ipython-0.12.1+dfsg/IPython/core/tests/test_magic_terminal.py --- ipython-0.12/IPython/core/tests/test_magic_terminal.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/tests/test_magic_terminal.py 2012-04-22 05:10:27.000000000 +0000 @@ -48,6 +48,7 @@ finally: sys.stdin = stdin_save +PY31 = sys.version_info[:2] == (3,1) def test_cpaste(): """Test cpaste magic""" @@ -67,7 +68,13 @@ ], 'fail': ["1 + run()", - "++ run()"]} + ]} + + # I don't know why this is failing specifically on Python 3.1. I've + # checked it manually interactively, but we don't care enough about 3.1 + # to spend time fiddling with the tests, so we just skip it. + if not PY31: + tests['fail'].append("++ run()") _ip.user_ns['run'] = run diff -Nru ipython-0.12/IPython/core/ultratb.py ipython-0.12.1+dfsg/IPython/core/ultratb.py --- ipython-0.12/IPython/core/ultratb.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/ultratb.py 2012-04-22 05:10:27.000000000 +0000 @@ -100,6 +100,7 @@ from IPython.utils import PyColorize from IPython.utils import io from IPython.utils import py3compat +from IPython.utils import pyfile from IPython.utils.data import uniq_stable from IPython.utils.warn import info, error @@ -126,6 +127,14 @@ 'Below is the traceback from this internal error.\n') +# N.B. This function is a monkeypatch we are currently not applying. +# It was written some time ago, to fix an apparent Python bug with +# codeobj.co_firstlineno . Unfortunately, we don't know under what conditions +# the bug occurred, so we can't tell if it has been fixed. If it reappears, we +# will apply the monkeypatch again. Also, note that findsource() is not called +# by our code at this time - we don't know if it was when the monkeypatch was +# written, or if the monkeypatch is needed for some other code (like a debugger). +# For the discussion about not applying it, see gh-1229. TK, Jan 2011. def findsource(object): """Return the entire source file and starting line number for an object. @@ -201,9 +210,10 @@ return lines, lnum raise IOError('could not find code object') +# Not applying the monkeypatch - see above the function for details. TK, Jan 2012 # Monkeypatch inspect to apply our bugfix. This code only works with py25 -if sys.version_info[:2] >= (2,5): - inspect.findsource = findsource +#if sys.version_info[:2] >= (2,5): +# inspect.findsource = findsource def fix_frame_records_filenames(records): """Try to fix the filenames in each record from inspect.getinnerframes(). @@ -514,7 +524,7 @@ Colors.lineno, lineno, Colors.Normal, Colors.name, name, Colors.Normal) if line: - item = item + ' %s\n' % line.strip() + item += ' %s\n' % line.strip() list.append(item) # Emphasize the last entry filename, lineno, name, line = extracted_list[-1] @@ -525,7 +535,7 @@ Colors.nameEm, name, Colors.normalEm, Colors.Normal) if line: - item = item + '%s %s%s\n' % (Colors.line, line.strip(), + item += '%s %s%s\n' % (Colors.line, line.strip(), Colors.Normal) list.append(item) #from pprint import pformat; print 'LISTTB', pformat(list) # dbg @@ -548,44 +558,40 @@ have_filedata = False Colors = self.Colors list = [] - try: - stype = Colors.excName + etype.__name__ + Colors.Normal - except AttributeError: - stype = etype # String exceptions don't get special coloring + stype = Colors.excName + etype.__name__ + Colors.Normal if value is None: + # Not sure if this can still happen in Python 2.6 and above list.append( str(stype) + '\n') else: if etype is SyntaxError: - try: - msg, (filename, lineno, offset, line) = value - except: - have_filedata = False - else: - have_filedata = True - #print 'filename is',filename # dbg - if not filename: filename = "" - list.append('%s File %s"%s"%s, line %s%d%s\n' % \ - (Colors.normalEm, - Colors.filenameEm, filename, Colors.normalEm, - Colors.linenoEm, lineno, Colors.Normal )) - if line is not None: - i = 0 - while i < len(line) and line[i].isspace(): - i = i+1 - list.append('%s %s%s\n' % (Colors.line, - line.strip(), - Colors.Normal)) - if offset is not None: - s = ' ' - for c in line[i:offset-1]: - if c.isspace(): - s = s + c - else: - s = s + ' ' - list.append('%s%s^%s\n' % (Colors.caret, s, - Colors.Normal) ) - value = msg - s = self._some_str(value) + have_filedata = True + #print 'filename is',filename # dbg + if not value.filename: value.filename = "" + list.append('%s File %s"%s"%s, line %s%d%s\n' % \ + (Colors.normalEm, + Colors.filenameEm, value.filename, Colors.normalEm, + Colors.linenoEm, value.lineno, Colors.Normal )) + if value.text is not None: + i = 0 + while i < len(value.text) and value.text[i].isspace(): + i += 1 + list.append('%s %s%s\n' % (Colors.line, + value.text.strip(), + Colors.Normal)) + if value.offset is not None: + s = ' ' + for c in value.text[i:value.offset-1]: + if c.isspace(): + s += c + else: + s += ' ' + list.append('%s%s^%s\n' % (Colors.caret, s, + Colors.Normal) ) + + try: + s = value.msg + except Exception: + s = self._some_str(value) if s: list.append('%s%s:%s %s\n' % (str(stype), Colors.excName, Colors.Normal, s)) @@ -596,7 +602,7 @@ if have_filedata: ipinst = ipapi.get() if ipinst is not None: - ipinst.hooks.synchronize_with_editor(filename, lineno, 0) + ipinst.hooks.synchronize_with_editor(value.filename, value.lineno, 0) return list @@ -788,15 +794,7 @@ # keep the original file string. pass link = tpl_link % file - try: - args, varargs, varkw, locals = inspect.getargvalues(frame) - except: - # This can happen due to a bug in python2.3. We should be - # able to remove this try/except when 2.4 becomes a - # requirement. Bug details at http://python.org/sf/1005466 - inspect_error() - traceback.print_exc(file=self.ostream) - info("\nIPython's exception reporting continues...\n") + args, varargs, varkw, locals = inspect.getargvalues(frame) if func == '?': call = '' @@ -825,47 +823,14 @@ # will illustrate the error, if this exception catch is # disabled. call = tpl_call_fail % func - - # Initialize a list of names on the current line, which the - # tokenizer below will populate. - names = [] - - def tokeneater(token_type, token, start, end, line): - """Stateful tokeneater which builds dotted names. - - The list of names it appends to (from the enclosing scope) can - contain repeated composite names. This is unavoidable, since - there is no way to disambguate partial dotted structures until - the full list is known. The caller is responsible for pruning - the final list of duplicates before using it.""" - - # build composite names - if token == '.': - try: - names[-1] += '.' - # store state so the next token is added for x.y.z names - tokeneater.name_cont = True - return - except IndexError: - pass - if token_type == tokenize.NAME and token not in keyword.kwlist: - if tokeneater.name_cont: - # Dotted names - names[-1] += token - tokeneater.name_cont = False - else: - # Regular new names. We append everything, the caller - # will be responsible for pruning the list later. It's - # very tricky to try to prune as we go, b/c composite - # names can fool us. The pruning at the end is easy - # to do (or the caller can print a list with repeated - # names if so desired. - names.append(token) - elif token_type == tokenize.NEWLINE: - raise IndexError - # we need to store a bit of state in the tokenizer to build - # dotted names - tokeneater.name_cont = False + + # Don't attempt to tokenize binary files. + if file.endswith(('.so', '.pyd', '.dll')): + frames.append('%s %s\n' % (link,call)) + continue + elif file.endswith(('.pyc','.pyo')): + # Look up the corresponding source file. + file = pyfile.source_from_cache(file) def linereader(file=file, lnum=[lnum], getline=linecache.getline): line = getline(file, lnum[0]) @@ -875,10 +840,32 @@ # Build the list of names on this line of code where the exception # occurred. try: - # This builds the names list in-place by capturing it from the - # enclosing scope. - for token in generate_tokens(linereader): - tokeneater(*token) + names = [] + name_cont = False + + for token_type, token, start, end, line in generate_tokens(linereader): + # build composite names + if token_type == tokenize.NAME and token not in keyword.kwlist: + if name_cont: + # Continuation of a dotted name + try: + names[-1].append(token) + except IndexError: + names.append([token]) + name_cont = False + else: + # Regular new names. We append everything, the caller + # will be responsible for pruning the list later. It's + # very tricky to try to prune as we go, b/c composite + # names can fool us. The pruning at the end is easy + # to do (or the caller can print a list with repeated + # names if so desired. + names.append([token]) + elif token == '.': + name_cont = True + elif token_type == tokenize.NEWLINE: + break + except (IndexError, UnicodeDecodeError): # signals exit of tokenizer pass @@ -888,6 +875,8 @@ "The error message is: %s\n" % msg) error(_m) + # Join composite names (e.g. "dict.fromkeys") + names = ['.'.join(n) for n in names] # prune names list of duplicates, but keep the right order unique_names = uniq_stable(names) diff -Nru ipython-0.12/IPython/core/usage.py ipython-0.12.1+dfsg/IPython/core/usage.py --- ipython-0.12/IPython/core/usage.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/core/usage.py 2012-04-22 05:10:27.000000000 +0000 @@ -407,13 +407,14 @@ - ``C-l``: clear terminal. - ``C-a``: go to beginning of line. - ``C-e``: go to end of line. +- ``C-u``: kill from cursor to the begining of the line. - ``C-k``: kill from cursor to the end of the line. - ``C-y``: yank (paste) - ``C-p``: previous line (like up arrow) - ``C-n``: next line (like down arrow) - ``C-f``: forward (like right arrow) - ``C-b``: back (like left arrow) -- ``C-d``: delete next character. +- ``C-d``: delete next character, or exits if input is empty - ``M-<``: move to the beginning of the input region. - ``M->``: move to the end of the input region. - ``M-d``: delete next word. diff -Nru ipython-0.12/IPython/extensions/autoreload.py ipython-0.12.1+dfsg/IPython/extensions/autoreload.py --- ipython-0.12/IPython/extensions/autoreload.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/extensions/autoreload.py 2012-04-22 05:10:27.000000000 +0000 @@ -108,6 +108,9 @@ except NameError: from imp import reload +from IPython.utils import pyfile +from IPython.utils.py3compat import PY3 + def _get_compiled_ext(): """Official way to get the extension of compiled files (.pyc or .pyo)""" for ext, mode, typ in imp.get_suffixes(): @@ -198,14 +201,14 @@ if ext.lower() == '.py': ext = PY_COMPILED_EXT - pyc_filename = path + PY_COMPILED_EXT + pyc_filename = pyfile.cache_from_source(filename) py_filename = filename else: pyc_filename = filename - py_filename = filename[:-1] - - if ext != PY_COMPILED_EXT: - continue + try: + py_filename = pyfile.source_from_cache(filename) + except ValueError: + continue try: pymtime = os.stat(py_filename).st_mtime @@ -229,10 +232,16 @@ # superreload #------------------------------------------------------------------------------ +if PY3: + func_attrs = ['__code__', '__defaults__', '__doc__', + '__closure__', '__globals__', '__dict__'] +else: + func_attrs = ['func_code', 'func_defaults', 'func_doc', + 'func_closure', 'func_globals', 'func_dict'] + def update_function(old, new): """Upgrade the code object of a function""" - for name in ['func_code', 'func_defaults', 'func_doc', - 'func_closure', 'func_globals', 'func_dict']: + for name in func_attrs: try: setattr(old, name, getattr(new, name)) except (AttributeError, TypeError): @@ -271,18 +280,26 @@ return isinstance(a, typ) and isinstance(b, typ) UPDATE_RULES = [ - (lambda a, b: isinstance2(a, b, types.ClassType), - update_class), - (lambda a, b: isinstance2(a, b, types.TypeType), + (lambda a, b: isinstance2(a, b, type), update_class), (lambda a, b: isinstance2(a, b, types.FunctionType), update_function), (lambda a, b: isinstance2(a, b, property), update_property), - (lambda a, b: isinstance2(a, b, types.MethodType), - lambda a, b: update_function(a.im_func, b.im_func)), ] +if PY3: + UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.MethodType), + lambda a, b: update_function(a.__func__, b.__func__)), + ]) +else: + UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.ClassType), + update_class), + (lambda a, b: isinstance2(a, b, types.MethodType), + lambda a, b: update_function(a.im_func, b.im_func)), + ]) + + def update_generic(a, b): for type_check, update in UPDATE_RULES: if type_check(a, b): @@ -317,7 +334,7 @@ except TypeError: # weakref doesn't work for all types; # create strong references for 'important' cases - if isinstance(obj, types.ClassType): + if not PY3 and isinstance(obj, types.ClassType): old_objects.setdefault(key, []).append(StrongRef(obj)) # reload module diff -Nru ipython-0.12/IPython/extensions/tests/test_autoreload.py ipython-0.12.1+dfsg/IPython/extensions/tests/test_autoreload.py --- ipython-0.12/IPython/extensions/tests/test_autoreload.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/extensions/tests/test_autoreload.py 2012-04-22 05:10:27.000000000 +0000 @@ -11,7 +11,6 @@ from IPython.extensions.autoreload import AutoreloadInterface from IPython.core.hooks import TryNext -from IPython.testing.decorators import knownfailureif #----------------------------------------------------------------------------- # Test fixture @@ -294,12 +293,8 @@ self.shell.run_code("pass") # trigger reload nt.assert_equal(mod.x, -99) - # The autoreload extension needs to be updated for Python 3.2, as .pyc files - # are stored in a different location. See gh-846. - @knownfailureif(sys.version_info >= (3,2)) def test_smoketest_aimport(self): self._check_smoketest(use_aimport=True) - @knownfailureif(sys.version_info >= (3,2)) def test_smoketest_autoreload(self): self._check_smoketest(use_aimport=False) diff -Nru ipython-0.12/IPython/frontend/html/notebook/handlers.py ipython-0.12.1+dfsg/IPython/frontend/html/notebook/handlers.py --- ipython-0.12/IPython/frontend/html/notebook/handlers.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/handlers.py 2012-04-22 05:10:27.000000000 +0000 @@ -18,6 +18,7 @@ import logging import Cookie +import time import uuid from tornado import web @@ -356,6 +357,14 @@ else: self.write_message(msg) + def allow_draft76(self): + """Allow draft 76, until browsers such as Safari update to RFC 6455. + + This has been disabled by default in tornado in release 2.2.0, and + support will be removed in later versions. + """ + return True + class AuthenticatedZMQStreamHandler(ZMQStreamHandler): @@ -412,6 +421,7 @@ return km = self.application.kernel_manager self.time_to_dead = km.time_to_dead + self.first_beat = km.first_beat kernel_id = self.kernel_id try: self.iopub_stream = km.create_iopub_stream(kernel_id) @@ -446,34 +456,48 @@ self._kernel_alive = True def ping_or_dead(): + self.hb_stream.flush() if self._kernel_alive: self._kernel_alive = False self.hb_stream.send(b'ping') + # flush stream to force immediate socket send + self.hb_stream.flush() else: try: callback() except: pass finally: - self._hb_periodic_callback.stop() + self.stop_hb() def beat_received(msg): self._kernel_alive = True self.hb_stream.on_recv(beat_received) - self._hb_periodic_callback = ioloop.PeriodicCallback(ping_or_dead, self.time_to_dead*1000) - self._hb_periodic_callback.start() + loop = ioloop.IOLoop.instance() + self._hb_periodic_callback = ioloop.PeriodicCallback(ping_or_dead, self.time_to_dead*1000, loop) + loop.add_timeout(time.time()+self.first_beat, self._really_start_hb) self._beating= True + + def _really_start_hb(self): + """callback for delayed heartbeat start + + Only start the hb loop if we haven't been closed during the wait. + """ + if self._beating and not self.hb_stream.closed(): + self._hb_periodic_callback.start() def stop_hb(self): """Stop the heartbeating and cancel all related callbacks.""" if self._beating: + self._beating = False self._hb_periodic_callback.stop() if not self.hb_stream.closed(): self.hb_stream.on_recv(None) def kernel_died(self): self.application.kernel_manager.delete_mapping_for_kernel(self.kernel_id) + self.application.log.error("Kernel %s failed to respond to heartbeat", self.kernel_id) self.write_message( {'header': {'msg_type': 'status'}, 'parent_header': {}, diff -Nru ipython-0.12/IPython/frontend/html/notebook/__init__.py ipython-0.12.1+dfsg/IPython/frontend/html/notebook/__init__.py --- ipython-0.12/IPython/frontend/html/notebook/__init__.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/__init__.py 2012-04-22 05:10:27.000000000 +0000 @@ -6,7 +6,10 @@ import tornado except ImportError: raise ImportError(msg) -else: - if tornado.version_info < (2,1,0): - raise ImportError(msg+", but you have %s"%tornado.version) +try: + version_info = tornado.version_info +except AttributeError: + raise ImportError(msg + ", but you have < 1.1.0") +if version_info < (2,1,0): + raise ImportError(msg + ", but you have %s" % tornado.version) del msg diff -Nru ipython-0.12/IPython/frontend/html/notebook/kernelmanager.py ipython-0.12.1+dfsg/IPython/frontend/html/notebook/kernelmanager.py --- ipython-0.12/IPython/frontend/html/notebook/kernelmanager.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/kernelmanager.py 2012-04-22 05:10:27.000000000 +0000 @@ -195,7 +195,10 @@ kernel_argv = List(Unicode) kernel_manager = Instance(KernelManager) + time_to_dead = Float(3.0, config=True, help="""Kernel heartbeat interval in seconds.""") + first_beat = Float(5.0, config=True, help="Delay (in seconds) before sending first heartbeat.") + max_msg_size = Integer(65536, config=True, help=""" The max raw message size accepted from the browser over a WebSocket connection. diff -Nru ipython-0.12/IPython/frontend/html/notebook/notebookapp.py ipython-0.12.1+dfsg/IPython/frontend/html/notebook/notebookapp.py --- ipython-0.12/IPython/frontend/html/notebook/notebookapp.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/notebookapp.py 2012-04-22 05:10:27.000000000 +0000 @@ -213,6 +213,9 @@ config=True, help="Set the log level by value or name.") + # create requested profiles by default, if they don't exist: + auto_create = Bool(True) + # Network related information. ip = Unicode(LOCALHOST, config=True, @@ -303,9 +306,6 @@ self.kernel_argv.append("--KernelApp.parent_appname='%s'"%self.name) def init_configurables(self): - # Don't let Qt or ZMQ swallow KeyboardInterupts. - signal.signal(signal.SIGINT, signal.SIG_DFL) - # force Session default to be secure default_secure(self.config) # Create a KernelManager and start a kernel. @@ -322,11 +322,9 @@ # self.log is a child of. The logging module dipatches log messages to a log # and all of its ancenstors until propagate is set to False. self.log.propagate = False - - @catch_config_error - def initialize(self, argv=None): - super(NotebookApp, self).initialize(argv) - self.init_configurables() + + def init_webapp(self): + """initialize tornado webapp and httpserver""" self.web_app = NotebookWebApplication( self, self.kernel_manager, self.notebook_manager, self.log, self.webapp_settings @@ -339,7 +337,7 @@ ssl_options = None self.web_app.password = self.password self.http_server = httpserver.HTTPServer(self.web_app, ssl_options=ssl_options) - if ssl_options is None and not self.ip: + if ssl_options is None and not self.ip and not (self.read_only and not self.password): self.log.critical('WARNING: the notebook server is listening on all IP addresses ' 'but not using any encryption or authentication. This is highly ' 'insecure and not recommended.') @@ -357,6 +355,24 @@ else: self.port = port break + + @catch_config_error + def initialize(self, argv=None): + super(NotebookApp, self).initialize(argv) + self.init_configurables() + self.init_webapp() + + def cleanup_kernels(self): + """shutdown all kernels + + The kernels will shutdown themselves when this process no longer exists, + but explicit shutdown allows the KernelManagers to cleanup the connection files. + """ + self.log.info('Shutting down kernels') + km = self.kernel_manager + # copy list, since kill_kernel deletes keys + for kid in list(km.kernel_ids): + km.kill_kernel(kid) def start(self): ip = self.ip if self.ip else '[all ip addresses on your system]' @@ -371,15 +387,20 @@ b = lambda : webbrowser.open("%s://%s:%i" % (proto, ip, self.port), new=2) threading.Thread(target=b).start() - - ioloop.IOLoop.instance().start() + try: + ioloop.IOLoop.instance().start() + except KeyboardInterrupt: + info("Interrupted...") + finally: + self.cleanup_kernels() + #----------------------------------------------------------------------------- # Main entry point #----------------------------------------------------------------------------- def launch_new_instance(): - app = NotebookApp() + app = NotebookApp.instance() app.initialize() app.start() diff -Nru ipython-0.12/IPython/frontend/html/notebook/notebookmanager.py ipython-0.12.1+dfsg/IPython/frontend/html/notebook/notebookmanager.py --- ipython-0.12/IPython/frontend/html/notebook/notebookmanager.py 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/notebookmanager.py 2012-04-22 05:10:27.000000000 +0000 @@ -17,6 +17,7 @@ #----------------------------------------------------------------------------- import datetime +import io import os import uuid import glob @@ -212,7 +213,7 @@ if self.save_script: pypath = os.path.splitext(path)[0] + '.py' try: - with open(pypath,'w') as f: + with io.open(pypath,'w', encoding='utf-8') as f: current.write(nb, f, u'py') except Exception as e: raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e) diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js --- ipython-0.12/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. -shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j -)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js --- ipython-0.12/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,789 +0,0 @@ -/*! - * jQuery UI 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14", -keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus(); -b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this, -"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection", -function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth, -outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b); -return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e= -0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= -false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= -m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper= -this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, -_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= -false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, -10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| -!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& -a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= -"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), -10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ -this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& -!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); -var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= -false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); -this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= -{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; -if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, -_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, -{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: -Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= -null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ -a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ -c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); -b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), -10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- -f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? -e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= -e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, -step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= -e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; -var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: -a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- -d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, -f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, -display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= -e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= -d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -;/* - * jQuery UI Selectable 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", -c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= -this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== -"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& -!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, -left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; -this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= -document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); -return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], -e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); -c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): -this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, -dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, -toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); -if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), -this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= -this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= -d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| -0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", -a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- -f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- -this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, -this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", -a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); -a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", -function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= -this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); -this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); -b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); -a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ -c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; -if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), -e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| -e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", -"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14", -animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); -f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", -paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); -;/* - * jQuery UI Autocomplete 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g= -false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= -a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; -this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& -a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); -d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& -b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= -this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, -"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); -(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); -this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, -this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| -this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| -this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": -"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== -"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); -b.Widget.prototype.destroy.call(this)}})})(jQuery); -;/* - * jQuery UI Dialog 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, -position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), -h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", -e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== -b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+= -1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== -f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, -function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", -handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, -originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", -f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): -[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); -if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): -e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= -this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- -b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), -create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), -height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); -b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j"); -this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", -g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length? -(h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i- -m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); -return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false; -this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a= -this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a= -this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a); -c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, -_refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate); -if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, -1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.14"})})(jQuery); -;/* - * jQuery UI Tabs 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.bind("mouseout",function(b){b= -d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover"); -b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.14"}});var A=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults, -a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0, -selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
    '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]= -h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c= -this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a, -"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker", -function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput); -a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left", -this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus", -this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b= -b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5", -cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a); -d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c= -d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c= -{left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover"); -if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv); -J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"); -a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]|| -c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+ -i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b= -this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute", -left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&& -d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth= -b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear= -!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a); -a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a)); -d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()% -100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=B+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y", -TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= -a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), -b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= -this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),B= -this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right": -"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
    '+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,B,v)+'
    ';var z=j?'": -"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
    '+this._get(a,"weekHeader")+"
    '+ -this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+r.getDate()+"":''+ -r.getDate()+"")+"
    "+(l?""+(i[0]>0&&G==i[1]-1?'
    ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"), -l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()): -g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c== -"Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear"); -if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, -[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.14";window["DP_jQuery_"+A]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.14"})})(jQuery); -;/* - * jQuery UI Effects 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", -"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, -0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, -211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, -d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; -f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, -[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}); -c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c, -a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments); -a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%", -"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d* -((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/= -e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/= -e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fade 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], -10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/js/codecell.js ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/js/codecell.js --- ipython-0.12/IPython/frontend/html/notebook/static/js/codecell.js 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/js/codecell.js 2012-04-22 05:10:27.000000000 +0000 @@ -15,7 +15,7 @@ var CodeCell = function (notebook) { this.code_mirror = null; - this.input_prompt_number = ' '; + this.input_prompt_number = null; this.is_completing = false; this.completion_cursor = null; this.outputs = []; @@ -598,7 +598,9 @@ if (last.output_type == 'stream' && json.stream == last.stream){ // latest output was in the same stream, // so append directly into its pre tag - this.element.find('div.'+subclass).last().find('pre').append(json.text); + // escape ANSI & HTML specials: + var text = utils.fixConsole(json.text); + this.element.find('div.'+subclass).last().find('pre').append(text); return; } } @@ -647,6 +649,8 @@ CodeCell.prototype.append_text = function (data, element, extra_class) { var toinsert = $("
    ").addClass("box_flex1 output_subarea output_text"); + // escape ANSI & HTML specials in plaintext: + data = utils.fixConsole(data); if (extra_class){ toinsert.addClass(extra_class); } @@ -753,9 +757,9 @@ }; CodeCell.prototype.set_input_prompt = function (number) { - var n = number || ' '; - this.input_prompt_number = n; - this.element.find('div.input_prompt').html('In [' + n + ']:'); + this.input_prompt_number = number; + var ns = number || " "; + this.element.find('div.input_prompt').html('In [' + ns + ']:'); }; @@ -817,7 +821,7 @@ var data = {}; data.input = this.get_code(); data.cell_type = 'code'; - if (this.input_prompt_number !== ' ') { + if (this.input_prompt_number) { data.prompt_number = this.input_prompt_number; }; var outputs = []; diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/js/notebook.js ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/js/notebook.js --- ipython-0.12/IPython/frontend/html/notebook/static/js/notebook.js 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/js/notebook.js 2012-04-22 05:10:27.000000000 +0000 @@ -816,7 +816,7 @@ var json = {}; json.output_type = msg_type; if (msg_type === "stream") { - json.text = utils.fixConsole(content.data); + json.text = content.data; json.stream = content.name; } else if (msg_type === "display_data") { json = this.convert_mime_types(json, content.data); @@ -826,11 +826,7 @@ } else if (msg_type === "pyerr") { json.ename = content.ename; json.evalue = content.evalue; - var traceback = []; - for (var i=0; i').addClass('item_name'); new_item_name.append( $(''). - attr('href', $('body').data('baseProjectURL')+notebook_id). + attr('href', $('body').data('baseProjectUrl')+notebook_id). attr('target','_blank'). text(nbname) ); diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/prettify/prettify.js ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/prettify/prettify.js --- ipython-0.12/IPython/frontend/html/notebook/static/prettify/prettify.js 2011-12-19 09:02:39.000000000 +0000 +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/prettify/prettify.js 2012-04-22 05:10:27.000000000 +0000 @@ -1,28 +1,1477 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p + * For a fairly comprehensive set of languages see the + * README + * file that came with this source. At a minimum, the lexer should work on a + * number of languages including C and friends, Java, Python, Bash, SQL, HTML, + * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk + * and a subset of Perl, but, because of commenting conventions, doesn't work on + * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. + *

    + * Usage:

      + *
    1. include this source file in an html page via + * {@code } + *
    2. define style rules. See the example page for examples. + *
    3. mark the {@code
      } and {@code } tags in your source with
      + *    {@code class=prettyprint.}
      + *    You can also use the (html deprecated) {@code } tag, but the pretty
      + *    printer needs to do more substantial DOM manipulations to support that, so
      + *    some css styles may not be preserved.
      + * </ol>
      + * That's it.  I wanted to keep the API as simple as possible, so there's no
      + * need to specify which language the code is in, but if you wish, you can add
      + * another class to the {@code <pre>} or {@code <code>} element to specify the
      + * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
      + * starts with "lang-" followed by a file extension, specifies the file type.
      + * See the "lang-*.js" files in this directory for code that implements
      + * per-language file handlers.
      + * <p>
      + * Change log:<br>
      + * cbeust, 2006/08/22
      + * <blockquote>
      + *   Java annotations (start with "@") are now captured as literals ("lit")
      + * </blockquote>
      + * @requires console
      + */
      +
      +// JSLint declarations
      +/*global console, document, navigator, setTimeout, window */
      +
      +/**
      + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
      + * UI events.
      + * If set to {@code false}, {@code prettyPrint()} is synchronous.
      + */
      +window['PR_SHOULD_USE_CONTINUATION'] = true;
      +
      +(function () {
      +  // Keyword lists for various languages.
      +  // We use things that coerce to strings to make them compact when minified
      +  // and to defeat aggressive optimizers that fold large string constants.
      +  var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
      +  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + 
      +      "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
      +      "static,struct,switch,typedef,union,unsigned,void,volatile"];
      +  var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
      +      "new,operator,private,protected,public,this,throw,true,try,typeof"];
      +  var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
      +      "concept,concept_map,const_cast,constexpr,decltype," +
      +      "dynamic_cast,explicit,export,friend,inline,late_check," +
      +      "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
      +      "template,typeid,typename,using,virtual,where"];
      +  var JAVA_KEYWORDS = [COMMON_KEYWORDS,
      +      "abstract,boolean,byte,extends,final,finally,implements,import," +
      +      "instanceof,null,native,package,strictfp,super,synchronized,throws," +
      +      "transient"];
      +  var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
      +      "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
      +      "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
      +      "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
      +      "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
      +  var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
      +      "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
      +      "true,try,unless,until,when,while,yes";
      +  var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
      +      "debugger,eval,export,function,get,null,set,undefined,var,with," +
      +      "Infinity,NaN"];
      +  var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
      +      "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
      +      "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
      +  var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
      +      "elif,except,exec,finally,from,global,import,in,is,lambda," +
      +      "nonlocal,not,or,pass,print,raise,try,with,yield," +
      +      "False,True,None"];
      +  var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
      +      "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
      +      "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
      +      "BEGIN,END"];
      +  var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
      +      "function,in,local,set,then,until"];
      +  var ALL_KEYWORDS = [
      +      CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
      +      PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
      +  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
      +
      +  // token style names.  correspond to css classes
      +  /**
      +   * token style for a string literal
      +   * @const
      +   */
      +  var PR_STRING = 'str';
      +  /**
      +   * token style for a keyword
      +   * @const
      +   */
      +  var PR_KEYWORD = 'kwd';
      +  /**
      +   * token style for a comment
      +   * @const
      +   */
      +  var PR_COMMENT = 'com';
      +  /**
      +   * token style for a type
      +   * @const
      +   */
      +  var PR_TYPE = 'typ';
      +  /**
      +   * token style for a literal value.  e.g. 1, null, true.
      +   * @const
      +   */
      +  var PR_LITERAL = 'lit';
      +  /**
      +   * token style for a punctuation string.
      +   * @const
      +   */
      +  var PR_PUNCTUATION = 'pun';
      +  /**
      +   * token style for a punctuation string.
      +   * @const
      +   */
      +  var PR_PLAIN = 'pln';
      +
      +  /**
      +   * token style for an sgml tag.
      +   * @const
      +   */
      +  var PR_TAG = 'tag';
      +  /**
      +   * token style for a markup declaration such as a DOCTYPE.
      +   * @const
      +   */
      +  var PR_DECLARATION = 'dec';
      +  /**
      +   * token style for embedded source.
      +   * @const
      +   */
      +  var PR_SOURCE = 'src';
      +  /**
      +   * token style for an sgml attribute name.
      +   * @const
      +   */
      +  var PR_ATTRIB_NAME = 'atn';
      +  /**
      +   * token style for an sgml attribute value.
      +   * @const
      +   */
      +  var PR_ATTRIB_VALUE = 'atv';
      +
      +  /**
      +   * A class that indicates a section of markup that is not code, e.g. to allow
      +   * embedding of line numbers within code listings.
      +   * @const
      +   */
      +  var PR_NOCODE = 'nocode';
      +
      +
      +
      +/**
      + * A set of tokens that can precede a regular expression literal in
      + * javascript
      + * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
      + * has the full list, but I've removed ones that might be problematic when
      + * seen in languages that don't support regular expression literals.
      + *
      + * <p>Specifically, I've removed any keywords that can't precede a regexp
      + * literal in a syntactically legal javascript program, and I've removed the
      + * "in" keyword since it's not a keyword in many languages, and might be used
      + * as a count of inches.
      + *
      + * <p>The link a above does not accurately describe EcmaScript rules since
      + * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
      + * very well in practice.
      + *
      + * @private
      + * @const
      + */
      +var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
      +
      +// CAVEAT: this does not properly handle the case where a regular
      +// expression immediately follows another since a regular expression may
      +// have flags for case-sensitivity and the like.  Having regexp tokens
      +// adjacent is not valid in any language I'm aware of, so I'm punting.
      +// TODO: maybe style special characters inside a regexp as punctuation.
      +
      +
      +  /**
      +   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
      +   * matches the union of the sets of strings matched by the input RegExp.
      +   * Since it matches globally, if the input strings have a start-of-input
      +   * anchor (/^.../), it is ignored for the purposes of unioning.
      +   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
      +   * @return {RegExp} a global regex.
      +   */
      +  function combinePrefixPatterns(regexs) {
      +    var capturedGroupIndex = 0;
      +  
      +    var needToFoldCase = false;
      +    var ignoreCase = false;
      +    for (var i = 0, n = regexs.length; i < n; ++i) {
      +      var regex = regexs[i];
      +      if (regex.ignoreCase) {
      +        ignoreCase = true;
      +      } else if (/[a-z]/i.test(regex.source.replace(
      +                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
      +        needToFoldCase = true;
      +        ignoreCase = false;
      +        break;
      +      }
      +    }
      +  
      +    var escapeCharToCodeUnit = {
      +      'b': 8,
      +      't': 9,
      +      'n': 0xa,
      +      'v': 0xb,
      +      'f': 0xc,
      +      'r': 0xd
      +    };
      +  
      +    function decodeEscape(charsetPart) {
      +      var cc0 = charsetPart.charCodeAt(0);
      +      if (cc0 !== 92 /* \\ */) {
      +        return cc0;
      +      }
      +      var c1 = charsetPart.charAt(1);
      +      cc0 = escapeCharToCodeUnit[c1];
      +      if (cc0) {
      +        return cc0;
      +      } else if ('0' <= c1 && c1 <= '7') {
      +        return parseInt(charsetPart.substring(1), 8);
      +      } else if (c1 === 'u' || c1 === 'x') {
      +        return parseInt(charsetPart.substring(2), 16);
      +      } else {
      +        return charsetPart.charCodeAt(1);
      +      }
      +    }
      +  
      +    function encodeEscape(charCode) {
      +      if (charCode < 0x20) {
      +        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
      +      }
      +      var ch = String.fromCharCode(charCode);
      +      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
      +        ch = '\\' + ch;
      +      }
      +      return ch;
      +    }
      +  
      +    function caseFoldCharset(charSet) {
      +      var charsetParts = charSet.substring(1, charSet.length - 1).match(
      +          new RegExp(
      +              '\\\\u[0-9A-Fa-f]{4}'
      +              + '|\\\\x[0-9A-Fa-f]{2}'
      +              + '|\\\\[0-3][0-7]{0,2}'
      +              + '|\\\\[0-7]{1,2}'
      +              + '|\\\\[\\s\\S]'
      +              + '|-'
      +              + '|[^-\\\\]',
      +              'g'));
      +      var groups = [];
      +      var ranges = [];
      +      var inverse = charsetParts[0] === '^';
      +      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
      +        var p = charsetParts[i];
      +        if (/\\[bdsw]/i.test(p)) {  // Don't muck with named groups.
      +          groups.push(p);
      +        } else {
      +          var start = decodeEscape(p);
      +          var end;
      +          if (i + 2 < n && '-' === charsetParts[i + 1]) {
      +            end = decodeEscape(charsetParts[i + 2]);
      +            i += 2;
      +          } else {
      +            end = start;
      +          }
      +          ranges.push([start, end]);
      +          // If the range might intersect letters, then expand it.
      +          // This case handling is too simplistic.
      +          // It does not deal with non-latin case folding.
      +          // It works for latin source code identifiers though.
      +          if (!(end < 65 || start > 122)) {
      +            if (!(end < 65 || start > 90)) {
      +              ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
      +            }
      +            if (!(end < 97 || start > 122)) {
      +              ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
      +            }
      +          }
      +        }
      +      }
      +  
      +      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
      +      // -> [[1, 12], [14, 14], [16, 17]]
      +      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
      +      var consolidatedRanges = [];
      +      var lastRange = [NaN, NaN];
      +      for (var i = 0; i < ranges.length; ++i) {
      +        var range = ranges[i];
      +        if (range[0] <= lastRange[1] + 1) {
      +          lastRange[1] = Math.max(lastRange[1], range[1]);
      +        } else {
      +          consolidatedRanges.push(lastRange = range);
      +        }
      +      }
      +  
      +      var out = ['['];
      +      if (inverse) { out.push('^'); }
      +      out.push.apply(out, groups);
      +      for (var i = 0; i < consolidatedRanges.length; ++i) {
      +        var range = consolidatedRanges[i];
      +        out.push(encodeEscape(range[0]));
      +        if (range[1] > range[0]) {
      +          if (range[1] + 1 > range[0]) { out.push('-'); }
      +          out.push(encodeEscape(range[1]));
      +        }
      +      }
      +      out.push(']');
      +      return out.join('');
      +    }
      +  
      +    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
      +      // Split into character sets, escape sequences, punctuation strings
      +      // like ('(', '(?:', ')', '^'), and runs of characters that do not
      +      // include any of the above.
      +      var parts = regex.source.match(
      +          new RegExp(
      +              '(?:'
      +              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
      +              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
      +              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
      +              + '|\\\\[0-9]+'  // a back-reference or octal escape
      +              + '|\\\\[^ux0-9]'  // other escape sequence
      +              + '|\\(\\?[:!=]'  // start of a non-capturing group
      +              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
      +              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
      +              + ')',
      +              'g'));
      +      var n = parts.length;
      +  
      +      // Maps captured group numbers to the number they will occupy in
      +      // the output or to -1 if that has not been determined, or to
      +      // undefined if they need not be capturing in the output.
      +      var capturedGroups = [];
      +  
      +      // Walk over and identify back references to build the capturedGroups
      +      // mapping.
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        var p = parts[i];
      +        if (p === '(') {
      +          // groups are 1-indexed, so max group index is count of '('
      +          ++groupIndex;
      +        } else if ('\\' === p.charAt(0)) {
      +          var decimalValue = +p.substring(1);
      +          if (decimalValue && decimalValue <= groupIndex) {
      +            capturedGroups[decimalValue] = -1;
      +          }
      +        }
      +      }
      +  
      +      // Renumber groups and reduce capturing groups to non-capturing groups
      +      // where possible.
      +      for (var i = 1; i < capturedGroups.length; ++i) {
      +        if (-1 === capturedGroups[i]) {
      +          capturedGroups[i] = ++capturedGroupIndex;
      +        }
      +      }
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        var p = parts[i];
      +        if (p === '(') {
      +          ++groupIndex;
      +          if (capturedGroups[groupIndex] === undefined) {
      +            parts[i] = '(?:';
      +          }
      +        } else if ('\\' === p.charAt(0)) {
      +          var decimalValue = +p.substring(1);
      +          if (decimalValue && decimalValue <= groupIndex) {
      +            parts[i] = '\\' + capturedGroups[groupIndex];
      +          }
      +        }
      +      }
      +  
      +      // Remove any prefix anchors so that the output will match anywhere.
      +      // ^^ really does mean an anchored match though.
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
      +      }
      +  
      +      // Expand letters to groups to handle mixing of case-sensitive and
      +      // case-insensitive patterns if necessary.
      +      if (regex.ignoreCase && needToFoldCase) {
      +        for (var i = 0; i < n; ++i) {
      +          var p = parts[i];
      +          var ch0 = p.charAt(0);
      +          if (p.length >= 2 && ch0 === '[') {
      +            parts[i] = caseFoldCharset(p);
      +          } else if (ch0 !== '\\') {
      +            // TODO: handle letters in numeric escapes.
      +            parts[i] = p.replace(
      +                /[a-zA-Z]/g,
      +                function (ch) {
      +                  var cc = ch.charCodeAt(0);
      +                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
      +                });
      +          }
      +        }
      +      }
      +  
      +      return parts.join('');
      +    }
      +  
      +    var rewritten = [];
      +    for (var i = 0, n = regexs.length; i < n; ++i) {
      +      var regex = regexs[i];
      +      if (regex.global || regex.multiline) { throw new Error('' + regex); }
      +      rewritten.push(
      +          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
      +    }
      +  
      +    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
      +  }
      +
      +
      +  /**
      +   * Split markup into a string of source code and an array mapping ranges in
      +   * that string to the text nodes in which they appear.
      +   *
      +   * <p>
      +   * The HTML DOM structure:</p>
      +   * <pre>
      +   * (Element   "p"
      +   *   (Element "b"
      +   *     (Text  "print "))       ; #1
      +   *   (Text    "'Hello '")      ; #2
      +   *   (Element "br")            ; #3
      +   *   (Text    "  + 'World';")) ; #4
      +   * </pre>
      +   * <p>
      +   * corresponds to the HTML
      +   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
      +   *
      +   * <p>
      +   * It will produce the output:</p>
      +   * <pre>
      +   * {
      +   *   sourceCode: "print 'Hello '\n  + 'World';",
      +   *   //                 1         2
      +   *   //       012345678901234 5678901234567
      +   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
      +   * }
      +   * </pre>
      +   * <p>
      +   * where #1 is a reference to the {@code "print "} text node above, and so
      +   * on for the other text nodes.
      +   * </p>
      +   *
      +   * <p>
      +   * The {@code} spans array is an array of pairs.  Even elements are the start
      +   * indices of substrings, and odd elements are the text nodes (or BR elements)
      +   * that contain the text for those substrings.
      +   * Substrings continue until the next index or the end of the source.
      +   * </p>
      +   *
      +   * @param {Node} node an HTML DOM subtree containing source-code.
      +   * @return {Object} source code and the text nodes in which they occur.
      +   */
      +  function extractSourceSpans(node) {
      +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
      +  
      +    var chunks = [];
      +    var length = 0;
      +    var spans = [];
      +    var k = 0;
      +  
      +    var whitespace;
      +    if (node.currentStyle) {
      +      whitespace = node.currentStyle.whiteSpace;
      +    } else if (window.getComputedStyle) {
      +      whitespace = document.defaultView.getComputedStyle(node, null)
      +          .getPropertyValue('white-space');
      +    }
      +    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
      +  
      +    function walk(node) {
      +      switch (node.nodeType) {
      +        case 1:  // Element
      +          if (nocode.test(node.className)) { return; }
      +          for (var child = node.firstChild; child; child = child.nextSibling) {
      +            walk(child);
      +          }
      +          var nodeName = node.nodeName;
      +          if ('BR' === nodeName || 'LI' === nodeName) {
      +            chunks[k] = '\n';
      +            spans[k << 1] = length++;
      +            spans[(k++ << 1) | 1] = node;
      +          }
      +          break;
      +        case 3: case 4:  // Text
      +          var text = node.nodeValue;
      +          if (text.length) {
      +            if (!isPreformatted) {
      +              text = text.replace(/[ \t\r\n]+/g, ' ');
      +            } else {
      +              text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
      +            }
      +            // TODO: handle tabs here?
      +            chunks[k] = text;
      +            spans[k << 1] = length;
      +            length += text.length;
      +            spans[(k++ << 1) | 1] = node;
      +          }
      +          break;
      +      }
      +    }
      +  
      +    walk(node);
      +  
      +    return {
      +      sourceCode: chunks.join('').replace(/\n$/, ''),
      +      spans: spans
      +    };
      +  }
      +
      +
      +  /**
      +   * Apply the given language handler to sourceCode and add the resulting
      +   * decorations to out.
      +   * @param {number} basePos the index of sourceCode within the chunk of source
      +   *    whose decorations are already present on out.
      +   */
      +  function appendDecorations(basePos, sourceCode, langHandler, out) {
      +    if (!sourceCode) { return; }
      +    var job = {
      +      sourceCode: sourceCode,
      +      basePos: basePos
      +    };
      +    langHandler(job);
      +    out.push.apply(out, job.decorations);
      +  }
      +
      +  var notWs = /\S/;
      +
      +  /**
      +   * Given an element, if it contains only one child element and any text nodes
      +   * it contains contain only space characters, return the sole child element.
      +   * Otherwise returns undefined.
      +   * <p>
      +   * This is meant to return the CODE element in {@code <pre><code ...>} when
      +   * there is a single child element that contains all the non-space textual
      +   * content, but not to return anything where there are multiple child elements
      +   * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
      +   * is textual content.
      +   */
      +  function childContentWrapper(element) {
      +    var wrapper = undefined;
      +    for (var c = element.firstChild; c; c = c.nextSibling) {
      +      var type = c.nodeType;
      +      wrapper = (type === 1)  // Element Node
      +          ? (wrapper ? element : c)
      +          : (type === 3)  // Text Node
      +          ? (notWs.test(c.nodeValue) ? element : wrapper)
      +          : wrapper;
      +    }
      +    return wrapper === element ? undefined : wrapper;
      +  }
      +
      +  /** Given triples of [style, pattern, context] returns a lexing function,
      +    * The lexing function interprets the patterns to find token boundaries and
      +    * returns a decoration list of the form
      +    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
      +    * where index_n is an index into the sourceCode, and style_n is a style
      +    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
      +    * all characters in sourceCode[index_n-1:index_n].
      +    *
      +    * The stylePatterns is a list whose elements have the form
      +    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
      +    *
      +    * Style is a style constant like PR_PLAIN, or can be a string of the
      +    * form 'lang-FOO', where FOO is a language extension describing the
      +    * language of the portion of the token in $1 after pattern executes.
      +    * E.g., if style is 'lang-lisp', and group 1 contains the text
      +    * '(hello (world))', then that portion of the token will be passed to the
      +    * registered lisp handler for formatting.
      +    * The text before and after group 1 will be restyled using this decorator
      +    * so decorators should take care that this doesn't result in infinite
      +    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
      +    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
      +    * '<script>foo()<\/script>', which would cause the current decorator to
      +    * be called with '<script>' which would not match the same rule since
      +    * group 1 must not be empty, so it would be instead styled as PR_TAG by
      +    * the generic tag rule.  The handler registered for the 'js' extension would
      +    * then be called with 'foo()', and finally, the current decorator would
      +    * be called with '<\/script>' which would not match the original rule and
      +    * so the generic tag rule would identify it as a tag.
      +    *
      +    * Pattern must only match prefixes, and if it matches a prefix, then that
      +    * match is considered a token with the same style.
      +    *
      +    * Context is applied to the last non-whitespace, non-comment token
      +    * recognized.
      +    *
      +    * Shortcut is an optional string of characters, any of which, if the first
      +    * character, gurantee that this pattern and only this pattern matches.
      +    *
      +    * @param {Array} shortcutStylePatterns patterns that always start with
      +    *   a known character.  Must have a shortcut string.
      +    * @param {Array} fallthroughStylePatterns patterns that will be tried in
      +    *   order if the shortcut ones fail.  May have shortcuts.
      +    *
      +    * @return {function (Object)} a
      +    *   function that takes source code and returns a list of decorations.
      +    */
      +  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
      +    var shortcuts = {};
      +    var tokenizer;
      +    (function () {
      +      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
      +      var allRegexs = [];
      +      var regexKeys = {};
      +      for (var i = 0, n = allPatterns.length; i < n; ++i) {
      +        var patternParts = allPatterns[i];
      +        var shortcutChars = patternParts[3];
      +        if (shortcutChars) {
      +          for (var c = shortcutChars.length; --c >= 0;) {
      +            shortcuts[shortcutChars.charAt(c)] = patternParts;
      +          }
      +        }
      +        var regex = patternParts[1];
      +        var k = '' + regex;
      +        if (!regexKeys.hasOwnProperty(k)) {
      +          allRegexs.push(regex);
      +          regexKeys[k] = null;
      +        }
      +      }
      +      allRegexs.push(/[\0-\uffff]/);
      +      tokenizer = combinePrefixPatterns(allRegexs);
      +    })();
      +
      +    var nPatterns = fallthroughStylePatterns.length;
      +
      +    /**
      +     * Lexes job.sourceCode and produces an output array job.decorations of
      +     * style classes preceded by the position at which they start in
      +     * job.sourceCode in order.
      +     *
      +     * @param {Object} job an object like <pre>{
      +     *    sourceCode: {string} sourceText plain text,
      +     *    basePos: {int} position of job.sourceCode in the larger chunk of
      +     *        sourceCode.
      +     * }</pre>
      +     */
      +    var decorate = function (job) {
      +      var sourceCode = job.sourceCode, basePos = job.basePos;
      +      /** Even entries are positions in source in ascending order.  Odd enties
      +        * are style markers (e.g., PR_COMMENT) that run from that position until
      +        * the end.
      +        * @type {Array.<number|string>}
      +        */
      +      var decorations = [basePos, PR_PLAIN];
      +      var pos = 0;  // index into sourceCode
      +      var tokens = sourceCode.match(tokenizer) || [];
      +      var styleCache = {};
      +
      +      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
      +        var token = tokens[ti];
      +        var style = styleCache[token];
      +        var match = void 0;
      +
      +        var isEmbedded;
      +        if (typeof style === 'string') {
      +          isEmbedded = false;
      +        } else {
      +          var patternParts = shortcuts[token.charAt(0)];
      +          if (patternParts) {
      +            match = token.match(patternParts[1]);
      +            style = patternParts[0];
      +          } else {
      +            for (var i = 0; i < nPatterns; ++i) {
      +              patternParts = fallthroughStylePatterns[i];
      +              match = token.match(patternParts[1]);
      +              if (match) {
      +                style = patternParts[0];
      +                break;
      +              }
      +            }
      +
      +            if (!match) {  // make sure that we make progress
      +              style = PR_PLAIN;
      +            }
      +          }
      +
      +          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
      +          if (isEmbedded && !(match && typeof match[1] === 'string')) {
      +            isEmbedded = false;
      +            style = PR_SOURCE;
      +          }
      +
      +          if (!isEmbedded) { styleCache[token] = style; }
      +        }
      +
      +        var tokenStart = pos;
      +        pos += token.length;
      +
      +        if (!isEmbedded) {
      +          decorations.push(basePos + tokenStart, style);
      +        } else {  // Treat group 1 as an embedded block of source code.
      +          var embeddedSource = match[1];
      +          var embeddedSourceStart = token.indexOf(embeddedSource);
      +          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
      +          if (match[2]) {
      +            // If embeddedSource can be blank, then it would match at the
      +            // beginning which would cause us to infinitely recurse on the
      +            // entire token, so we catch the right context in match[2].
      +            embeddedSourceEnd = token.length - match[2].length;
      +            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
      +          }
      +          var lang = style.substring(5);
      +          // Decorate the left of the embedded source
      +          appendDecorations(
      +              basePos + tokenStart,
      +              token.substring(0, embeddedSourceStart),
      +              decorate, decorations);
      +          // Decorate the embedded source
      +          appendDecorations(
      +              basePos + tokenStart + embeddedSourceStart,
      +              embeddedSource,
      +              langHandlerForExtension(lang, embeddedSource),
      +              decorations);
      +          // Decorate the right of the embedded section
      +          appendDecorations(
      +              basePos + tokenStart + embeddedSourceEnd,
      +              token.substring(embeddedSourceEnd),
      +              decorate, decorations);
      +        }
      +      }
      +      job.decorations = decorations;
      +    };
      +    return decorate;
      +  }
      +
      +  /** returns a function that produces a list of decorations from source text.
      +    *
      +    * This code treats ", ', and ` as string delimiters, and \ as a string
      +    * escape.  It does not recognize perl's qq() style strings.
      +    * It has no special handling for double delimiter escapes as in basic, or
      +    * the tripled delimiters used in python, but should work on those regardless
      +    * although in those cases a single string literal may be broken up into
      +    * multiple adjacent string literals.
      +    *
      +    * It recognizes C, C++, and shell style comments.
      +    *
      +    * @param {Object} options a set of optional parameters.
      +    * @return {function (Object)} a function that examines the source code
      +    *     in the input job and builds the decoration list.
      +    */
      +  function sourceDecorator(options) {
      +    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
      +    if (options['tripleQuotedStrings']) {
      +      // '''multi-line-string''', 'single-line-string', and double-quoted
      +      shortcutStylePatterns.push(
      +          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
      +           null, '\'"']);
      +    } else if (options['multiLineStrings']) {
      +      // 'multi-line-string', "multi-line-string"
      +      shortcutStylePatterns.push(
      +          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
      +           null, '\'"`']);
      +    } else {
      +      // 'single-line-string', "single-line-string"
      +      shortcutStylePatterns.push(
      +          [PR_STRING,
      +           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
      +           null, '"\'']);
      +    }
      +    if (options['verbatimStrings']) {
      +      // verbatim-string-literal production from the C# grammar.  See issue 93.
      +      fallthroughStylePatterns.push(
      +          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
      +    }
      +    var hc = options['hashComments'];
      +    if (hc) {
      +      if (options['cStyleComments']) {
      +        if (hc > 1) {  // multiline hash comments
      +          shortcutStylePatterns.push(
      +              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
      +        } else {
      +          // Stop C preprocessor declarations at an unclosed open comment
      +          shortcutStylePatterns.push(
      +              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
      +               null, '#']);
      +        }
      +        fallthroughStylePatterns.push(
      +            [PR_STRING,
      +             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
      +             null]);
      +      } else {
      +        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
      +      }
      +    }
      +    if (options['cStyleComments']) {
      +      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
      +      fallthroughStylePatterns.push(
      +          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
      +    }
      +    if (options['regexLiterals']) {
      +      /**
      +       * @const
      +       */
      +      var REGEX_LITERAL = (
      +          // A regular expression literal starts with a slash that is
      +          // not followed by * or / so that it is not confused with
      +          // comments.
      +          '/(?=[^/*])'
      +          // and then contains any number of raw characters,
      +          + '(?:[^/\\x5B\\x5C]'
      +          // escape sequences (\x5C),
      +          +    '|\\x5C[\\s\\S]'
      +          // or non-nesting character sets (\x5B\x5D);
      +          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
      +          // finally closed by a /.
      +          + '/');
      +      fallthroughStylePatterns.push(
      +          ['lang-regex',
      +           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
      +           ]);
      +    }
      +
      +    var types = options['types'];
      +    if (types) {
      +      fallthroughStylePatterns.push([PR_TYPE, types]);
      +    }
      +
      +    var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
      +    if (keywords.length) {
      +      fallthroughStylePatterns.push(
      +          [PR_KEYWORD,
      +           new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
      +           null]);
      +    }
      +
      +    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
      +    fallthroughStylePatterns.push(
      +        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
      +        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
      +        [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
      +        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
      +        [PR_LITERAL,
      +         new RegExp(
      +             '^(?:'
      +             // A hex number
      +             + '0x[a-f0-9]+'
      +             // or an octal or decimal number,
      +             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
      +             // possibly in scientific notation
      +             + '(?:e[+\\-]?\\d+)?'
      +             + ')'
      +             // with an optional modifier like UL for unsigned long
      +             + '[a-z]*', 'i'),
      +         null, '0123456789'],
      +        // Don't treat escaped quotes in bash as starting strings.  See issue 144.
      +        [PR_PLAIN,       /^\\[\s\S]?/, null],
      +        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
      +
      +    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
      +  }
      +
      +  var decorateSource = sourceDecorator({
      +        'keywords': ALL_KEYWORDS,
      +        'hashComments': true,
      +        'cStyleComments': true,
      +        'multiLineStrings': true,
      +        'regexLiterals': true
      +      });
      +
      +  /**
      +   * Given a DOM subtree, wraps it in a list, and puts each line into its own
      +   * list item.
      +   *
      +   * @param {Node} node modified in place.  Its content is pulled into an
      +   *     HTMLOListElement, and each line is moved into a separate list item.
      +   *     This requires cloning elements, so the input might not have unique
      +   *     IDs after numbering.
      +   */
      +  function numberLines(node, opt_startLineNum) {
      +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
      +    var lineBreak = /\r\n?|\n/;
      +  
      +    var document = node.ownerDocument;
      +  
      +    var whitespace;
      +    if (node.currentStyle) {
      +      whitespace = node.currentStyle.whiteSpace;
      +    } else if (window.getComputedStyle) {
      +      whitespace = document.defaultView.getComputedStyle(node, null)
      +          .getPropertyValue('white-space');
      +    }
      +    // If it's preformatted, then we need to split lines on line breaks
      +    // in addition to <BR>s.
      +    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
      +  
      +    var li = document.createElement('LI');
      +    while (node.firstChild) {
      +      li.appendChild(node.firstChild);
      +    }
      +    // An array of lines.  We split below, so this is initialized to one
      +    // un-split line.
      +    var listItems = [li];
      +  
      +    function walk(node) {
      +      switch (node.nodeType) {
      +        case 1:  // Element
      +          if (nocode.test(node.className)) { break; }
      +          if ('BR' === node.nodeName) {
      +            breakAfter(node);
      +            // Discard the <BR> since it is now flush against a </LI>.
      +            if (node.parentNode) {
      +              node.parentNode.removeChild(node);
      +            }
      +          } else {
      +            for (var child = node.firstChild; child; child = child.nextSibling) {
      +              walk(child);
      +            }
      +          }
      +          break;
      +        case 3: case 4:  // Text
      +          if (isPreformatted) {
      +            var text = node.nodeValue;
      +            var match = text.match(lineBreak);
      +            if (match) {
      +              var firstLine = text.substring(0, match.index);
      +              node.nodeValue = firstLine;
      +              var tail = text.substring(match.index + match[0].length);
      +              if (tail) {
      +                var parent = node.parentNode;
      +                parent.insertBefore(
      +                    document.createTextNode(tail), node.nextSibling);
      +              }
      +              breakAfter(node);
      +              if (!firstLine) {
      +                // Don't leave blank text nodes in the DOM.
      +                node.parentNode.removeChild(node);
      +              }
      +            }
      +          }
      +          break;
      +      }
      +    }
      +  
      +    // Split a line after the given node.
      +    function breakAfter(lineEndNode) {
      +      // If there's nothing to the right, then we can skip ending the line
      +      // here, and move root-wards since splitting just before an end-tag
      +      // would require us to create a bunch of empty copies.
      +      while (!lineEndNode.nextSibling) {
      +        lineEndNode = lineEndNode.parentNode;
      +        if (!lineEndNode) { return; }
      +      }
      +  
      +      function breakLeftOf(limit, copy) {
      +        // Clone shallowly if this node needs to be on both sides of the break.
      +        var rightSide = copy ? limit.cloneNode(false) : limit;
      +        var parent = limit.parentNode;
      +        if (parent) {
      +          // We clone the parent chain.
      +          // This helps us resurrect important styling elements that cross lines.
      +          // E.g. in <i>Foo<br>Bar</i>
      +          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
      +          var parentClone = breakLeftOf(parent, 1);
      +          // Move the clone and everything to the right of the original
      +          // onto the cloned parent.
      +          var next = limit.nextSibling;
      +          parentClone.appendChild(rightSide);
      +          for (var sibling = next; sibling; sibling = next) {
      +            next = sibling.nextSibling;
      +            parentClone.appendChild(sibling);
      +          }
      +        }
      +        return rightSide;
      +      }
      +  
      +      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
      +  
      +      // Walk the parent chain until we reach an unattached LI.
      +      for (var parent;
      +           // Check nodeType since IE invents document fragments.
      +           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
      +        copiedListItem = parent;
      +      }
      +      // Put it on the list of lines for later processing.
      +      listItems.push(copiedListItem);
      +    }
      +  
      +    // Split lines while there are lines left to split.
      +    for (var i = 0;  // Number of lines that have been split so far.
      +         i < listItems.length;  // length updated by breakAfter calls.
      +         ++i) {
      +      walk(listItems[i]);
      +    }
      +  
      +    // Make sure numeric indices show correctly.
      +    if (opt_startLineNum === (opt_startLineNum|0)) {
      +      listItems[0].setAttribute('value', opt_startLineNum);
      +    }
      +  
      +    var ol = document.createElement('OL');
      +    ol.className = 'linenums';
      +    var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
      +    for (var i = 0, n = listItems.length; i < n; ++i) {
      +      li = listItems[i];
      +      // Stick a class on the LIs so that stylesheets can
      +      // color odd/even rows, or any other row pattern that
      +      // is co-prime with 10.
      +      li.className = 'L' + ((i + offset) % 10);
      +      if (!li.firstChild) {
      +        li.appendChild(document.createTextNode('\xA0'));
      +      }
      +      ol.appendChild(li);
      +    }
      +  
      +    node.appendChild(ol);
      +  }
      +
      +  /**
      +   * Breaks {@code job.sourceCode} around style boundaries in
      +   * {@code job.decorations} and modifies {@code job.sourceNode} in place.
      +   * @param {Object} job like <pre>{
      +   *    sourceCode: {string} source as plain text,
      +   *    spans: {Array.<number|Node>} alternating span start indices into source
      +   *       and the text node or element (e.g. {@code <BR>}) corresponding to that
      +   *       span.
      +   *    decorations: {Array.<number|string} an array of style classes preceded
      +   *       by the position at which they start in job.sourceCode in order
      +   * }</pre>
      +   * @private
      +   */
      +  function recombineTagsAndDecorations(job) {
      +    var isIE = /\bMSIE\b/.test(navigator.userAgent);
      +    var newlineRe = /\n/g;
      +  
      +    var source = job.sourceCode;
      +    var sourceLength = source.length;
      +    // Index into source after the last code-unit recombined.
      +    var sourceIndex = 0;
      +  
      +    var spans = job.spans;
      +    var nSpans = spans.length;
      +    // Index into spans after the last span which ends at or before sourceIndex.
      +    var spanIndex = 0;
      +  
      +    var decorations = job.decorations;
      +    var nDecorations = decorations.length;
      +    // Index into decorations after the last decoration which ends at or before
      +    // sourceIndex.
      +    var decorationIndex = 0;
      +  
      +    // Remove all zero-length decorations.
      +    decorations[nDecorations] = sourceLength;
      +    var decPos, i;
      +    for (i = decPos = 0; i < nDecorations;) {
      +      if (decorations[i] !== decorations[i + 2]) {
      +        decorations[decPos++] = decorations[i++];
      +        decorations[decPos++] = decorations[i++];
      +      } else {
      +        i += 2;
      +      }
      +    }
      +    nDecorations = decPos;
      +  
      +    // Simplify decorations.
      +    for (i = decPos = 0; i < nDecorations;) {
      +      var startPos = decorations[i];
      +      // Conflate all adjacent decorations that use the same style.
      +      var startDec = decorations[i + 1];
      +      var end = i + 2;
      +      while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
      +        end += 2;
      +      }
      +      decorations[decPos++] = startPos;
      +      decorations[decPos++] = startDec;
      +      i = end;
      +    }
      +  
      +    nDecorations = decorations.length = decPos;
      +  
      +    var decoration = null;
      +    while (spanIndex < nSpans) {
      +      var spanStart = spans[spanIndex];
      +      var spanEnd = spans[spanIndex + 2] || sourceLength;
      +  
      +      var decStart = decorations[decorationIndex];
      +      var decEnd = decorations[decorationIndex + 2] || sourceLength;
      +  
      +      var end = Math.min(spanEnd, decEnd);
      +  
      +      var textNode = spans[spanIndex + 1];
      +      var styledText;
      +      if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
      +          // Don't introduce spans around empty text nodes.
      +          && (styledText = source.substring(sourceIndex, end))) {
      +        // This may seem bizarre, and it is.  Emitting LF on IE causes the
      +        // code to display with spaces instead of line breaks.
      +        // Emitting Windows standard issue linebreaks (CRLF) causes a blank
      +        // space to appear at the beginning of every line but the first.
      +        // Emitting an old Mac OS 9 line separator makes everything spiffy.
      +        if (isIE) { styledText = styledText.replace(newlineRe, '\r'); }
      +        textNode.nodeValue = styledText;
      +        var document = textNode.ownerDocument;
      +        var span = document.createElement('SPAN');
      +        span.className = decorations[decorationIndex + 1];
      +        var parentNode = textNode.parentNode;
      +        parentNode.replaceChild(span, textNode);
      +        span.appendChild(textNode);
      +        if (sourceIndex < spanEnd) {  // Split off a text node.
      +          spans[spanIndex + 1] = textNode
      +              // TODO: Possibly optimize by using '' if there's no flicker.
      +              = document.createTextNode(source.substring(end, spanEnd));
      +          parentNode.insertBefore(textNode, span.nextSibling);
      +        }
      +      }
      +  
      +      sourceIndex = end;
      +  
      +      if (sourceIndex >= spanEnd) {
      +        spanIndex += 2;
      +      }
      +      if (sourceIndex >= decEnd) {
      +        decorationIndex += 2;
      +      }
      +    }
      +  }
      +
      +
      +  /** Maps language-specific file extensions to handlers. */
      +  var langHandlerRegistry = {};
      +  /** Register a language handler for the given file extensions.
      +    * @param {function (Object)} handler a function from source code to a list
      +    *      of decorations.  Takes a single argument job which describes the
      +    *      state of the computation.   The single parameter has the form
      +    *      {@code {
      +    *        sourceCode: {string} as plain text.
      +    *        decorations: {Array.<number|string>} an array of style classes
      +    *                     preceded by the position at which they start in
      +    *                     job.sourceCode in order.
      +    *                     The language handler should assigned this field.
      +    *        basePos: {int} the position of source in the larger source chunk.
      +    *                 All positions in the output decorations array are relative
      +    *                 to the larger source chunk.
      +    *      } }
      +    * @param {Array.<string>} fileExtensions
      +    */
      +  function registerLangHandler(handler, fileExtensions) {
      +    for (var i = fileExtensions.length; --i >= 0;) {
      +      var ext = fileExtensions[i];
      +      if (!langHandlerRegistry.hasOwnProperty(ext)) {
      +        langHandlerRegistry[ext] = handler;
      +      } else if (window['console']) {
      +        console['warn']('cannot override language handler %s', ext);
      +      }
      +    }
      +  }
      +  function langHandlerForExtension(extension, source) {
      +    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
      +      // Treat it as markup if the first non whitespace character is a < and
      +      // the last non-whitespace character is a >.
      +      extension = /^\s*</.test(source)
      +          ? 'default-markup'
      +          : 'default-code';
      +    }
      +    return langHandlerRegistry[extension];
      +  }
      +  registerLangHandler(decorateSource, ['default-code']);
      +  registerLangHandler(
      +      createSimpleLexer(
      +          [],
      +          [
      +           [PR_PLAIN,       /^[^<?]+/],
      +           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
      +           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
      +           // Unescaped content in an unknown language
      +           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
      +           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
      +           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
      +           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
      +           // Unescaped content in javascript.  (Or possibly vbscript).
      +           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
      +           // Contains unescaped stylesheet content
      +           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
      +           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
      +          ]),
      +      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
      +  registerLangHandler(
      +      createSimpleLexer(
      +          [
      +           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
      +           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
      +           ],
      +          [
      +           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
      +           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
      +           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
      +           [PR_PUNCTUATION,  /^[=<>\/]+/],
      +           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
      +           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
      +           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
      +           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
      +           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
      +           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
      +           ]),
      +      ['in.tag']);
      +  registerLangHandler(
      +      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': CPP_KEYWORDS,
      +          'hashComments': true,
      +          'cStyleComments': true,
      +          'types': C_TYPES
      +        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': 'null,true,false'
      +        }), ['json']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': CSHARP_KEYWORDS,
      +          'hashComments': true,
      +          'cStyleComments': true,
      +          'verbatimStrings': true,
      +          'types': C_TYPES
      +        }), ['cs']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': JAVA_KEYWORDS,
      +          'cStyleComments': true
      +        }), ['java']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': SH_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true
      +        }), ['bsh', 'csh', 'sh']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': PYTHON_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'tripleQuotedStrings': true
      +        }), ['cv', 'py']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': PERL_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'regexLiterals': true
      +        }), ['perl', 'pl', 'pm']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': RUBY_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'regexLiterals': true
      +        }), ['rb']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': JSCRIPT_KEYWORDS,
      +          'cStyleComments': true,
      +          'regexLiterals': true
      +        }), ['js']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': COFFEE_KEYWORDS,
      +          'hashComments': 3,  // ### style block comments
      +          'cStyleComments': true,
      +          'multilineStrings': true,
      +          'tripleQuotedStrings': true,
      +          'regexLiterals': true
      +        }), ['coffee']);
      +  registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
      +
      +  function applyDecorator(job) {
      +    var opt_langExtension = job.langExtension;
      +
      +    try {
      +      // Extract tags, and convert the source code to plain text.
      +      var sourceAndSpans = extractSourceSpans(job.sourceNode);
      +      /** Plain text. @type {string} */
      +      var source = sourceAndSpans.sourceCode;
      +      job.sourceCode = source;
      +      job.spans = sourceAndSpans.spans;
      +      job.basePos = 0;
      +
      +      // Apply the appropriate language handler
      +      langHandlerForExtension(opt_langExtension, source)(job);
      +
      +      // Integrate the decorations and tags back into the source code,
      +      // modifying the sourceNode in place.
      +      recombineTagsAndDecorations(job);
      +    } catch (e) {
      +      if ('console' in window) {
      +        console['log'](e && e['stack'] ? e['stack'] : e);
      +      }
      +    }
      +  }
      +
      +  /**
      +   * @param sourceCodeHtml {string} The HTML to pretty print.
      +   * @param opt_langExtension {string} The language name to use.
      +   *     Typically, a filename extension like 'cpp' or 'java'.
      +   * @param opt_numberLines {number|boolean} True to number lines,
      +   *     or the 1-indexed number of the first line in sourceCodeHtml.
      +   */
      +  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
      +    var container = document.createElement('PRE');
      +    // This could cause images to load and onload listeners to fire.
      +    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
      +    // We assume that the inner HTML is from a trusted source.
      +    container.innerHTML = sourceCodeHtml;
      +    if (opt_numberLines) {
      +      numberLines(container, opt_numberLines);
      +    }
      +
      +    var job = {
      +      langExtension: opt_langExtension,
      +      numberLines: opt_numberLines,
      +      sourceNode: container
      +    };
      +    applyDecorator(job);
      +    return container.innerHTML;
      +  }
      +
      +  function prettyPrint(opt_whenDone) {
      +    function byTagName(tn) { return document.getElementsByTagName(tn); }
      +    // fetch a list of nodes to rewrite
      +    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
      +    var elements = [];
      +    for (var i = 0; i < codeSegments.length; ++i) {
      +      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
      +        elements.push(codeSegments[i][j]);
      +      }
      +    }
      +    codeSegments = null;
      +
      +    var clock = Date;
      +    if (!clock['now']) {
      +      clock = { 'now': function () { return +(new Date); } };
      +    }
      +
      +    // The loop is broken into a series of continuations to make sure that we
      +    // don't make the browser unresponsive when rewriting a large page.
      +    var k = 0;
      +    var prettyPrintingJob;
      +
      +    var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
      +    var prettyPrintRe = /\bprettyprint\b/;
      +
      +    function doWork() {
      +      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
      +                     clock['now']() + 250 /* ms */ :
      +                     Infinity);
      +      for (; k < elements.length && clock['now']() < endTime; k++) {
      +        var cs = elements[k];
      +        var className = cs.className;
      +        if (className.indexOf('prettyprint') >= 0) {
      +          // If the classes includes a language extensions, use it.
      +          // Language extensions can be specified like
      +          //     <pre class="prettyprint lang-cpp">
      +          // the language extension "cpp" is used to find a language handler as
      +          // passed to PR.registerLangHandler.
      +          // HTML5 recommends that a language be specified using "language-"
      +          // as the prefix instead.  Google Code Prettify supports both.
      +          // http://dev.w3.org/html5/spec-author-view/the-code-element.html
      +          var langExtension = className.match(langExtensionRe);
      +          // Support <pre class="prettyprint"><code class="language-c">
      +          var wrapper;
      +          if (!langExtension && (wrapper = childContentWrapper(cs))
      +              && "CODE" === wrapper.tagName) {
      +            langExtension = wrapper.className.match(langExtensionRe);
      +          }
      +
      +          if (langExtension) {
      +            langExtension = langExtension[1];
      +          }
      +
      +          // make sure this is not nested in an already prettified element
      +          var nested = false;
      +          for (var p = cs.parentNode; p; p = p.parentNode) {
      +            if ((p.tagName === 'pre' || p.tagName === 'code' ||
      +                 p.tagName === 'xmp') &&
      +                p.className && p.className.indexOf('prettyprint') >= 0) {
      +              nested = true;
      +              break;
      +            }
      +          }
      +          if (!nested) {
      +            // Look for a class like linenums or linenums:<n> where <n> is the
      +            // 1-indexed number of the first line.
      +            var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
      +            lineNums = lineNums
      +                  ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
      +                  : false;
      +            if (lineNums) { numberLines(cs, lineNums); }
      +
      +            // do the pretty printing
      +            prettyPrintingJob = {
      +              langExtension: langExtension,
      +              sourceNode: cs,
      +              numberLines: lineNums
      +            };
      +            applyDecorator(prettyPrintingJob);
      +          }
      +        }
      +      }
      +      if (k < elements.length) {
      +        // finish up in a continuation
      +        setTimeout(doWork, 250);
      +      } else if (opt_whenDone) {
      +        opt_whenDone();
      +      }
      +    }
      +
      +    doWork();
      +  }
      +
      +   /**
      +    * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
      +    * {@code class=prettyprint} and prettify them.
      +    *
      +    * @param {Function?} opt_whenDone if specified, called when the last entry
      +    *     has been finished.
      +    */
      +  window['prettyPrintOne'] = prettyPrintOne;
      +   /**
      +    * Pretty print a chunk of code.
      +    *
      +    * @param {string} sourceCodeHtml code as html
      +    * @return {string} code as html, but prettier
      +    */
      +  window['prettyPrint'] = prettyPrint;
      +   /**
      +    * Contains functions for creating and registering new language handlers.
      +    * @type {Object}
      +    */
      +  window['PR'] = {
      +        'createSimpleLexer': createSimpleLexer,
      +        'registerLangHandler': registerLangHandler,
      +        'sourceDecorator': sourceDecorator,
      +        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
      +        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
      +        'PR_COMMENT': PR_COMMENT,
      +        'PR_DECLARATION': PR_DECLARATION,
      +        'PR_KEYWORD': PR_KEYWORD,
      +        'PR_LITERAL': PR_LITERAL,
      +        'PR_NOCODE': PR_NOCODE,
      +        'PR_PLAIN': PR_PLAIN,
      +        'PR_PUNCTUATION': PR_PUNCTUATION,
      +        'PR_SOURCE': PR_SOURCE,
      +        'PR_STRING': PR_STRING,
      +        'PR_TAG': PR_TAG,
      +        'PR_TYPE': PR_TYPE
      +      };
      +})();
      diff -Nru ipython-0.12/IPython/frontend/html/notebook/static/unminified/README ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/unminified/README
      --- ipython-0.12/IPython/frontend/html/notebook/static/unminified/README	1970-01-01 00:00:00.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/html/notebook/static/unminified/README	2012-04-22 05:10:27.000000000 +0000
      @@ -0,0 +1,14 @@
      +We use minified versions of JQuery / jQueryUI and google-code-prettify in the Notebook.
      +
      +Some package managers require full versions alongside minified, and they can be
      +dropped in here, if necessary.
      +
      +origins of our minified js:
      +prettify:  http://google-code-prettify.googlecode.com/files/prettify-small-1-Jun-2011.tar.bz2
      +jQuery-1.6.2: http://code.jquery.com/jquery-1.6.2.min.js
      +jQueryUI-1.8.14: generated by https://jqueryui.com/download
      +
      +And their unminified counterparts:
      +prettify:  http://google-code-prettify.googlecode.com/files/prettify-1-Jun-2011.tar.bz2
      +jQuery-1.6.2: http://code.jquery.com/jquery-1.6.2.js
      +jQueryUI-1.8.14: https://github.com/jquery/jquery-ui/tarball/1.8.14
      diff -Nru ipython-0.12/IPython/frontend/qt/console/console_widget.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/console_widget.py
      --- ipython-0.12/IPython/frontend/qt/console/console_widget.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/console_widget.py	2012-04-22 05:10:27.000000000 +0000
      @@ -137,15 +137,19 @@
           font_changed = QtCore.Signal(QtGui.QFont)
       
           #------ Protected class variables ------------------------------------------
      -
      +    
      +    # control handles
      +    _control = None
      +    _page_control = None
      +    _splitter = None
      +    
           # When the control key is down, these keys are mapped.
           _ctrl_down_remap = { QtCore.Qt.Key_B : QtCore.Qt.Key_Left,
                                QtCore.Qt.Key_F : QtCore.Qt.Key_Right,
                                QtCore.Qt.Key_A : QtCore.Qt.Key_Home,
                                QtCore.Qt.Key_P : QtCore.Qt.Key_Up,
                                QtCore.Qt.Key_N : QtCore.Qt.Key_Down,
      -                         QtCore.Qt.Key_H : QtCore.Qt.Key_Backspace,
      -                         QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, }
      +                         QtCore.Qt.Key_H : QtCore.Qt.Key_Backspace, }
           if not sys.platform == 'darwin':
               # On OS X, Ctrl-E already does the right thing, whereas End moves the
               # cursor to the bottom of the buffer.
      @@ -183,8 +187,6 @@
               layout = QtGui.QStackedLayout(self)
               layout.setContentsMargins(0, 0, 0, 0)
               self._control = self._create_control()
      -        self._page_control = None
      -        self._splitter = None
               if self.paging in ('hsplit', 'vsplit'):
                   self._splitter = QtGui.QSplitter()
                   if self.paging == 'hsplit':
      @@ -1116,6 +1118,16 @@
                       self._kill_ring.kill_cursor(cursor)
                       intercepted = True
       
      +            elif key == QtCore.Qt.Key_D:
      +                if len(self.input_buffer) == 0:
      +                    self.exit_requested.emit(self)
      +                else:
      +                    new_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress,
      +                                                QtCore.Qt.Key_Delete,
      +                                                QtCore.Qt.NoModifier)
      +                    QtGui.qApp.sendEvent(self._control, new_event)
      +                    intercepted = True
      +
               #------ Alt modifier ---------------------------------------------------
       
               elif alt_down:
      diff -Nru ipython-0.12/IPython/frontend/qt/console/history_console_widget.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/history_console_widget.py
      --- ipython-0.12/IPython/frontend/qt/console/history_console_widget.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/history_console_widget.py	2012-04-22 05:10:27.000000000 +0000
      @@ -217,7 +217,7 @@
               """ Handles replies for code execution, here only session history length
               """
               msg_id = msg['parent_header']['msg_id']
      -        info = self._request_info.get['execute'].pop(msg_id,None)
      +        info = self._request_info['execute'].pop(msg_id,None)
               if info and info.kind == 'save_magic' and not self._hidden:
                   content = msg['content']
                   status = content['status']
      diff -Nru ipython-0.12/IPython/frontend/qt/console/ipython_widget.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/ipython_widget.py
      --- ipython-0.12/IPython/frontend/qt/console/ipython_widget.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/ipython_widget.py	2012-04-22 05:10:27.000000000 +0000
      @@ -533,12 +533,14 @@
               """ Set the style sheets of the underlying widgets.
               """
               self.setStyleSheet(self.style_sheet)
      -        self._control.document().setDefaultStyleSheet(self.style_sheet)
      -        if self._page_control:
      +        if self._control is not None:
      +            self._control.document().setDefaultStyleSheet(self.style_sheet)
      +            bg_color = self._control.palette().window().color()
      +            self._ansi_processor.set_background_color(bg_color)
      +        
      +        if self._page_control is not None:
                   self._page_control.document().setDefaultStyleSheet(self.style_sheet)
       
      -        bg_color = self._control.palette().window().color()
      -        self._ansi_processor.set_background_color(bg_color)
       
       
           def _syntax_style_changed(self):
      diff -Nru ipython-0.12/IPython/frontend/qt/console/mainwindow.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/mainwindow.py
      --- ipython-0.12/IPython/frontend/qt/console/mainwindow.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/mainwindow.py	2012-04-22 05:10:27.000000000 +0000
      @@ -188,6 +188,8 @@
                           justthis.setShortcut('N')
                           closeall = QtGui.QPushButton("&Yes, close all", self)
                           closeall.setShortcut('Y')
      +                    # allow ctrl-d ctrl-d exit, like in terminal
      +                    closeall.setShortcut('Ctrl+D')
                           box = QtGui.QMessageBox(QtGui.QMessageBox.Question,
                                                   title, msg)
                           box.setInformativeText(info)
      diff -Nru ipython-0.12/IPython/frontend/qt/console/pygments_highlighter.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/pygments_highlighter.py
      --- ipython-0.12/IPython/frontend/qt/console/pygments_highlighter.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/pygments_highlighter.py	2012-04-22 05:10:27.000000000 +0000
      @@ -174,7 +174,7 @@
           def _get_format_from_document(self, token, document):
               """ Returns a QTextCharFormat for token by
               """
      -        code, html = self._formatter._format_lines([(token, 'dummy')]).next()
      +        code, html = self._formatter._format_lines([(token, u'dummy')]).next()
               self._document.setHtml(html)
               return QtGui.QTextCursor(self._document).charFormat()
       
      diff -Nru ipython-0.12/IPython/frontend/qt/console/qtconsoleapp.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/qtconsoleapp.py
      --- ipython-0.12/IPython/frontend/qt/console/qtconsoleapp.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/qtconsoleapp.py	2012-04-22 05:10:27.000000000 +0000
      @@ -178,7 +178,7 @@
               """ Create and return new frontend attached to new kernel, launched on localhost.
               """
               ip = self.ip if self.ip in LOCAL_IPS else LOCALHOST
      -        kernel_manager = QtKernelManager(
      +        kernel_manager = self.kernel_manager_class(
                                       ip=ip,
                                       connection_file=self._new_connection_file(),
                                       config=self.config,
      @@ -190,6 +190,7 @@
               kernel_manager.start_channels()
               widget = self.widget_factory(config=self.config,
                                          local_kernel=True)
      +        self.init_colors(widget)
               widget.kernel_manager = kernel_manager
               widget._existing = False
               widget._may_close = True
      @@ -204,7 +205,7 @@
               current_widget : IPythonWidget
                   The IPythonWidget whose kernel this frontend is to share
               """
      -        kernel_manager = QtKernelManager(
      +        kernel_manager = self.kernel_manager_class(
                                       connection_file=current_widget.kernel_manager.connection_file,
                                       config = self.config,
               )
      @@ -212,6 +213,7 @@
               kernel_manager.start_channels()
               widget = self.widget_factory(config=self.config,
                                       local_kernel=False)
      +        self.init_colors(widget)
               widget._existing = True
               widget._may_close = False
               widget._confirm_exit = False
      @@ -230,6 +232,7 @@
               local_kernel = (not self.existing) or self.ip in LOCAL_IPS
               self.widget = self.widget_factory(config=self.config,
                                               local_kernel=local_kernel)
      +        self.init_colors(self.widget)
               self.widget._existing = self.existing
               self.widget._may_close = not self.existing
               self.widget._confirm_exit = self.confirm_exit
      @@ -246,7 +249,7 @@
       
               self.window.setWindowTitle('Python' if self.pure else 'IPython')
       
      -    def init_colors(self):
      +    def init_colors(self, widget):
               """Configure the coloring of the widget"""
               # Note: This will be dramatically simplified when colors
               # are removed from the backend.
      @@ -264,6 +267,10 @@
                   style = self.config.IPythonWidget.syntax_style
               except AttributeError:
                   style = None
      +        try:
      +            sheet = self.config.IPythonWidget.style_sheet
      +        except AttributeError:
      +            sheet = None
       
               # find the value for colors:
               if colors:
      @@ -284,30 +291,27 @@
               else:
                   colors=None
       
      -        # Configure the style.
      -        widget = self.widget
      +        # Configure the style
               if style:
                   widget.style_sheet = styles.sheet_from_template(style, colors)
                   widget.syntax_style = style
                   widget._syntax_style_changed()
                   widget._style_sheet_changed()
               elif colors:
      -            # use a default style
      +            # use a default dark/light/bw style
                   widget.set_default_style(colors=colors)
      -        else:
      -            # this is redundant for now, but allows the widget's
      -            # defaults to change
      -            widget.set_default_style()
       
               if self.stylesheet:
      -            # we got an expicit stylesheet
      +            # we got an explicit stylesheet
                   if os.path.isfile(self.stylesheet):
                       with open(self.stylesheet) as f:
                           sheet = f.read()
      -                widget.style_sheet = sheet
      -                widget._style_sheet_changed()
                   else:
      -                raise IOError("Stylesheet %r not found."%self.stylesheet)
      +                raise IOError("Stylesheet %r not found." % self.stylesheet)
      +        if sheet:
      +            widget.style_sheet = sheet
      +            widget._style_sheet_changed()
      +            
       
           def init_signal(self):
               """allow clean shutdown on sigint"""
      @@ -327,7 +331,6 @@
               super(IPythonQtConsoleApp, self).initialize(argv)
               IPythonConsoleApp.initialize(self,argv)
               self.init_qt_elements()
      -        self.init_colors()
               self.init_signal()
       
           def start(self):
      diff -Nru ipython-0.12/IPython/frontend/qt/console/styles.py ipython-0.12.1+dfsg/IPython/frontend/qt/console/styles.py
      --- ipython-0.12/IPython/frontend/qt/console/styles.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/frontend/qt/console/styles.py	2012-04-22 05:10:27.000000000 +0000
      @@ -64,8 +64,8 @@
               return False
           try:
               r = int(color[:2],16)
      -        g = int(color[:2],16)
      -        b = int(color[:2],16)
      +        g = int(color[2:4],16)
      +        b = int(color[4:],16)
           except ValueError:
               return False
           else:
      diff -Nru ipython-0.12/IPython/.git_commit_info.ini ipython-0.12.1+dfsg/IPython/.git_commit_info.ini
      --- ipython-0.12/IPython/.git_commit_info.ini	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/.git_commit_info.ini	1970-01-01 00:00:00.000000000 +0000
      @@ -1,9 +0,0 @@
      -# This is an ini file that may contain information about the code state
      -[commit hash]
      -
      -# The line below may contain a valid hash if it has been substituted during
      -# 'git archive'
      -archive_subst_hash=698e9ab
      -
      -# This line may be modified by the install process
      -install_hash=
      diff -Nru ipython-0.12/IPython/lib/pretty.py ipython-0.12.1+dfsg/IPython/lib/pretty.py
      --- ipython-0.12/IPython/lib/pretty.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/lib/pretty.py	2012-04-22 05:10:27.000000000 +0000
      @@ -155,8 +155,7 @@
               """like begin_group / end_group but for the with statement."""
               self.begin_group(indent, open)
               try:
      -            with self.indent(indent):
      -                yield
      +            yield
               finally:
                   self.end_group(indent, close)
       
      @@ -347,7 +346,11 @@
                               return printer(obj, self, cycle)
                   # Finally look for special method names.
                   if hasattr(obj_class, '_repr_pretty_'):
      -                return obj_class._repr_pretty_(obj, self, cycle)
      +                # Some objects automatically create any requested
      +                # attribute. Try to ignore most of them by checking for
      +                # callability.
      +                if callable(obj_class._repr_pretty_):
      +                    return obj_class._repr_pretty_(obj, self, cycle)
                   return _default_pprint(obj, self, cycle)
               finally:
                   self.end_group()
      @@ -616,7 +619,7 @@
       
       def _exception_pprint(obj, p, cycle):
           """Base pprint for all exceptions."""
      -    if obj.__class__.__module__ == 'exceptions':
      +    if obj.__class__.__module__ in ('exceptions', 'builtins'):
               name = obj.__class__.__name__
           else:
               name = '%s.%s' % (
      @@ -624,7 +627,7 @@
                   obj.__class__.__name__
               )
           step = len(name) + 1
      -    p.begin_group(step, '(')
      +    p.begin_group(step, name + '(')
           for idx, arg in enumerate(getattr(obj, 'args', ())):
               if idx:
                   p.text(',')
      diff -Nru ipython-0.12/IPython/lib/tests/test_irunner.py ipython-0.12.1+dfsg/IPython/lib/tests/test_irunner.py
      --- ipython-0.12/IPython/lib/tests/test_irunner.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/lib/tests/test_irunner.py	2012-04-22 05:10:27.000000000 +0000
      @@ -13,7 +13,6 @@
       
       # IPython imports
       from IPython.lib import irunner
      -from IPython.testing.decorators import known_failure_py3
       from IPython.utils.py3compat import doctest_refactor_print
       
       # Testing code begins
      @@ -58,8 +57,6 @@
               self.assert_(mismatch==0,'Number of mismatched lines: %s' %
                            mismatch)
       
      -    # The SyntaxError appears differently in Python 3, for some reason.
      -    @known_failure_py3
           def testIPython(self):
               """Test the IPython runner."""
               source = doctest_refactor_print("""
      diff -Nru ipython-0.12/IPython/lib/tests/test_irunner_pylab_magic.py ipython-0.12.1+dfsg/IPython/lib/tests/test_irunner_pylab_magic.py
      --- ipython-0.12/IPython/lib/tests/test_irunner_pylab_magic.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/lib/tests/test_irunner_pylab_magic.py	2012-04-22 05:10:27.000000000 +0000
      @@ -15,6 +15,14 @@
       from IPython.lib import irunner
       from IPython.testing import decorators
       
      +def pylab_not_importable():
      +    """Test if importing pylab fails with RuntimeError (true when having no display)"""
      +    try:
      +        import pylab
      +        return False
      +    except RuntimeError:
      +        return True
      +
       # Testing code begins
       class RunnerTestCase(unittest.TestCase):
       
      @@ -58,6 +66,7 @@
                            mismatch)
       
           @decorators.skipif_not_matplotlib
      +    @decorators.skipif(pylab_not_importable, "Likely a run without X.")
           def test_pylab_import_all_enabled(self):
               "Verify that plot is available when pylab_import_all = True"
               source = """
      @@ -83,6 +92,7 @@
               self._test_runner(runner,source,output)
       
           @decorators.skipif_not_matplotlib
      +    @decorators.skipif(pylab_not_importable, "Likely a run without X.")
           def test_pylab_import_all_disabled(self):
               "Verify that plot is not available when pylab_import_all = False"
               source = """
      diff -Nru ipython-0.12/IPython/lib/tests/test_pretty.py ipython-0.12.1+dfsg/IPython/lib/tests/test_pretty.py
      --- ipython-0.12/IPython/lib/tests/test_pretty.py	1970-01-01 00:00:00.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/lib/tests/test_pretty.py	2012-04-22 05:10:27.000000000 +0000
      @@ -0,0 +1,49 @@
      +"""Tests for IPython.lib.pretty.
      +"""
      +#-----------------------------------------------------------------------------
      +# Copyright (c) 2011, the IPython Development Team.
      +#
      +# Distributed under the terms of the Modified BSD License.
      +#
      +# The full license is in the file COPYING.txt, distributed with this software.
      +#-----------------------------------------------------------------------------
      +
      +#-----------------------------------------------------------------------------
      +# Imports
      +#-----------------------------------------------------------------------------
      +from __future__ import print_function
      +
      +# Third-party imports
      +import nose.tools as nt
      +
      +# Our own imports
      +from IPython.lib import pretty
      +
      +#-----------------------------------------------------------------------------
      +# Classes and functions
      +#-----------------------------------------------------------------------------
      +
      +class MyList(object):
      +    def __init__(self, content):
      +        self.content = content
      +    def _repr_pretty_(self, p, cycle):
      +        if cycle:
      +            p.text("MyList(...)")
      +        else:
      +            with p.group(3, "MyList(", ")"):
      +                for (i, child) in enumerate(self.content):
      +                    if i:
      +                        p.text(",")
      +                        p.breakable()
      +                    else:
      +                        p.breakable("")
      +                    p.pretty(child)
      +
      +
      +def test_indentation():
      +    """Test correct indentation in groups"""
      +    count = 40
      +    gotoutput = pretty.pretty(MyList(range(count)))
      +    expectedoutput = "MyList(\n" + ",\n".join("   %d" % i for i in range(count)) + ")"
      +
      +    nt.assert_equals(gotoutput, expectedoutput)
      diff -Nru ipython-0.12/IPython/parallel/client/client.py ipython-0.12.1+dfsg/IPython/parallel/client/client.py
      --- ipython-0.12/IPython/parallel/client/client.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/client/client.py	2012-04-22 05:10:27.000000000 +0000
      @@ -40,6 +40,7 @@
       from IPython.external.decorator import decorator
       from IPython.external.ssh import tunnel
       
      +from IPython.parallel import Reference
       from IPython.parallel import error
       from IPython.parallel import util
       
      @@ -982,7 +983,7 @@
               subheader = subheader if subheader is not None else {}
       
               # validate arguments
      -        if not callable(f):
      +        if not callable(f) and not isinstance(f, Reference):
                   raise TypeError("f must be callable, not %s"%type(f))
               if not isinstance(args, (tuple, list)):
                   raise TypeError("args must be tuple or list, not %s"%type(args))
      @@ -1303,7 +1304,11 @@
               verbose : bool
                       Whether to return lengths only, or lists of ids for each element
               """
      -        engine_ids = self._build_targets(targets)[1]
      +        if targets == 'all':
      +            # allow 'all' to be evaluated on the engine
      +            engine_ids = None
      +        else:
      +            engine_ids = self._build_targets(targets)[1]
               content = dict(targets=engine_ids, verbose=verbose)
               self.session.send(self._query_socket, "queue_request", content=content)
               idents,msg = self.session.recv(self._query_socket, 0)
      diff -Nru ipython-0.12/IPython/parallel/client/remotefunction.py ipython-0.12.1+dfsg/IPython/parallel/client/remotefunction.py
      --- ipython-0.12/IPython/parallel/client/remotefunction.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/client/remotefunction.py	2012-04-22 05:10:27.000000000 +0000
      @@ -27,7 +27,7 @@
       from .asyncresult import AsyncMapResult
       
       #-----------------------------------------------------------------------------
      -# Decorators
      +# Functions and Decorators
       #-----------------------------------------------------------------------------
       
       @skip_doctest
      @@ -60,6 +60,25 @@
               return ParallelFunction(view, f, dist=dist, block=block, ordered=ordered, **flags)
           return parallel_function
       
      +def getname(f):
      +    """Get the name of an object.
      +    
      +    For use in case of callables that are not functions, and
      +    thus may not have __name__ defined.
      +    
      +    Order: f.__name__ >  f.name > str(f)
      +    """
      +    try:
      +        return f.__name__
      +    except:
      +        pass
      +    try:
      +        return f.name
      +    except:
      +        pass
      +    
      +    return str(f)
      +
       #--------------------------------------------------------------------------
       # Classes
       #--------------------------------------------------------------------------
      @@ -194,7 +213,7 @@
                   msg_ids.append(ar.msg_ids[0])
       
               r = AsyncMapResult(self.view.client, msg_ids, self.mapObject, 
      -                            fname=self.func.__name__,
      +                            fname=getname(self.func),
                                   ordered=self.ordered
                               )
       
      diff -Nru ipython-0.12/IPython/parallel/client/view.py ipython-0.12.1+dfsg/IPython/parallel/client/view.py
      --- ipython-0.12/IPython/parallel/client/view.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/client/view.py	2012-04-22 05:10:27.000000000 +0000
      @@ -34,7 +34,7 @@
       
       from . import map as Map
       from .asyncresult import AsyncResult, AsyncMapResult
      -from .remotefunction import ParallelFunction, parallel, remote
      +from .remotefunction import ParallelFunction, parallel, remote, getname
       
       #-----------------------------------------------------------------------------
       # Decorators
      @@ -405,7 +405,11 @@
               """Context Manager for performing simultaneous local and remote imports.
       
               'import x as y' will *not* work.  The 'as y' part will simply be ignored.
      -
      +        
      +        If `local=True`, then the package will also be imported locally.
      +        
      +        Note that remote-only (`local=False`) imports have not been implemented.
      +        
               >>> with view.sync_imports():
               ...    from numpy import recarray
               importing recarray from numpy on engine(s)
      @@ -468,7 +472,9 @@
                   # enter the block
                   yield
               except ImportError:
      -            if not local:
      +            if local:
      +                raise
      +            else:
                       # ignore import errors if not doing local imports
                       pass
               finally:
      @@ -529,7 +535,7 @@
                       trackers.append(msg['tracker'])
                   msg_ids.append(msg['header']['msg_id'])
               tracker = None if track is False else zmq.MessageTracker(*trackers)
      -        ar = AsyncResult(self.client, msg_ids, fname=f.__name__, targets=targets, tracker=tracker)
      +        ar = AsyncResult(self.client, msg_ids, fname=getname(f), targets=targets, tracker=tracker)
               if block:
                   try:
                       return ar.get()
      @@ -984,7 +990,7 @@
                                       subheader=subheader)
               tracker = None if track is False else msg['tracker']
       
      -        ar = AsyncResult(self.client, msg['header']['msg_id'], fname=f.__name__, targets=None, tracker=tracker)
      +        ar = AsyncResult(self.client, msg['header']['msg_id'], fname=getname(f), targets=None, tracker=tracker)
       
               if block:
                   try:
      diff -Nru ipython-0.12/IPython/parallel/controller/heartmonitor.py ipython-0.12.1+dfsg/IPython/parallel/controller/heartmonitor.py
      --- ipython-0.12/IPython/parallel/controller/heartmonitor.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/controller/heartmonitor.py	2012-04-22 05:10:27.000000000 +0000
      @@ -23,7 +23,7 @@
       from zmq.eventloop import ioloop, zmqstream
       
       from IPython.config.configurable import LoggingConfigurable
      -from IPython.utils.traitlets import Set, Instance, CFloat
      +from IPython.utils.traitlets import Set, Instance, CFloat, Integer
       
       from IPython.parallel.util import asbytes
       
      @@ -40,6 +40,10 @@
           id=None
           def __init__(self, in_addr, out_addr, in_type=zmq.SUB, out_type=zmq.DEALER, heart_id=None):
               self.device = ThreadDevice(zmq.FORWARDER, in_type, out_type)
      +        # do not allow the device to share global Context.instance,
      +        # which is the default behavior in pyzmq > 2.1.10
      +        self.device.context_factory = zmq.Context
      +        
               self.device.daemon=True
               self.device.connect_in(in_addr)
               self.device.connect_out(out_addr)
      @@ -60,7 +64,7 @@
           pongstream: an XREP stream
           period: the period of the heartbeat in milliseconds"""
       
      -    period=CFloat(1000, config=True,
      +    period = Integer(3000, config=True,
               help='The frequency at which the Hub pings the engines for heartbeats '
               '(in ms)',
           )
      @@ -120,6 +124,8 @@
               # print self.on_probation, self.hearts
               # self.log.debug("heartbeat::beat %.3f, %i beating hearts", self.lifetime, len(self.hearts))
               self.pingstream.send(asbytes(str(self.lifetime)))
      +        # flush stream to force immediate socket send
      +        self.pingstream.flush()
       
           def handle_new_heart(self, heart):
               if self._new_handlers:
      diff -Nru ipython-0.12/IPython/parallel/controller/hub.py ipython-0.12.1+dfsg/IPython/parallel/controller/hub.py
      --- ipython-0.12/IPython/parallel/controller/hub.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/controller/hub.py	2012-04-22 05:10:27.000000000 +0000
      @@ -430,7 +430,7 @@
               """turn any valid targets argument into a list of integer ids"""
               if targets is None:
                   # default to all
      -            targets = self.ids
      +            return self.ids
       
               if isinstance(targets, (int,str,unicode)):
                   # only one target specified
      @@ -457,7 +457,7 @@
           def dispatch_monitor_traffic(self, msg):
               """all ME and Task queue messages come through here, as well as
               IOPub traffic."""
      -        self.log.debug("monitor traffic: %r", msg[:2])
      +        self.log.debug("monitor traffic: %r", msg[0])
               switch = msg[0]
               try:
                   idents, msg = self.session.feed_identities(msg[1:])
      diff -Nru ipython-0.12/IPython/parallel/controller/scheduler.py ipython-0.12.1+dfsg/IPython/parallel/controller/scheduler.py
      --- ipython-0.12/IPython/parallel/controller/scheduler.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/controller/scheduler.py	2012-04-22 05:10:27.000000000 +0000
      @@ -181,6 +181,8 @@
       
           def start(self):
               self.engine_stream.on_recv(self.dispatch_result, copy=False)
      +        self.client_stream.on_recv(self.dispatch_submission, copy=False)
      +
               self._notification_handlers = dict(
                   registration_notification = self._register_engine,
                   unregistration_notification = self._unregister_engine
      @@ -237,8 +239,7 @@
               self.completed[uid] = set()
               self.failed[uid] = set()
               self.pending[uid] = {}
      -        if len(self.targets) == 1:
      -            self.resume_receiving()
      +
               # rescan the graph:
               self.update_graph(None)
       
      @@ -246,7 +247,7 @@
               """Existing engine with ident `uid` became unavailable."""
               if len(self.targets) == 1:
                   # this was our only engine
      -            self.stop_receiving()
      +            pass
       
               # handle any potentially finished tasks:
               self.engine_stream.flush()
      @@ -288,7 +289,13 @@
                       raise error.EngineError("Engine %r died while running task %r"%(engine, msg_id))
                   except:
                       content = error.wrap_exception()
      -            msg = self.session.msg('apply_reply', content, parent=parent, subheader={'status':'error'})
      +            # build fake header
      +            header = dict(
      +                status='error',
      +                engine=engine,
      +                date=datetime.now(),
      +            )
      +            msg = self.session.msg('apply_reply', content, parent=parent, subheader=header)
                   raw_reply = map(zmq.Message, self.session.serialize(msg, ident=idents))
                   # and dispatch it
                   self.dispatch_result(raw_reply)
      @@ -429,6 +436,11 @@
       
           def maybe_run(self, msg_id, raw_msg, targets, after, follow, timeout):
               """check location dependencies, and run if they are met."""
      +        self.log.debug("Attempting to assign task %s", msg_id)
      +        if not self.targets:
      +            # no engines, definitely can't run
      +            return False
      +        
               blacklist = self.blacklist.setdefault(msg_id, set())
               if follow or targets or blacklist or self.hwm:
                   # we need a can_run filter
      diff -Nru ipython-0.12/IPython/parallel/controller/sqlitedb.py ipython-0.12.1+dfsg/IPython/parallel/controller/sqlitedb.py
      --- ipython-0.12/IPython/parallel/controller/sqlitedb.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/controller/sqlitedb.py	2012-04-22 05:10:27.000000000 +0000
      @@ -293,7 +293,7 @@
                               op, join = op
       
                           if value is None and op in null_operators:
      -                            expr = "%s %s"%null_operators[op]
      +                        expr = "%s %s" % (name, null_operators[op])
                           else:
                               expr = "%s %s ?"%(name, op)
                               if isinstance(value, (tuple,list)):
      @@ -308,7 +308,7 @@
                   else:
                       # it's an equality check
                       if sub_check is None:
      -                    expressions.append("%s IS NULL")
      +                    expressions.append("%s IS NULL" % name)
                       else:
                           expressions.append("%s = ?"%name)
                           args.append(sub_check)
      diff -Nru ipython-0.12/IPython/parallel/engine/streamkernel.py ipython-0.12.1+dfsg/IPython/parallel/engine/streamkernel.py
      --- ipython-0.12/IPython/parallel/engine/streamkernel.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/engine/streamkernel.py	2012-04-22 05:10:27.000000000 +0000
      @@ -402,7 +402,6 @@
               #### stream mode:
               if self.control_stream:
                   self.control_stream.on_recv(self.dispatch_control, copy=False)
      -            self.control_stream.on_err(printer)
       
               def make_dispatcher(stream):
                   def dispatcher(msg):
      @@ -411,29 +410,5 @@
       
               for s in self.shell_streams:
                   s.on_recv(make_dispatcher(s), copy=False)
      -            s.on_err(printer)
       
      -        if self.iopub_stream:
      -            self.iopub_stream.on_err(printer)
      -
      -        #### while True mode:
      -        # while True:
      -        #     idle = True
      -        #     try:
      -        #         msg = self.shell_stream.socket.recv_multipart(
      -        #                     zmq.NOBLOCK, copy=False)
      -        #     except zmq.ZMQError, e:
      -        #         if e.errno != zmq.EAGAIN:
      -        #             raise e
      -        #     else:
      -        #         idle=False
      -        #         self.dispatch_queue(self.shell_stream, msg)
      -        #
      -        #     if not self.task_stream.empty():
      -        #         idle=False
      -        #         msg = self.task_stream.recv_multipart()
      -        #         self.dispatch_queue(self.task_stream, msg)
      -        #     if idle:
      -        #         # don't busywait
      -        #         time.sleep(1e-3)
       
      diff -Nru ipython-0.12/IPython/parallel/tests/test_db.py ipython-0.12.1+dfsg/IPython/parallel/tests/test_db.py
      --- ipython-0.12/IPython/parallel/tests/test_db.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/tests/test_db.py	2012-04-22 05:10:27.000000000 +0000
      @@ -18,6 +18,7 @@
       
       from __future__ import division
       
      +import os
       import tempfile
       import time
       
      @@ -37,6 +38,12 @@
       # TestCases
       #-------------------------------------------------------------------------------
       
      +
      +def setup():
      +    global temp_db
      +    temp_db = tempfile.NamedTemporaryFile(suffix='.db').name
      +
      +
       class TestDictBackend(TestCase):
           def setUp(self):
               self.session = Session()
      @@ -170,13 +177,34 @@
               self.db.drop_matching_records(query)
               recs = self.db.find_records(query)
               self.assertEquals(len(recs), 0)
      +    
      +    def test_null(self):
      +        """test None comparison queries"""
      +        msg_ids = self.load_records(10)
      +
      +        query = {'msg_id' : None}
      +        recs = self.db.find_records(query)
      +        self.assertEquals(len(recs), 0)
      +
      +        query = {'msg_id' : {'$ne' : None}}
      +        recs = self.db.find_records(query)
      +        self.assertTrue(len(recs) >= 10)
       
       
       class TestSQLiteBackend(TestDictBackend):
       
           @dec.skip_without('sqlite3')
           def create_db(self):
      -        return SQLiteDB(location=tempfile.gettempdir())
      +        location, fname = os.path.split(temp_db)
      +        return SQLiteDB(location=location, fname=fname)
           
           def tearDown(self):
               self.db._db.close()
      +
      +
      +def teardown():
      +    """cleanup task db file after all tests have run"""
      +    try:
      +        os.remove(temp_db)
      +    except:
      +        pass
      diff -Nru ipython-0.12/IPython/parallel/tests/test_view.py ipython-0.12.1+dfsg/IPython/parallel/tests/test_view.py
      --- ipython-0.12/IPython/parallel/tests/test_view.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/tests/test_view.py	2012-04-22 05:10:27.000000000 +0000
      @@ -234,6 +234,19 @@
               b = view.gather('a', block=True)
               assert_array_equal(b, a)
           
      +    @skip_without('numpy')
      +    def test_apply_numpy(self):
      +        """view.apply(f, ndarray)"""
      +        import numpy
      +        from numpy.testing.utils import assert_array_equal, assert_array_almost_equal
      +        
      +        A = numpy.random.random((100,100))
      +        view = self.client[-1]
      +        for dt in [ 'int32', 'uint8', 'float32', 'float64' ]:
      +            B = A.astype(dt)
      +            C = view.apply_sync(lambda x:x, B)
      +            assert_array_equal(B,C)
      +    
           def test_map(self):
               view = self.client[:]
               def f(x):
      @@ -469,4 +482,25 @@
                       else:
                           raise e
           
      +    def test_map_reference(self):
      +        """view.map(<Reference>, *seqs) should work"""
      +        v = self.client[:]
      +        v.scatter('n', self.client.ids, flatten=True)
      +        v.execute("f = lambda x,y: x*y")
      +        rf = pmod.Reference('f')
      +        nlist = list(range(10))
      +        mlist = nlist[::-1]
      +        expected = [ m*n for m,n in zip(mlist, nlist) ]
      +        result = v.map_sync(rf, mlist, nlist)
      +        self.assertEquals(result, expected)
      +
      +    def test_apply_reference(self):
      +        """view.apply(<Reference>, *args) should work"""
      +        v = self.client[:]
      +        v.scatter('n', self.client.ids, flatten=True)
      +        v.execute("f = lambda x: n*x")
      +        rf = pmod.Reference('f')
      +        result = v.apply_sync(rf, 5)
      +        expected = [ 5*id for id in self.client.ids ]
      +        self.assertEquals(result, expected)
       
      diff -Nru ipython-0.12/IPython/parallel/util.py ipython-0.12.1+dfsg/IPython/parallel/util.py
      --- ipython-0.12/IPython/parallel/util.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/parallel/util.py	2012-04-22 05:10:27.000000000 +0000
      @@ -41,10 +41,14 @@
       
       # IPython imports
       from IPython.config.application import Application
      +from IPython.utils import py3compat
       from IPython.utils.pickleutil import can, uncan, canSequence, uncanSequence
       from IPython.utils.newserialized import serialize, unserialize
       from IPython.zmq.log import EnginePUBHandler
       
      +if py3compat.PY3:
      +    buffer = memoryview
      +
       #-----------------------------------------------------------------------------
       # Classes
       #-----------------------------------------------------------------------------
      @@ -466,6 +470,10 @@
               return
           handler = logging.StreamHandler()
           handler.setLevel(loglevel)
      +    formatter = logging.Formatter("%(asctime)s.%(msecs).03d [%(name)s] %(message)s",
      +                datefmt="%Y-%m-%d %H:%M:%S")
      +    handler.setFormatter(formatter)
      +
           logger.addHandler(handler)
           logger.setLevel(loglevel)
           return logger
      diff -Nru ipython-0.12/IPython/utils/path.py ipython-0.12.1+dfsg/IPython/utils/path.py
      --- ipython-0.12/IPython/utils/path.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/path.py	2012-04-22 05:10:27.000000000 +0000
      @@ -106,7 +106,7 @@
           if os.path.isfile(name):
               return name
           else:
      -        raise IOError,'File `%s` not found.' % name
      +        raise IOError,'File `%r` not found.' % name
       
       
       def filefind(filename, path_dirs=None):
      @@ -201,6 +201,9 @@
               return py3compat.cast_unicode(root, fs_encoding)
           
           homedir = os.path.expanduser('~')
      +    # Next line will make things work even when /home/ is a symlink to
      +    # /usr/home as it is on FreeBSD, for example
      +    homedir = os.path.realpath(homedir)
           
           if not _writable_dir(homedir) and os.name == 'nt':
               # expanduser failed, use the registry to get the 'My Documents' folder.
      diff -Nru ipython-0.12/IPython/utils/_process_common.py ipython-0.12.1+dfsg/IPython/utils/_process_common.py
      --- ipython-0.12/IPython/utils/_process_common.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/_process_common.py	2012-04-22 05:10:27.000000000 +0000
      @@ -175,6 +175,7 @@
           # and it shouldn't raise an exception.
           # It may be a bad idea to parse things that are not command-line args
           # through this function, but we do, so let's be safe about it.
      +    lex.commenters='' #fix for GH-1269
           tokens = []
           while True:
               try:
      diff -Nru ipython-0.12/IPython/utils/pyfile.py ipython-0.12.1+dfsg/IPython/utils/pyfile.py
      --- ipython-0.12/IPython/utils/pyfile.py	1970-01-01 00:00:00.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/pyfile.py	2012-04-22 05:10:27.000000000 +0000
      @@ -0,0 +1,23 @@
      +"""Utilities for working with Python source files.
      +
      +Exposes various functions from recent Python standard libraries, along with
      +equivalents for older Python versions.
      +"""
      +import os.path
      +
      +try:    # Python 3.2
      +    from imp import source_from_cache, cache_from_source
      +except ImportError:
      +    # Python <= 3.1: .pyc files go next to .py
      +    def source_from_cache(path):
      +        basename, ext = os.path.splitext(path)
      +        if ext not in ('.pyc', '.pyo'):
      +            raise ValueError('Not a cached Python file extension', ext)
      +        # Should we look for .pyw files?
      +        return basename + '.py'
      +    
      +    def cache_from_source(path, debug_override=None):
      +        if debug_override is None:
      +            debug_override = __debug__
      +        basename, ext = os.path.splitext(path)
      +        return basename + '.pyc' if debug_override else '.pyo'
      diff -Nru ipython-0.12/IPython/utils/_sysinfo.py ipython-0.12.1+dfsg/IPython/utils/_sysinfo.py
      --- ipython-0.12/IPython/utils/_sysinfo.py	1970-01-01 00:00:00.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/_sysinfo.py	2012-04-22 05:10:27.000000000 +0000
      @@ -0,0 +1,2 @@
      +# GENERATED BY setup.py
      +commit = ""
      diff -Nru ipython-0.12/IPython/utils/sysinfo.py ipython-0.12.1+dfsg/IPython/utils/sysinfo.py
      --- ipython-0.12/IPython/utils/sysinfo.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/sysinfo.py	2012-04-22 05:10:27.000000000 +0000
      @@ -23,12 +23,7 @@
       from ConfigParser import ConfigParser
       
       from IPython.core import release
      -from IPython.utils import py3compat
      -
      -#-----------------------------------------------------------------------------
      -# Globals
      -#-----------------------------------------------------------------------------
      -COMMIT_INFO_FNAME = '.git_commit_info.ini'
      +from IPython.utils import py3compat, _sysinfo
       
       #-----------------------------------------------------------------------------
       # Code
      @@ -37,25 +32,18 @@
       def pkg_commit_hash(pkg_path):
           """Get short form of commit hash given directory `pkg_path`
       
      -    There should be a file called 'COMMIT_INFO.txt' in `pkg_path`.  This is a
      -    file in INI file format, with at least one section: ``commit hash``, and two
      -    variables ``archive_subst_hash`` and ``install_hash``.  The first has a
      -    substitution pattern in it which may have been filled by the execution of
      -    ``git archive`` if this is an archive generated that way.  The second is
      -    filled in by the installation, if the installation is from a git archive.
      -
           We get the commit hash from (in order of preference):
       
      -    * A substituted value in ``archive_subst_hash``
      -    * A written commit hash value in ``install_hash`
      +    * IPython.utils._sysinfo.commit
           * git output, if we are in a git repository
       
      -    If all these fail, we return a not-found placeholder tuple
      +    If these fail, we return a not-found placeholder tuple
       
           Parameters
           ----------
           pkg_path : str
              directory containing package
      +       only used for getting commit from active repo
       
           Returns
           -------
      @@ -65,21 +53,9 @@
              short form of hash
           """
           # Try and get commit from written commit text file
      -    pth = os.path.join(pkg_path, COMMIT_INFO_FNAME)
      -    if not os.path.isfile(pth):
      -        raise IOError('Missing commit info file %s' % pth)
      -    cfg_parser = ConfigParser()
      -    cfg_parser.read(pth)
      -    try:
      -        archive_subst = cfg_parser.get('commit hash', 'archive_subst_hash')
      -    except Exception:
      -        pass
      -    else:
      -        if not archive_subst.startswith('$Format'): # it has been substituted
      -            return 'archive substitution', archive_subst
      -    install_subst = cfg_parser.get('commit hash', 'install_hash')
      -    if install_subst != '':
      -        return 'installation', install_subst
      +    if _sysinfo.commit:
      +        return "installation", _sysinfo.commit
      +
           # maybe we are in a repository
           proc = subprocess.Popen('git rev-parse --short HEAD',
                                   stdout=subprocess.PIPE,
      diff -Nru ipython-0.12/IPython/utils/tests/test_path.py ipython-0.12.1+dfsg/IPython/utils/tests/test_path.py
      --- ipython-0.12/IPython/utils/tests/test_path.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/utils/tests/test_path.py	2012-04-22 05:10:27.000000000 +0000
      @@ -150,7 +150,8 @@
           """get_home_dir() uses $HOME if set"""
           env["HOME"] = HOME_TEST_DIR
           home_dir = path.get_home_dir(True)
      -    nt.assert_equal(home_dir, env["HOME"])
      +    # get_home_dir expands symlinks
      +    nt.assert_equal(home_dir, os.path.realpath(env["HOME"]))
       
       
       @with_environment
      @@ -405,3 +406,15 @@
                   else:
                       nt.assert_raises(IOError, path.get_py_filename, '"foo with spaces.py"', force_win32=False)
                       nt.assert_raises(IOError, path.get_py_filename, "'foo with spaces.py'", force_win32=False)
      +                
      +def test_unicode_in_filename():
      +    """When a file doesn't exist, the exception raised should be safe to call
      +    str() on - i.e. in Python 2 it must only have ASCII characters.
      +    
      +    https://github.com/ipython/ipython/issues/875
      +    """
      +    try:
      +        # these calls should not throw unicode encode exceptions
      +        path.get_py_filename(u'fooéè.py',  force_win32=False)
      +    except IOError as ex:
      +        str(ex)
      diff -Nru ipython-0.12/IPython/zmq/kernelapp.py ipython-0.12.1+dfsg/IPython/zmq/kernelapp.py
      --- ipython-0.12/IPython/zmq/kernelapp.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/zmq/kernelapp.py	2012-04-22 05:10:27.000000000 +0000
      @@ -216,8 +216,11 @@
               self.stdin_socket = context.socket(zmq.ROUTER)
               self.stdin_port = self._bind_socket(self.stdin_socket, self.stdin_port)
               self.log.debug("stdin ROUTER Channel on port: %i"%self.stdin_port)
      -
      -        self.heartbeat = Heartbeat(context, (self.ip, self.hb_port))
      +        
      +        # heartbeat doesn't share context, because it mustn't be blocked
      +        # by the GIL, which is accessed by libzmq when freeing zero-copy messages
      +        hb_ctx = zmq.Context()
      +        self.heartbeat = Heartbeat(hb_ctx, (self.ip, self.hb_port))
               self.hb_port = self.heartbeat.port
               self.log.debug("Heartbeat REP Channel on port: %i"%self.hb_port)
       
      diff -Nru ipython-0.12/IPython/zmq/session.py ipython-0.12.1+dfsg/IPython/zmq/session.py
      --- ipython-0.12/IPython/zmq/session.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/zmq/session.py	2012-04-22 05:10:27.000000000 +0000
      @@ -73,9 +73,22 @@
       # globals and defaults
       #-----------------------------------------------------------------------------
       
      -key = 'on_unknown' if jsonapi.jsonmod.__name__ == 'jsonlib' else 'default'
      -json_packer = lambda obj: jsonapi.dumps(obj, **{key:date_default})
      -json_unpacker = lambda s: extract_dates(jsonapi.loads(s))
      +
      +# jsonlib behaves a bit differently, so handle that where it affects us
      +if jsonapi.jsonmod.__name__ == 'jsonlib':
      +    # kwarg for serializing unknown types (datetime) is different
      +    dumps_kwargs = dict(on_unknown=date_default)
      +    # By default, jsonlib unpacks floats as Decimal instead of float,
      +    # which can foul things up
      +    loads_kwargs = dict(use_float=True)
      +else:
      +    # ISO8601-ify datetime objects
      +    dumps_kwargs = dict(default=date_default)
      +    # nothing to specify for loads
      +    loads_kwargs = dict()
      +
      +json_packer = lambda obj: jsonapi.dumps(obj, **dumps_kwargs)
      +json_unpacker = lambda s: extract_dates(jsonapi.loads(s, **loads_kwargs))
       
       pickle_packer = lambda o: pickle.dumps(o,-1)
       pickle_unpacker = pickle.loads
      diff -Nru ipython-0.12/IPython/zmq/tests/test_session.py ipython-0.12.1+dfsg/IPython/zmq/tests/test_session.py
      --- ipython-0.12/IPython/zmq/tests/test_session.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/IPython/zmq/tests/test_session.py	2012-04-22 05:10:27.000000000 +0000
      @@ -59,7 +59,7 @@
               self.assertEquals(msg['msg_type'], 'execute')
       
           def test_serialize(self):
      -        msg = self.session.msg('execute',content=dict(a=10))
      +        msg = self.session.msg('execute', content=dict(a=10, b=1.1))
               msg_list = self.session.serialize(msg, ident=b'foo')
               ident, msg_list = self.session.feed_identities(msg_list)
               new_msg = self.session.unserialize(msg_list)
      @@ -69,6 +69,8 @@
               self.assertEquals(new_msg['header'],msg['header'])
               self.assertEquals(new_msg['content'],msg['content'])
               self.assertEquals(new_msg['parent_header'],msg['parent_header'])
      +        # ensure floats don't come out as Decimal:
      +        self.assertEquals(type(new_msg['content']['b']),type(new_msg['content']['b']))
       
           def test_send(self):
               socket = MockSocket(zmq.Context.instance(),zmq.PAIR)
      diff -Nru ipython-0.12/MANIFEST.in ipython-0.12.1+dfsg/MANIFEST.in
      --- ipython-0.12/MANIFEST.in	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/MANIFEST.in	2012-04-22 05:10:27.000000000 +0000
      @@ -1,3 +1,4 @@
      +include README.rst
       include ipython.py
       include setup2.py
       include setup3.py
      @@ -20,12 +21,13 @@
       # Documentation
       graft docs
       exclude docs/\#*
      -exclude docs/man/*.1
      +exclude docs/man/*.1.gz
       
       # docs subdirs we want to skip
       prune docs/attic
       prune docs/build
       prune docs/gh-pages
      +prune docs/dist
       
       # Patterns to exclude from any directory
       global-exclude *~
      diff -Nru ipython-0.12/README.rst ipython-0.12.1+dfsg/README.rst
      --- ipython-0.12/README.rst	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/README.rst	2012-04-22 05:10:27.000000000 +0000
      @@ -5,11 +5,11 @@
       Overview
       ========
       
      -Welcome to IPython. Our full documentation, including PDF versions of our
      -manual, is available on `our website <http://ipython.org/documentation.html>`_;
      -if you downloaded a built source distribution the ``docs/html`` directory
      -contains an HTML version of the manual.  The ``docs/source`` directory contains
      -the plaintext version of these manuals.
      +Welcome to IPython.  Our full documentation is available on `our website
      +<http://ipython.org/documentation.html>`_; if you downloaded a built source
      +distribution the ``docs/source`` directory contains the plaintext version of
      +these manuals.  If you have Sphinx installed, you can build them by typing
      +``make html`` for local browsing.
       
       
       Dependencies and supported Python versions
      diff -Nru ipython-0.12/scripts/ipython_win_post_install.py ipython-0.12.1+dfsg/scripts/ipython_win_post_install.py
      --- ipython-0.12/scripts/ipython_win_post_install.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/scripts/ipython_win_post_install.py	2012-04-22 05:10:27.000000000 +0000
      @@ -118,10 +118,6 @@
               cmdbase += '-script.pyw'
           cmd = '"%s"' % cmdbase
           mkshortcut(pythonw, 'IPython Qt Console', link, cmd, workdir)
      -    # Create documentation shortcuts ...
      -    t = prefix + r'\share\doc\ipython\manual\index.html'
      -    f = ip_start_menu + r'\Manual in HTML.lnk'
      -    mkshortcut(t,'IPython Manual - HTML-Format',f)
           
           
       def remove():
      diff -Nru ipython-0.12/setup2.py ipython-0.12.1+dfsg/setup2.py
      --- ipython-0.12/setup2.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/setup2.py	2012-04-22 05:10:27.000000000 +0000
      @@ -61,6 +61,7 @@
           find_data_files,
           check_for_dependencies,
           record_commit_info,
      +    bdist_wininst_options,
       )
       from setupext import setupext
       
      @@ -147,35 +148,6 @@
                         'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
                        ]
       
      -    # Only build the docs if sphinx is present
      -    try:
      -        import sphinx
      -    except ImportError:
      -        pass
      -    else:
      -        # The Makefile calls the do_sphinx scripts to build html and pdf, so
      -        # just one target is enough to cover all manual generation
      -
      -        # First, compute all the dependencies that can force us to rebuild the
      -        # docs.  Start with the main release file that contains metadata
      -        docdeps = ['IPython/core/release.py']
      -        # Inculde all the reST sources
      -        pjoin = os.path.join
      -        for dirpath,dirnames,filenames in os.walk('docs/source'):
      -            if dirpath in ['_static','_templates']:
      -                continue
      -            docdeps += [ pjoin(dirpath,f) for f in filenames
      -                         if f.endswith('.txt') ]
      -        # and the examples
      -        for dirpath,dirnames,filenames in os.walk('docs/example'):
      -            docdeps += [ pjoin(dirpath,f) for f in filenames
      -                         if not f.endswith('~') ]
      -        # then, make them all dependencies for the main html docs
      -        to_update.append(
      -            ('docs/dist/index.html',
      -             docdeps,
      -             "cd docs && make dist")
      -            )
       
           [ target_update(*t) for t in to_update ]
       
      @@ -219,34 +191,24 @@
               zmq = 'pyzmq>=2.1.4',
               doc = 'Sphinx>=0.3',
               test = 'nose>=0.10.1',
      -        notebook = 'tornado>=2.0'
      +        notebook = 'tornado>=2.0',
      +        qtconsole = 'pygments',
           )
           requires = setup_args.setdefault('install_requires', [])
           setupext.display_status = False
           if not setupext.check_for_readline():
               if sys.platform == 'darwin':
                   requires.append('readline')
      -        elif sys.platform.startswith('win') and sys.maxsize < 2**32:
      -            # only require pyreadline on 32b Windows, due to 64b bug in pyreadline:
      -            # https://bugs.launchpad.net/pyreadline/+bug/787574
      -            requires.append('pyreadline')
      +        elif sys.platform.startswith('win') and \
      +          not 'bdist_wininst' in sys.argv:
      +          # We must avoid listing pyreadline when *building* the binary windows
      +          # installers, because if we do so, then at runtime ipython will fail
      +          # to find a pyreadline that could have been installed without
      +          # setuptools (such as the one from the binary pyreadline installer).
      +          requires.append('pyreadline')
               else:
                   pass
      -            # do we want to install readline here?
      -
      -    # Script to be run by the windows binary installer after the default setup
      -    # routine, to add shortcuts and similar windows-only things.  Windows
      -    # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
      -    # doesn't find them.
      -    if 'bdist_wininst' in sys.argv:
      -        if len(sys.argv) > 2 and \
      -               ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
      -            print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
      -            sys.exit(1)
      -        setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
      -        setup_args['options'] = {"bdist_wininst":
      -                                 {"install_script":
      -                                  "ipython_win_post_install.py"}}
      +    setup_args.update(bdist_wininst_options())
       else:
           # If we are running without setuptools, call this function which will
           # check for dependencies an inform the user what is needed.  This is
      @@ -264,9 +226,11 @@
       setup_args['data_files'] = data_files
       setup_args.update(setuptools_extra_args)
       
      +
       def main():
           setup(**setup_args)
           cleanup()
       
      +
       if __name__ == '__main__':
           main()
      diff -Nru ipython-0.12/setup3.py ipython-0.12.1+dfsg/setup3.py
      --- ipython-0.12/setup3.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/setup3.py	2012-04-22 05:10:27.000000000 +0000
      @@ -8,26 +8,16 @@
                              find_packages,
                              find_package_data,
                              record_commit_info,
      +                       bdist_wininst_options,
                              )
           
       setup_args['entry_points'] = find_scripts(True, suffix='3')
       setup_args['packages'] = find_packages()
       setup_args['package_data'] = find_package_data()
      -setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)}
      +setup_args['cmdclass'] = {'build_py': 
      +                          record_commit_info('IPython', build_cmd=build_py)}
       
      -# Script to be run by the windows binary installer after the default setup
      -# routine, to add shortcuts and similar windows-only things.  Windows
      -# post-install scripts MUST reside in the scripts/ dir, otherwise distutils
      -# doesn't find them.
      -if 'bdist_wininst' in sys.argv:
      -    if len(sys.argv) > 2 and \
      -           ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
      -        print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
      -        sys.exit(1)
      -    setup_args['scripts'] = [os.path.join('scripts','ipython_win_post_install.py')]
      -    setup_args['options'] = {"bdist_wininst":
      -                             {"install_script":
      -                              "ipython_win_post_install.py"}}
      +setup_args.update(bdist_wininst_options())
       
       def main():
           setup(use_2to3 = True, **setup_args)
      diff -Nru ipython-0.12/setupbase.py ipython-0.12.1+dfsg/setupbase.py
      --- ipython-0.12/setupbase.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/setupbase.py	2012-04-22 05:10:27.000000000 +0000
      @@ -44,6 +44,9 @@
           print(">", s)
           os.system(s)
       
      +# Py3 compatibility hacks, without assuming IPython itself is installed with
      +# the full py3compat machinery.
      +
       try:
           execfile
       except NameError:
      @@ -330,41 +333,12 @@
       
       def record_commit_info(pkg_dir, build_cmd=build_py):
           """ Return extended build command class for recording commit
      -
      -    The extended command tries to run git to find the current commit, getting
      -    the empty string if it fails.  It then writes the commit hash into a file
      -    in the `pkg_dir` path, named ``.git_commit_info.ini``.
      -
      -    In due course this information can be used by the package after it is
      -    installed, to tell you what commit it was installed from if known.
      -
      -    To make use of this system, you need a package with a .git_commit_info.ini
      -    file - e.g. ``myproject/.git_commit_info.ini`` - that might well look like
      -    this::
      -
      -        # This is an ini file that may contain information about the code state
      -        [commit hash]
      -        # The line below may contain a valid hash if it has been substituted
      -        # during 'git archive'
      -        archive_subst_hash=$Format:%h$
      -        # This line may be modified by the install process
      -        install_hash=
      -
      -    The .git_commit_info file above is also designed to be used with git
      -    substitution - so you probably also want a ``.gitattributes`` file in the
      -    root directory of your working tree that contains something like this::
      -
      -       myproject/.git_commit_info.ini export-subst
      -
      -    That will cause the ``.git_commit_info.ini`` file to get filled in by ``git
      -    archive`` - useful in case someone makes such an archive - for example with
      -    via the github 'download source' button.
      -
      -    Although all the above will work as is, you might consider having something
      -    like a ``get_info()`` function in your package to display the commit
      -    information at the terminal.  See the ``pkg_info.py`` module in the nipy
      -    package for an example.
      +    
      +    records git commit in IPython.utils._sysinfo.commit
      +    
      +    for use in IPython.utils.sysinfo.sys_info() calls after installation.
           """
      +    
           class MyBuildPy(build_cmd):
               ''' Subclass to write commit data into installation tree '''
               def run(self):
      @@ -375,16 +349,41 @@
                                           stderr=subprocess.PIPE,
                                           shell=True)
                   repo_commit, _ = proc.communicate()
      +            repo_commit = repo_commit.strip()
                   # We write the installation commit even if it's empty
      -            cfg_parser = ConfigParser()
      -            cfg_parser.read(pjoin(pkg_dir, '.git_commit_info.ini'))
      -            if not cfg_parser.has_section('commit hash'):
      -                # just in case the ini file is empty or doesn't exist, somehow
      -                # we don't want the next line to raise
      -                cfg_parser.add_section('commit hash')
      -            cfg_parser.set('commit hash', 'install_hash', repo_commit.decode('ascii'))
      -            out_pth = pjoin(self.build_lib, pkg_dir, '.git_commit_info.ini')
      -            out_file = open(out_pth, 'wt')
      -            cfg_parser.write(out_file)
      -            out_file.close()
      +            out_pth = pjoin(self.build_lib, pkg_dir, 'utils', '_sysinfo.py')
      +            with open(out_pth, 'w') as out_file:
      +                out_file.writelines([
      +                    '# GENERATED BY setup.py\n',
      +                    'commit = "%s"\n' % repo_commit.decode('ascii'),
      +                ])
           return MyBuildPy
      +
      +#-----------------------------------------------------------------------------
      +# Misc. utilities common to setup2/3
      +#-----------------------------------------------------------------------------
      +
      +def bdist_wininst_options():
      +    """Options to setup specific to the creation of Windows binary installer.
      +    """
      +    
      +    setup_args = {}
      +
      +    if 'bdist_wininst' not in sys.argv:
      +        return setup_args
      +
      +    # If we're building a binary Windows installer, a few extra flags are
      +    # needed.  Script to be run by the installer after the default setup
      +    # routine, to add shortcuts and similar windows-only things.  Windows
      +    # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
      +    # doesn't find them.
      +    if len(sys.argv) > 2 and \
      +           ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
      +        print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
      +        sys.exit(1)
      +    setup_args['scripts'] = [os.path.join('scripts',
      +                                          'ipython_win_post_install.py')]
      +    setup_args['options'] = {"bdist_wininst":
      +                             {"install_script":
      +                              "ipython_win_post_install.py"}}
      +    return setup_args
      diff -Nru ipython-0.12/tools/build_release ipython-0.12.1+dfsg/tools/build_release
      --- ipython-0.12/tools/build_release	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/tools/build_release	2012-04-22 05:10:27.000000000 +0000
      @@ -1,6 +1,9 @@
       #!/usr/bin/env python
       """IPython release build script.
       """
      +
      +import os
      +
       from toollib import *
       
       # Get main ipython dir, this will raise if it doesn't pass some checks
      @@ -20,16 +23,16 @@
               remove_tree(d)
       
       # Build source and binary distros
      -sh('./setup.py sdist --formats=gztar,zip')
      +sh(sdists)
       
       # Build eggs
      -sh('python ./setupegg.py bdist_egg')
      +sh(eggs)
       
      -# Call the windows build separately, so that the extra Windows scripts don't
      -# get pulled into Unix builds (setup.py has code which checks for
      -# bdist_wininst)
      -sh("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
      +# Run windows builds
      +map(sh, win_builds)
       
       # Change name so retarded Vista runs the installer correctly
      -sh("rename 's/linux-i686/win32-setup/' dist/*.exe")
      -sh("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
      +sh("rename 's/linux-i686/win32/' dist/*.exe")
      +sh("rename 's/linux-x86_64/win32/' dist/*.exe")
      +# exe files aren't really executable under *nix.
      +sh("chmod -x dist/*.exe")
      diff -Nru ipython-0.12/tools/git-mrb ipython-0.12.1+dfsg/tools/git-mrb
      --- ipython-0.12/tools/git-mrb	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/tools/git-mrb	2012-04-22 05:10:27.000000000 +0000
      @@ -74,7 +74,7 @@
       *************************************************************
       """.format(**shvars)
       
      -ans = raw_input("Revert to master and delete temporary branch? [y/N]: ")
      -if ans.lower() in ('y', 'yes'):
      +ans = raw_input("Revert to master and delete temporary branch? [Y/n]: ")
      +if ans.strip().lower() in ('', 'y', 'yes'):
           sh('git checkout {onto}')
           sh('git branch -D {branch_spec}')
      diff -Nru ipython-0.12/tools/release ipython-0.12.1+dfsg/tools/release
      --- ipython-0.12/tools/release	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/tools/release	2012-04-22 05:10:27.000000000 +0000
      @@ -48,8 +48,10 @@
       cd(ipdir)
       sh('./setup.py register')
       
      -# Upload all files
      -sh('./setup.py sdist --formats=gztar,zip upload')
      +# Upload files.  Note: the windows installers MUST be uploaded manually, doing
      +# it from here results in incorrect names.
      +for cmd in [sdists, eggs]:
      +    sh(cmd + ' upload')
       cd(distdir)
       print( 'Uploading distribution files...')
       
      @@ -59,6 +61,6 @@
       
       print( 'Uploading backup files...')
       cd(ipbackupdir)
      -sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
      +sh('scp -i `ls -1tr *tgz | tail -1` %s' % backup_site)
       
       print('Done!')
      diff -Nru ipython-0.12/tools/toollib.py ipython-0.12.1+dfsg/tools/toollib.py
      --- ipython-0.12/tools/toollib.py	2011-12-19 09:02:39.000000000 +0000
      +++ ipython-0.12.1+dfsg/tools/toollib.py	2012-04-22 05:10:27.000000000 +0000
      @@ -19,6 +19,27 @@
       archive_dir = 'archive.ipython.org'
       archive = '%s:%s' % (archive_user, archive_dir)
       
      +# Build commands
      +# Source dists
      +sdists = './setup.py sdist --formats=gztar,zip'
      +# Eggs
      +eggs = './setupegg.py bdist_egg'
      +
      +# Windows builds.
      +# We do them separately, so that the extra Windows scripts don't get pulled
      +# into Unix builds (setup.py has code which checks for bdist_wininst).  Note
      +# that the install scripts args are added to the main distutils call in
      +# setup.py, so they don't need to be passed here.
      +#
      +# The Windows 64-bit installer can't be built by a Linux/Mac Python because ofa
      +# bug in distutils:  http://bugs.python.org/issue6792.
      +# So we have to build it with a wine-installed native Windows Python...
      +win_builds = ["python setup.py bdist_wininst",
      +              r"%s/.wine/dosdevices/c\:/Python27/python.exe setup.py build "
      +              "--plat-name=win-amd64 bdist_wininst "
      +              "--install-script=ipython_win_post_install.py" %
      +              os.environ['HOME'] ]
      +
       # Utility functions
       def sh(cmd):
           """Run system command in shell, raise SystemExit if it returns an error."""