django-pipeline-1.5.4/0000775000076500000240000000000012573112042014501 5ustar timstaff00000000000000django-pipeline-1.5.4/AUTHORS0000664000076500000240000001035012564155665015572 0ustar timstaff00000000000000Pipeline is a fork of django-compress which was originally created by Andreas Pelme in 2008. These people have provided bug fixes, new features, improved the documentation or just made Pipeline more awesome. * Adam Charnock * Alan Lu * Aleksey Porfirov * Alex Gavrișco * Alexander Artemenko * Alexander Pugachev * Alexis Svinartchouk * Allard Stijnman * Andreas Cederström * Andrew Choi * Andy Kish * Ara Anjargolian * Arnar Yngvason * Axel Haustant * Balazs Kossovics * Ben Vinegar * Brad Pitcher * Brant Young * Brian Montgomery * Bryan Chow * Caio Ariede * Camilo Nova * Carl Meyer * Casey Greene * Chris Applegate * Chris Reeves * Christian Hammond * Christofer Bertonha * Christopher Dilorenzo * Collin Stedman * Corrado Primier * Danielle Madeley * David Charbonnier * David Cramer * David Hughes * Denis V Seleznyov * DJ Sharkey * Edwin Lunando * Eric Hamiter * Evan Myller * Fabian Büchler * Feanil Patel * Florent Messa * Hannes Ljungberg * Idan Zalzberg * Jacob Haslehurst * James Keys * Jannis Leidel * Jared Scott * Jaromir Fojtu * Jon Dufresne * Josh Braegger * Joshua Kehn * Julien Hartmann * Kristian Glass * Kyle MacFarlane * Leonardo Orozco * Luke Yu-Po Chen * Mark Sandstrom * Matt Dennewitz * Matthieu Gallet * Max Klymyshyn * Melvin Laplanche * Michael Weibel * Michał Górny * Miguel Araujo Perez * Mike Gilbert * Miroslav Shubernetskiy * Natal Ngetal * Nathan Shafer * Patrick Altman * Peter Baumgartner * Philipp Wollermann * Pierre Drescher * Rajiv Bose * Rami Chowdhury * Remco Wendt * Remy Sanchez * Sam Thomson * Sander Smits * Sander Steffann * Sayed Raianul Kabir * Simon Lydell * Sirex * Stefano Brentegani * Stephan Wienczny * Steven Cummings * Tadas Dailyda * Teo Klestrup Röijezon * Thomas Parslow * Timothée Peignier * Tom Yam * Tomek Paczkowski * Trey Smith * Venelin Stoykov * Victor Shnayder * Wictor Olseryd * Zachary Kazanski * Zenobius Jiricek django-pipeline-1.5.4/django_pipeline.egg-info/0000775000076500000240000000000012573112042021322 5ustar timstaff00000000000000django-pipeline-1.5.4/django_pipeline.egg-info/dependency_links.txt0000664000076500000240000000000112573112037025374 0ustar timstaff00000000000000 django-pipeline-1.5.4/django_pipeline.egg-info/not-zip-safe0000664000076500000240000000000112557201114023551 0ustar timstaff00000000000000 django-pipeline-1.5.4/django_pipeline.egg-info/pbr.json0000664000076500000240000000005712573112037023006 0ustar timstaff00000000000000{"is_release": false, "git_version": "c8c1b91"}django-pipeline-1.5.4/django_pipeline.egg-info/PKG-INFO0000664000076500000240000000501512573112037022424 0ustar timstaff00000000000000Metadata-Version: 1.1 Name: django-pipeline Version: 1.5.4 Summary: Pipeline is an asset packaging library for Django. Home-page: https://github.com/cyberdelia/django-pipeline Author: Timothée Peignier Author-email: timothee.peignier@tryphon.org License: MIT Description: Pipeline ======== Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript template support, and optional data-URI image and font embedding. Installation ------------ To install it, simply: :: pip install django-pipeline Documentation ------------- For documentation, usage, and examples, see : http://django-pipeline.readthedocs.org .. :changelog: History ======= 1.5.4 ===== * Stop returning gzipped file when using GZIPMixin. * Fix jinja templates packaging. 1.5.3 ===== * Fix futures import. Thanks to Mathieu Gallet. * Make GZIPMixin returns the gziped file. * Fix import shadowing. Thanks to Christofer Bertonha. * Fix tests settings for Django 1.9. Thanks to Leonardo Orozco. * Improve javascript concatenation. Thanks to Simon Lydell and Alex Gavrișco. * Improve finder logic. Thanks to Nathan Shafer and James Keys. * Documentation fix. Thanks to Stefano Brentegani. 1.5.2 ===== * Use smart_bytes and smart_text appropriately. Thanks to Tadas Dailyda. * Fix outdated logic. Thanks to Tadas Dailyda. 1.5.1 ===== * Prevent collecting all static multiple times per request. Thanks to Allard Stijnman. * Fix encoding issues. Thanks to Leonardo Orozco. * Improve Django 1.8. Thanks to Carl Meyer. 1.5.0 ===== * Add full support for Django 1.8. * Drop support for Django 1.6. * Drop support for Python 2.6. Platform: UNKNOWN Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Utilities django-pipeline-1.5.4/django_pipeline.egg-info/requires.txt0000664000076500000240000000001712573112037023724 0ustar timstaff00000000000000futures>=2.1.3 django-pipeline-1.5.4/django_pipeline.egg-info/SOURCES.txt0000664000076500000240000001360612573112041023213 0ustar timstaff00000000000000AUTHORS HISTORY.rst LICENSE MANIFEST.in README.rst setup.cfg setup.py django_pipeline.egg-info/PKG-INFO django_pipeline.egg-info/SOURCES.txt django_pipeline.egg-info/dependency_links.txt django_pipeline.egg-info/not-zip-safe django_pipeline.egg-info/pbr.json django_pipeline.egg-info/requires.txt django_pipeline.egg-info/top_level.txt docs/Makefile docs/compilers.rst docs/compressors.rst docs/conf.py docs/configuration.rst docs/index.rst docs/installation.rst docs/make.bat docs/signals.rst docs/storages.rst docs/templates.rst docs/usage.rst docs/using.rst pipeline/__init__.py pipeline/collector.py pipeline/conf.py pipeline/exceptions.py pipeline/finders.py pipeline/glob.py pipeline/manifest.py pipeline/middleware.py pipeline/packager.py pipeline/signals.py pipeline/storage.py pipeline/utils.py pipeline/compilers/__init__.py pipeline/compilers/coffee.py pipeline/compilers/es6.py pipeline/compilers/less.py pipeline/compilers/livescript.py pipeline/compilers/sass.py pipeline/compilers/stylus.py pipeline/compressors/__init__.py pipeline/compressors/closure.py pipeline/compressors/cssmin.py pipeline/compressors/csstidy.py pipeline/compressors/jsmin.py pipeline/compressors/slimit.py pipeline/compressors/uglifyjs.py pipeline/compressors/yuglify.py pipeline/compressors/yui.py pipeline/jinja2/pipeline/css.jinja pipeline/jinja2/pipeline/inline_js.jinja pipeline/jinja2/pipeline/js.jinja pipeline/templates/pipeline/css.html pipeline/templates/pipeline/css.jinja pipeline/templates/pipeline/inline_js.html pipeline/templates/pipeline/inline_js.jinja pipeline/templates/pipeline/js.html pipeline/templates/pipeline/js.jinja pipeline/templatetags/__init__.py pipeline/templatetags/ext.py pipeline/templatetags/pipeline.py tests/__init__.py tests/models.py tests/settings.py tests/urls.py tests/utils.py tests/views.py tests/assets/css/first.css tests/assets/css/second.css tests/assets/css/unicode.css tests/assets/css/urls.css tests/assets/css/nested/nested.css tests/assets/fonts/pipeline.eot tests/assets/fonts/pipeline.svg tests/assets/fonts/pipeline.ttf tests/assets/fonts/pipeline.woff tests/assets/images/arrow.png tests/assets/images/sprite-buttons.png tests/assets/images/embed/arrow.png tests/assets/js/application.js tests/assets/js/dummy.coffee tests/assets/js/first.js tests/assets/js/second.js tests/assets/templates/photo/detail.jst tests/assets/templates/photo/list.jst tests/assets/templates/video/detail.jst tests/static/screen.css tests/static/scripts.js tests/static/admin/css/base.css tests/static/admin/css/changelists.css tests/static/admin/css/dashboard.css tests/static/admin/css/forms.css tests/static/admin/css/ie.css tests/static/admin/css/login.css tests/static/admin/css/rtl.css tests/static/admin/css/widgets.css tests/static/admin/img/changelist-bg.gif tests/static/admin/img/changelist-bg_rtl.gif tests/static/admin/img/default-bg-reverse.gif tests/static/admin/img/default-bg.gif tests/static/admin/img/deleted-overlay.gif tests/static/admin/img/icon-no.gif tests/static/admin/img/icon-unknown.gif tests/static/admin/img/icon-yes.gif tests/static/admin/img/icon_addlink.gif tests/static/admin/img/icon_alert.gif tests/static/admin/img/icon_calendar.gif tests/static/admin/img/icon_changelink.gif tests/static/admin/img/icon_clock.gif tests/static/admin/img/icon_deletelink.gif tests/static/admin/img/icon_error.gif tests/static/admin/img/icon_searchbox.png tests/static/admin/img/icon_success.gif tests/static/admin/img/inline-delete-8bit.png tests/static/admin/img/inline-delete.png tests/static/admin/img/inline-restore-8bit.png tests/static/admin/img/inline-restore.png tests/static/admin/img/inline-splitter-bg.gif tests/static/admin/img/nav-bg-grabber.gif tests/static/admin/img/nav-bg-reverse.gif tests/static/admin/img/nav-bg-selected.gif tests/static/admin/img/nav-bg.gif tests/static/admin/img/selector-icons.gif tests/static/admin/img/selector-search.gif tests/static/admin/img/sorting-icons.gif tests/static/admin/img/tooltag-add.png tests/static/admin/img/tooltag-arrowright.png tests/static/admin/img/gis/move_vertex_off.png tests/static/admin/img/gis/move_vertex_on.png tests/static/admin/js/LICENSE-JQUERY.txt tests/static/admin/js/SelectBox.js tests/static/admin/js/SelectFilter2.js tests/static/admin/js/actions.js tests/static/admin/js/actions.min.js tests/static/admin/js/calendar.js tests/static/admin/js/collapse.js tests/static/admin/js/collapse.min.js tests/static/admin/js/core.js tests/static/admin/js/inlines.js tests/static/admin/js/inlines.min.js tests/static/admin/js/jquery.init.js tests/static/admin/js/jquery.js tests/static/admin/js/jquery.min.js tests/static/admin/js/prepopulate.js tests/static/admin/js/prepopulate.min.js tests/static/admin/js/related-widget-wrapper.js tests/static/admin/js/timeparse.js tests/static/admin/js/urlify.js tests/static/admin/js/admin/DateTimeShortcuts.js tests/static/admin/js/admin/RelatedObjectLookups.js tests/static/pipeline/css/first.css tests/static/pipeline/css/second.css tests/static/pipeline/css/unicode.css tests/static/pipeline/css/urls.css tests/static/pipeline/css/nested/nested.css tests/static/pipeline/fonts/pipeline.eot tests/static/pipeline/fonts/pipeline.svg tests/static/pipeline/fonts/pipeline.ttf tests/static/pipeline/fonts/pipeline.woff tests/static/pipeline/images/arrow.png tests/static/pipeline/images/sprite-buttons.png tests/static/pipeline/images/embed/arrow.png tests/static/pipeline/js/application.js tests/static/pipeline/js/dummy.coffee tests/static/pipeline/js/first.js tests/static/pipeline/js/second.js tests/static/pipeline/templates/photo/detail.jst tests/static/pipeline/templates/photo/list.jst tests/static/pipeline/templates/video/detail.jst tests/templates/empty.html tests/templates/index.html tests/tests/__init__.py tests/tests/models.py tests/tests/test_compiler.py tests/tests/test_compressor.py tests/tests/test_glob.py tests/tests/test_middleware.py tests/tests/test_packager.py tests/tests/test_storage.py tests/tests/test_template.py tests/tests/test_utils.pydjango-pipeline-1.5.4/django_pipeline.egg-info/top_level.txt0000664000076500000240000000001112573112037024050 0ustar timstaff00000000000000pipeline django-pipeline-1.5.4/docs/0000775000076500000240000000000012573112042015431 5ustar timstaff00000000000000django-pipeline-1.5.4/docs/compilers.rst0000664000076500000240000001254512566170037020201 0ustar timstaff00000000000000.. _ref-compilers: ========= Compilers ========= Coffee Script compiler ====================== The Coffee Script compiler uses `Coffee Script `_ to compile your javascript. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.coffee.CoffeeScriptCompiler', ) ``PIPELINE_COFFEE_SCRIPT_BINARY`` --------------------------------- Command line to execute for coffee program. You will most likely change this to the location of coffee on your system. Defaults to ``'/usr/bin/env coffee'``. ``PIPELINE_COFFEE_SCRIPT_ARGUMENTS`` ------------------------------------ Additional arguments to use when coffee is called. Defaults to ``''``. Live Script compiler ====================== The LiveScript compiler uses `LiveScript `_ to compile your javascript. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.livescript.LiveScriptCompiler', ) ``PIPELINE_LIVE_SCRIPT_BINARY`` --------------------------------- Command line to execute for LiveScript program. You will most likely change this to the location of lsc on your system. Defaults to ``'/usr/bin/env lsc'``. ``PIPELINE_LIVE_SCRIPT_ARGUMENTS`` ------------------------------------ Additional arguments to use when lsc is called. Defaults to ``''``. LESS compiler ============= The LESS compiler uses `LESS `_ to compile your stylesheets. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.less.LessCompiler', ) ``PIPELINE_LESS_BINARY`` ------------------------ Command line to execute for lessc program. You will most likely change this to the location of lessc on your system. Defaults to ``'/usr/bin/env lessc'``. ``PIPELINE_LESS_ARGUMENTS`` --------------------------- Additional arguments to use when lessc is called. Defaults to ``''``. SASS compiler ============= The SASS compiler uses `SASS `_ to compile your stylesheets. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.sass.SASSCompiler', ) ``PIPELINE_SASS_BINARY`` ------------------------ Command line to execute for sass program. You will most likely change this to the location of sass on your system. Defaults to ``'/usr/bin/env sass'``. ``PIPELINE_SASS_ARGUMENTS`` --------------------------- Additional arguments to use when sass is called. Defaults to ``''``. Stylus compiler =============== The Stylus compiler uses `Stylus `_ to compile your stylesheets. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.stylus.StylusCompiler', ) ``PIPELINE_STYLUS_BINARY`` -------------------------- Command line to execute for stylus program. You will most likely change this to the location of stylus on your system. Defaults to ``'/usr/bin/env stylus'``. ``PIPELINE_STYLUS_ARGUMENTS`` ----------------------------- Additional arguments to use when stylus is called. Defaults to ``''``. ES6 compiler ============ The ES6 compiler uses `Babel `_ to convert ES6+ code into vanilla ES5. To use it add this to your ``PIPELINE_COMPILERS`` :: PIPELINE_COMPILERS = ( 'pipeline.compilers.es6.ES6Compiler', ) ``PIPELINE_BABEL_BINARY`` -------------------------- Command line to execute for babel program. You will most likely change this to the location of babel on your system. Defaults to ``'/usr/bin/env babel'``. ``PIPELINE_BABEL_ARGUMENTS`` ----------------------------- Additional arguments to use when babel is called. Defaults to ``''``. Write your own compiler class ============================= You can write your own compiler class, for example if you want to implement other types of compilers. To do so, you just have to create a class that inherits from ``pipeline.compilers.CompilerBase`` and implements ``match_file`` and ``compile_file`` when needed. Finally, specify it in the tuple of compilers ``PIPELINE_COMPILERS`` in the settings. Example ------- A custom compiler for an imaginary compiler called jam :: from pipeline.compilers import CompilerBase class JamCompiler(CompilerBase): output_extension = 'js' def match_file(self, filename): return filename.endswith('.jam') def compile_file(self, infile, outfile, outdated=False, force=False): if not outdated and not force: return # No need to recompiled file return jam.compile(infile, outfile) 3rd Party Compilers =================== Here is an (in)complete list of 3rd party compilers that integrate with django-pipeline Compass (requires RubyGem) -------------------------- :Creator: `Mila Labs `_ :Description: Compass compiler for django-pipeline using the original Ruby gem. :Link: `https://github.com/mila-labs/django-pipeline-compass-rubygem` Compass (standalone) -------------------- :Creator: `Vitaly Babiy `_ :Description: django-pipeline-compass is a compiler for `django-pipeline `_. Making it really easy to use scss and compass with out requiring the compass gem. :Link: `https://github.com/vbabiy/django-pipeline-compass` django-pipeline-1.5.4/docs/compressors.rst0000664000076500000240000001550212566170037020557 0ustar timstaff00000000000000.. _ref-compressors: =========== Compressors =========== Yuglify compressor ================== The Yuglify compressor uses `yuglify `_ for compressing javascript and stylesheets. To use it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` :: PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor' To use it for your javascripts add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor' ``PIPELINE_YUGLIFY_BINARY`` --------------------------- Command line to execute for the Yuglify program. You will most likely change this to the location of yuglify on your system. Defaults to ``'/usr/bin/env yuglify'``. ``PIPELINE_YUGLIFY_CSS_ARGUMENTS`` ---------------------------------- Additional arguments to use when compressing CSS. Defaults to ``'--terminal'``. ``PIPELINE_YUGLIFY_JS_ARGUMENTS`` --------------------------------- Additional arguments to use when compressing JavaScript. Defaults to ``'--terminal'``. YUI Compressor compressor ========================= The YUI compressor uses `yui-compressor `_ for compressing javascript and stylesheets. To use it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` :: PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor' To use it for your javascripts add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor' ``PIPELINE_YUI_BINARY`` ----------------------- Command line to execute for the YUI program. You will most likely change this to the location of yui-compressor on your system. Defaults to ``'/usr/bin/env yuicompressor'``. .. warning:: Don't point to ``yuicompressor.jar`` directly, we expect to find a executable script. ``PIPELINE_YUI_CSS_ARGUMENTS`` ------------------------------ Additional arguments to use when compressing CSS. Defaults to ``''``. ``PIPELINE_YUI_JS_ARGUMENTS`` ----------------------------- Additional arguments to use when compressing JavaScript. Defaults to ``''``. Closure Compiler compressor =========================== The Closure compressor uses `Google Closure Compiler `_ to compress javascripts. To use it add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.closure.ClosureCompressor' ``PIPELINE_CLOSURE_BINARY`` --------------------------- Command line to execute for the Closure Compiler program. You will most likely change this to the location of closure on your system. Default to ``'/usr/bin/env closure'`` .. warning:: Don't point to ``compiler.jar`` directly, we expect to find a executable script. ``PIPELINE_CLOSURE_ARGUMENTS`` ------------------------------ Additional arguments to use when closure is called. Default to ``''`` UglifyJS compressor =================== The UglifyJS compressor uses `UglifyJS `_ to compress javascripts. To use it add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.uglifyjs.UglifyJSCompressor' ``PIPELINE_UGLIFYJS_BINARY`` ---------------------------- Command line to execute for the UglifyJS program. You will most likely change this to the location of uglifyjs on your system. Defaults to ``'/usr/bin/env uglifyjs'``. ``PIPELINE_UGLIFYJS_ARGUMENTS`` ------------------------------- Additional arguments to use when uglifyjs is called. Default to ``''`` JSMin compressor ================ The jsmin compressor uses Douglas Crockford jsmin tool to compress javascripts. To use it add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.jsmin.JSMinCompressor' Install the jsmin library with your favorite Python package manager :: pip install jsmin SlimIt compressor ================= The slimit compressor uses `SlimIt `_ to compress javascripts. To use it add this to your ``PIPELINE_JS_COMPRESSOR`` :: PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.slimit.SlimItCompressor' Install the slimit library with your favorite Python package manager :: pip install slimit CSSTidy compressor ================== The CSStidy compressor uses `CSStidy `_ to compress stylesheets. To us it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` :: PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.csstidy.CSSTidyCompressor' ``PIPELINE_CSSTIDY_BINARY`` --------------------------- Command line to execute for csstidy program. You will most likely change this to the location of csstidy on your system. Defaults to ``'/usr/bin/env csstidy'`` ``PIPELINE_CSSTIDY_ARGUMENTS`` ------------------------------ Additional arguments to use when csstidy is called. Default to ``'--template=highest'`` CSSMin compressor ================= The cssmin compressor uses the `cssmin `_ command to compress stylesheets. To use it, add this to your ``PIPELINE_CSS_COMPRESSOR`` :: PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.cssmin.CSSMinCompressor' ``PIPELINE_CSSMIN_BINARY`` --------------------------- Command line to execute for cssmin program. You will most likely change this to the location of cssmin on your system. Defaults to ``'/usr/bin/env cssmin'`` ``PIPELINE_CSSMIN_ARGUMENTS`` ------------------------------ Additional arguments to use when cssmin is called. Default to ``''`` No-Op Compressors ================= The No-Op compressor don't perform any operation, when used, only concatenation occurs. This is useful for debugging faulty concatenation due to poorly written javascript and other errors. To use it, add this to your settings :: PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.NoopCompressor' PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.NoopCompressor' Write your own compressor class =============================== You can write your own compressor class, for example if you want to implement other types of compressors. To do so, you just have to create a class that inherits from ``pipeline.compressors.CompressorBase`` and implements ``compress_css`` and/or a ``compress_js`` when needed. Finally, add it to ``PIPELINE_CSS_COMPRESSOR`` or ``PIPELINE_JS_COMPRESSOR`` settings (see :doc:`configuration` for more information). Example ------- A custom compressor for an imaginary compressor called jam :: from pipeline.compressors import CompressorBase class JamCompressor(CompressorBase): def compress_js(self, js): return jam.compress(js) def compress_css(self, css): return jam.compress(css) Add it to your settings :: PIPELINE_CSS_COMPRESSOR = 'jam.compressors.JamCompressor' PIPELINE_JS_COMPRESSOR = 'jam.compressors.JamCompressor' django-pipeline-1.5.4/docs/conf.py0000664000076500000240000001560012573111360016734 0ustar timstaff00000000000000# -*- coding: utf-8 -*- # # Pipeline documentation build configuration file, created by # sphinx-quickstart on Sat Apr 30 17:47:55 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'django-pipeline' copyright = u'2011-2014, Timothée Peignier' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.5' # The full version, including alpha/beta/rc tags. release = '1.5.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'django-pipelinedoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'django-pipeline.tex', u'Pipeline Documentation', u'Timothée Peignier', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'django-pipeline', u'Pipeline Documentation', [u'Timothée Peignier'], 1) ] django-pipeline-1.5.4/docs/configuration.rst0000664000076500000240000001422112566170037021044 0ustar timstaff00000000000000.. _ref-configuration: ============= Configuration ============= Configuration and list of available settings for Pipeline Specifying files ================ You specify groups of files to be compressed in your settings. You can use glob syntax to select multiples files. The basic syntax for specifying CSS/JavaScript groups files is :: PIPELINE_CSS = { 'colors': { 'source_filenames': ( 'css/core.css', 'css/colors/*.css', 'css/layers.css' ), 'output_filename': 'css/colors.css', 'extra_context': { 'media': 'screen,projection', }, }, } PIPELINE_JS = { 'stats': { 'source_filenames': ( 'js/jquery.js', 'js/d3.js', 'js/collections/*.js', 'js/application.js', ), 'output_filename': 'js/stats.js', } } Group options ------------- ``source_filenames`` .................... **Required** Is a tuple with the source files to be compressed. The files are concatenated in the order specified in the tuple. ``output_filename`` ................... **Required** Is the filename of the (to be) compressed file. ``variant`` ........... **Optional** Is the variant you want to apply to your CSS. This allow you to embed images and fonts in CSS with data-URI. Allowed values are : ``None`` and ``datauri``. Defaults to ``None``. ``template_name`` ................. **Optional** Name of the template used to render `` django-pipeline-1.5.4/pipeline/jinja2/pipeline/js.jinja0000664000076500000240000000020212556040202022712 0ustar timstaff00000000000000 django-pipeline-1.5.4/pipeline/manifest.py0000664000076500000240000000412212566170040020471 0ustar timstaff00000000000000from __future__ import unicode_literals import os from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from pipeline.conf import settings from manifesto import Manifest from pipeline.packager import Packager class PipelineManifest(Manifest): def __init__(self): self.packager = Packager() self.packages = self.collect_packages() self.finders = get_finders() self.package_files = [] def collect_packages(self): packages = [] for package_name in self.packager.packages['css']: package = self.packager.package_for('css', package_name) if package.manifest: packages.append(package) for package_name in self.packager.packages['js']: package = self.packager.package_for('js', package_name) if package.manifest: packages.append(package) return packages def cache(self): ignore_patterns = getattr(settings, "STATICFILES_IGNORE_PATTERNS", None) if settings.PIPELINE_ENABLED: for package in self.packages: path = package.output_filename self.package_files.append(path) yield staticfiles_storage.url(path) else: for package in self.packages: for path in self.packager.compile(package.paths): self.package_files.append(path) yield staticfiles_storage.url(path) for finder in self.finders: for path, storage in finder.list(ignore_patterns): # Prefix the relative path if the source storage contains it if getattr(storage, 'prefix', None): prefixed_path = os.path.join(storage.prefix, path) else: prefixed_path = path # Dont add any doubles if prefixed_path not in self.package_files: self.package_files.append(prefixed_path) yield staticfiles_storage.url(prefixed_path) django-pipeline-1.5.4/pipeline/middleware.py0000664000076500000240000000143412465500503021002 0ustar timstaff00000000000000from __future__ import unicode_literals from django.core.exceptions import MiddlewareNotUsed from django.utils.encoding import DjangoUnicodeDecodeError from django.utils.html import strip_spaces_between_tags as minify_html from pipeline.conf import settings class MinifyHTMLMiddleware(object): def __init__(self): if not settings.PIPELINE_ENABLED: raise MiddlewareNotUsed def process_response(self, request, response): if response.has_header('Content-Type') and 'text/html' in response['Content-Type']: try: response.content = minify_html(response.content.strip()) response['Content-Length'] = str(len(response.content)) except DjangoUnicodeDecodeError: pass return response django-pipeline-1.5.4/pipeline/packager.py0000664000076500000240000001020712566170040020441 0ustar timstaff00000000000000from __future__ import unicode_literals from django.contrib.staticfiles.storage import staticfiles_storage from django.contrib.staticfiles.finders import find from django.core.files.base import ContentFile from django.utils.encoding import smart_bytes from pipeline.compilers import Compiler from pipeline.compressors import Compressor from pipeline.conf import settings from pipeline.exceptions import PackageNotFound from pipeline.glob import glob from pipeline.signals import css_compressed, js_compressed class Package(object): def __init__(self, config): self.config = config self._sources = [] @property def sources(self): if not self._sources: paths = [] for pattern in self.config.get('source_filenames', []): for path in glob(pattern): if path not in paths and find(path): paths.append(str(path)) self._sources = paths return self._sources @property def paths(self): return [path for path in self.sources if not path.endswith(settings.PIPELINE_TEMPLATE_EXT)] @property def templates(self): return [path for path in self.sources if path.endswith(settings.PIPELINE_TEMPLATE_EXT)] @property def output_filename(self): return self.config.get('output_filename') @property def extra_context(self): return self.config.get('extra_context', {}) @property def template_name(self): return self.config.get('template_name') @property def variant(self): return self.config.get('variant') @property def manifest(self): return self.config.get('manifest', True) class Packager(object): def __init__(self, storage=None, verbose=False, css_packages=None, js_packages=None): if storage is None: storage = staticfiles_storage self.storage = storage self.verbose = verbose self.compressor = Compressor(storage=storage, verbose=verbose) self.compiler = Compiler(storage=storage, verbose=verbose) if css_packages is None: css_packages = settings.PIPELINE_CSS if js_packages is None: js_packages = settings.PIPELINE_JS self.packages = { 'css': self.create_packages(css_packages), 'js': self.create_packages(js_packages), } def package_for(self, kind, package_name): try: return self.packages[kind][package_name] except KeyError: raise PackageNotFound( "No corresponding package for %s package name : %s" % ( kind, package_name ) ) def individual_url(self, filename): return self.storage.url(filename) def pack_stylesheets(self, package, **kwargs): return self.pack(package, self.compressor.compress_css, css_compressed, output_filename=package.output_filename, variant=package.variant, **kwargs) def compile(self, paths, force=False): return self.compiler.compile(paths, force=force) def pack(self, package, compress, signal, **kwargs): output_filename = package.output_filename if self.verbose: print("Saving: %s" % output_filename) paths = self.compile(package.paths, force=True) content = compress(paths, **kwargs) self.save_file(output_filename, content) signal.send(sender=self, package=package, **kwargs) return output_filename def pack_javascripts(self, package, **kwargs): return self.pack(package, self.compressor.compress_js, js_compressed, templates=package.templates, **kwargs) def pack_templates(self, package): return self.compressor.compile_templates(package.templates) def save_file(self, path, content): return self.storage.save(path, ContentFile(smart_bytes(content))) def create_packages(self, config): packages = {} if not config: return packages for name in config: packages[name] = Package(config[name]) return packages django-pipeline-1.5.4/pipeline/signals.py0000664000076500000240000000026512301051717020323 0ustar timstaff00000000000000from __future__ import unicode_literals from django.dispatch import Signal css_compressed = Signal(providing_args=["package"]) js_compressed = Signal(providing_args=["package"]) django-pipeline-1.5.4/pipeline/storage.py0000664000076500000240000000633112566174622020345 0ustar timstaff00000000000000from __future__ import unicode_literals import gzip from io import BytesIO from django.contrib.staticfiles.storage import CachedStaticFilesStorage, StaticFilesStorage from django.contrib.staticfiles.utils import matches_patterns from django.core.files.base import File class PipelineMixin(object): packing = True def post_process(self, paths, dry_run=False, **options): if dry_run: return from pipeline.packager import Packager packager = Packager(storage=self) for package_name in packager.packages['css']: package = packager.package_for('css', package_name) output_file = package.output_filename if self.packing: packager.pack_stylesheets(package) paths[output_file] = (self, output_file) yield output_file, output_file, True for package_name in packager.packages['js']: package = packager.package_for('js', package_name) output_file = package.output_filename if self.packing: packager.pack_javascripts(package) paths[output_file] = (self, output_file) yield output_file, output_file, True super_class = super(PipelineMixin, self) if hasattr(super_class, 'post_process'): for name, hashed_name, processed in super_class.post_process(paths.copy(), dry_run, **options): yield name, hashed_name, processed def get_available_name(self, name, max_length=None): if self.exists(name): self.delete(name) return name class GZIPMixin(object): gzip_patterns = ("*.css", "*.js") def _compress(self, original_file): content = BytesIO() gzip_file = gzip.GzipFile(mode='wb', fileobj=content) gzip_file.write(original_file.read()) gzip_file.close() content.seek(0) return File(content) def post_process(self, paths, dry_run=False, **options): super_class = super(GZIPMixin, self) if hasattr(super_class, 'post_process'): for name, hashed_name, processed in super_class.post_process(paths.copy(), dry_run, **options): if hashed_name != name: paths[hashed_name] = (self, hashed_name) yield name, hashed_name, processed if dry_run: return for path in paths: if path: if not matches_patterns(path, self.gzip_patterns): continue original_file = self.open(path) gzipped_path = "{0}.gz".format(path) if self.exists(gzipped_path): self.delete(gzipped_path) gzipped_file = self._compress(original_file) gzipped_path = self.save(gzipped_path, gzipped_file) yield gzipped_path, gzipped_path, True class NonPackagingMixin(object): packing = False class PipelineStorage(PipelineMixin, StaticFilesStorage): pass class NonPackagingPipelineStorage(NonPackagingMixin, PipelineStorage): pass class PipelineCachedStorage(PipelineMixin, CachedStaticFilesStorage): pass class NonPackagingPipelineCachedStorage(NonPackagingMixin, PipelineCachedStorage): pass django-pipeline-1.5.4/pipeline/templates/0000775000076500000240000000000012573112042020304 5ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templates/pipeline/0000775000076500000240000000000012573112042022111 5ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templates/pipeline/css.html0000664000076500000240000000032712133622152023571 0ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templates/pipeline/css.jinja0000664000076500000240000000023512517004523023720 0ustar timstaff00000000000000 django-pipeline-1.5.4/pipeline/templates/pipeline/inline_js.html0000664000076500000240000000017312301051717024752 0ustar timstaff00000000000000 {{ source|safe }} django-pipeline-1.5.4/pipeline/templates/pipeline/inline_js.jinja0000664000076500000240000000017412517004523025104 0ustar timstaff00000000000000 {{ source|safe }} django-pipeline-1.5.4/pipeline/templates/pipeline/js.html0000664000076500000240000000020112301051717023404 0ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templates/pipeline/js.jinja0000664000076500000240000000020212517004523023536 0ustar timstaff00000000000000 django-pipeline-1.5.4/pipeline/templatetags/0000775000076500000240000000000012573112042021000 5ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templatetags/__init__.py0000664000076500000240000000000012133622152023077 0ustar timstaff00000000000000django-pipeline-1.5.4/pipeline/templatetags/ext.py0000664000076500000240000000572712556040202022164 0ustar timstaff00000000000000from __future__ import unicode_literals from jinja2 import nodes, TemplateSyntaxError from jinja2.ext import Extension from django.contrib.staticfiles.storage import staticfiles_storage from ..packager import PackageNotFound from ..utils import guess_type from .pipeline import PipelineMixin class PipelineExtension(PipelineMixin, Extension): tags = set(['stylesheet', 'javascript']) def parse(self, parser): tag = next(parser.stream) package_name = parser.parse_expression() if not package_name: raise TemplateSyntaxError("Bad package name", tag.lineno) args = [package_name] if tag.value == "stylesheet": return nodes.CallBlock(self.call_method('package_css', args), [], [], []).set_lineno(tag.lineno) if tag.value == "javascript": return nodes.CallBlock(self.call_method('package_js', args), [], [], []).set_lineno(tag.lineno) return [] def package_css(self, package_name, *args, **kwargs): try: package = self.package_for(package_name, 'css') except PackageNotFound: return '' # fail silently, do not return anything if an invalid group is specified return self.render_compressed(package, 'css') def render_css(self, package, path): template_name = package.template_name or "pipeline/css.jinja" context = package.extra_context context.update({ 'type': guess_type(path, 'text/css'), 'url': staticfiles_storage.url(path) }) template = self.environment.get_template(template_name) return template.render(context) def render_individual_css(self, package, paths, **kwargs): tags = [self.render_css(package, path) for path in paths] return '\n'.join(tags) def package_js(self, package_name, *args, **kwargs): try: package = self.package_for(package_name, 'js') except PackageNotFound: return '' # fail silently, do not return anything if an invalid group is specified return self.render_compressed(package, 'js') def render_js(self, package, path): template_name = package.template_name or "pipeline/js.jinja" context = package.extra_context context.update({ 'type': guess_type(path, 'text/javascript'), 'url': staticfiles_storage.url(path) }) template = self.environment.get_template(template_name) return template.render(context) def render_inline(self, package, js): context = package.extra_context context.update({ 'source': js }) template = self.environment.get_template("pipeline/inline_js.jinja") return template.render(context) def render_individual_js(self, package, paths, templates=None): tags = [self.render_js(package, js) for js in paths] if templates: tags.append(self.render_inline(package, templates)) return '\n'.join(tags) django-pipeline-1.5.4/pipeline/templatetags/pipeline.py0000664000076500000240000001163212566170040023166 0ustar timstaff00000000000000from __future__ import unicode_literals from django.contrib.staticfiles.storage import staticfiles_storage from django import template from django.template.base import VariableDoesNotExist from django.template.loader import render_to_string from django.utils.safestring import mark_safe from ..collector import default_collector from ..conf import settings from ..packager import Packager, PackageNotFound from ..utils import guess_type register = template.Library() class PipelineMixin(object): request = None _request_var = None @property def request_var(self): if not self._request_var: self._request_var = template.Variable('request') return self._request_var def package_for(self, package_name, package_type): package = { 'js': getattr(settings, 'PIPELINE_JS', {}).get(package_name, {}), 'css': getattr(settings, 'PIPELINE_CSS', {}).get(package_name, {}), }[package_type] if package: package = {package_name: package} packager = { 'js': Packager(css_packages={}, js_packages=package), 'css': Packager(css_packages=package, js_packages={}), }[package_type] return packager.package_for(package_type, package_name) def render(self, context): try: self.request = self.request_var.resolve(context) except VariableDoesNotExist: pass def render_compressed(self, package, package_type): if settings.PIPELINE_ENABLED: method = getattr(self, "render_{0}".format(package_type)) return method(package, package.output_filename) else: default_collector.collect(self.request) packager = Packager() method = getattr(self, "render_individual_{0}".format(package_type)) paths = packager.compile(package.paths) templates = packager.pack_templates(package) return method(package, paths, templates=templates) class StylesheetNode(PipelineMixin, template.Node): def __init__(self, name): self.name = name def render(self, context): super(StylesheetNode, self).render(context) package_name = template.Variable(self.name).resolve(context) try: package = self.package_for(package_name, 'css') except PackageNotFound: return '' # fail silently, do not return anything if an invalid group is specified return self.render_compressed(package, 'css') def render_css(self, package, path): template_name = package.template_name or "pipeline/css.html" context = package.extra_context context.update({ 'type': guess_type(path, 'text/css'), 'url': mark_safe(staticfiles_storage.url(path)) }) return render_to_string(template_name, context) def render_individual_css(self, package, paths, **kwargs): tags = [self.render_css(package, path) for path in paths] return '\n'.join(tags) class JavascriptNode(PipelineMixin, template.Node): def __init__(self, name): self.name = name def render(self, context): super(JavascriptNode, self).render(context) package_name = template.Variable(self.name).resolve(context) try: package = self.package_for(package_name, 'js') except PackageNotFound: return '' # fail silently, do not return anything if an invalid group is specified return self.render_compressed(package, 'js') def render_js(self, package, path): template_name = package.template_name or "pipeline/js.html" context = package.extra_context context.update({ 'type': guess_type(path, 'text/javascript'), 'url': mark_safe(staticfiles_storage.url(path)) }) return render_to_string(template_name, context) def render_inline(self, package, js): context = package.extra_context context.update({ 'source': js }) return render_to_string("pipeline/inline_js.html", context) def render_individual_js(self, package, paths, templates=None): tags = [self.render_js(package, js) for js in paths] if templates: tags.append(self.render_inline(package, templates)) return '\n'.join(tags) @register.tag def stylesheet(parser, token): try: tag_name, name = token.split_contents() except ValueError: raise template.TemplateSyntaxError('%r requires exactly one argument: the name of a group in the PIPELINE_CSS setting' % token.split_contents()[0]) return StylesheetNode(name) @register.tag def javascript(parser, token): try: tag_name, name = token.split_contents() except ValueError: raise template.TemplateSyntaxError('%r requires exactly one argument: the name of a group in the PIPELINE_JS setting' % token.split_contents()[0]) return JavascriptNode(name) django-pipeline-1.5.4/pipeline/utils.py0000664000076500000240000000274212566170040020031 0ustar timstaff00000000000000from __future__ import unicode_literals import importlib import mimetypes import posixpath try: from urllib.parse import quote except ImportError: from urllib import quote from django.utils.encoding import smart_text from pipeline.conf import settings def to_class(class_str): if not class_str: return None module_bits = class_str.split('.') module_path, class_name = '.'.join(module_bits[:-1]), module_bits[-1] module = importlib.import_module(module_path) return getattr(module, class_name, None) def filepath_to_uri(path): if path is None: return path return quote(smart_text(path).replace("\\", "/"), safe="/~!*()'#?") def guess_type(path, default=None): for type, ext in settings.PIPELINE_MIMETYPES: mimetypes.add_type(type, ext) mimetype, _ = mimetypes.guess_type(path) if not mimetype: return default return smart_text(mimetype) def relpath(path, start=posixpath.curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") start_list = posixpath.abspath(start).split(posixpath.sep) path_list = posixpath.abspath(path).split(posixpath.sep) # Work out how much of the filepath is shared by start and path. i = len(posixpath.commonprefix([start_list, path_list])) rel_list = [posixpath.pardir] * (len(start_list) - i) + path_list[i:] if not rel_list: return posixpath.curdir return posixpath.join(*rel_list) django-pipeline-1.5.4/PKG-INFO0000664000076500000240000000501512573112042015577 0ustar timstaff00000000000000Metadata-Version: 1.1 Name: django-pipeline Version: 1.5.4 Summary: Pipeline is an asset packaging library for Django. Home-page: https://github.com/cyberdelia/django-pipeline Author: Timothée Peignier Author-email: timothee.peignier@tryphon.org License: MIT Description: Pipeline ======== Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript template support, and optional data-URI image and font embedding. Installation ------------ To install it, simply: :: pip install django-pipeline Documentation ------------- For documentation, usage, and examples, see : http://django-pipeline.readthedocs.org .. :changelog: History ======= 1.5.4 ===== * Stop returning gzipped file when using GZIPMixin. * Fix jinja templates packaging. 1.5.3 ===== * Fix futures import. Thanks to Mathieu Gallet. * Make GZIPMixin returns the gziped file. * Fix import shadowing. Thanks to Christofer Bertonha. * Fix tests settings for Django 1.9. Thanks to Leonardo Orozco. * Improve javascript concatenation. Thanks to Simon Lydell and Alex Gavrișco. * Improve finder logic. Thanks to Nathan Shafer and James Keys. * Documentation fix. Thanks to Stefano Brentegani. 1.5.2 ===== * Use smart_bytes and smart_text appropriately. Thanks to Tadas Dailyda. * Fix outdated logic. Thanks to Tadas Dailyda. 1.5.1 ===== * Prevent collecting all static multiple times per request. Thanks to Allard Stijnman. * Fix encoding issues. Thanks to Leonardo Orozco. * Improve Django 1.8. Thanks to Carl Meyer. 1.5.0 ===== * Add full support for Django 1.8. * Drop support for Django 1.6. * Drop support for Python 2.6. Platform: UNKNOWN Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Utilities django-pipeline-1.5.4/README.rst0000664000076500000240000000065012301051717016171 0ustar timstaff00000000000000Pipeline ======== Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript template support, and optional data-URI image and font embedding. Installation ------------ To install it, simply: :: pip install django-pipeline Documentation ------------- For documentation, usage, and examples, see : http://django-pipeline.readthedocs.org django-pipeline-1.5.4/setup.cfg0000664000076500000240000000012212573112042016315 0ustar timstaff00000000000000[wheel] universal = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 django-pipeline-1.5.4/setup.py0000664000076500000240000000222212573111364016217 0ustar timstaff00000000000000# -*- coding: utf-8 -*- import io from setuptools import setup, find_packages import sys install_requires = [] if (sys.version_info[0], sys.version_info[1]) < (3, 2): install_requires.append('futures>=2.1.3') setup( name='django-pipeline', version='1.5.4', description='Pipeline is an asset packaging library for Django.', long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' + io.open('HISTORY.rst', encoding='utf-8').read(), author='Timothée Peignier', author_email='timothee.peignier@tryphon.org', url='https://github.com/cyberdelia/django-pipeline', license='MIT', packages=find_packages(exclude=['tests', 'tests.tests']), zip_safe=False, install_requires=install_requires, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Utilities', ] ) django-pipeline-1.5.4/tests/0000775000076500000240000000000012573112042015643 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/__init__.py0000664000076500000240000000000012133622152017742 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/0000775000076500000240000000000012573112042017145 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/css/0000775000076500000240000000000012573112042017735 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/css/first.css0000664000076500000240000000003512133622152021574 0ustar timstaff00000000000000.concat { display: none; } django-pipeline-1.5.4/tests/assets/css/nested/0000775000076500000240000000000012573112042021217 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/css/nested/nested.css0000664000076500000240000000463512472436116023234 0ustar timstaff00000000000000.data-url { background-image: url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M11%2C6V5c0-2.762-2.239-5-5-5S1%2C2.238%2C1%2C5v1H0v8h12V6H11z%20M6.5%2C9.847V12h-1V9.847C5.207%2C9.673%2C5%2C9.366%2C5%2C9%20c0-0.553%2C0.448-1%2C1-1s1%2C0.447%2C1%2C1C7%2C9.366%2C6.793%2C9.673%2C6.5%2C9.847z%20M9%2C6H3V5c0-1.657%2C1.343-3%2C3-3s3%2C1.343%2C3%2C3V6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E); } .data-url-quoted { background-image: url('data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M11%2C6V5c0-2.762-2.239-5-5-5S1%2C2.238%2C1%2C5v1H0v8h12V6H11z%20M6.5%2C9.847V12h-1V9.847C5.207%2C9.673%2C5%2C9.366%2C5%2C9%20c0-0.553%2C0.448-1%2C1-1s1%2C0.447%2C1%2C1C7%2C9.366%2C6.793%2C9.673%2C6.5%2C9.847z%20M9%2C6H3V5c0-1.657%2C1.343-3%2C3-3s3%2C1.343%2C3%2C3V6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E'); } django-pipeline-1.5.4/tests/assets/css/second.css0000664000076500000240000000004312133622152021717 0ustar timstaff00000000000000.concatenate { display: block; } django-pipeline-1.5.4/tests/assets/css/unicode.css0000664000076500000240000000007312301051717022075 0ustar timstaff00000000000000.some_class { // Some unicode content: "áéíóú"; } django-pipeline-1.5.4/tests/assets/css/urls.css0000664000076500000240000000201412556040202021430 0ustar timstaff00000000000000@font-face { font-family: 'Pipeline'; src: url('../fonts/pipeline.eot'); src: url('../fonts/pipeline.eot?#iefix') format('embedded-opentype'); src: local('☺'), url('../fonts/pipeline.woff') format('woff'), url('../fonts/pipeline.ttf') format('truetype'), url('../fonts/pipeline.svg#IyfZbseF') format('svg'); font-weight: normal; font-style: normal; } .relative-url { background-image: url(../images/sprite-buttons.png); } .relative-url-querystring { background-image: url(../images/sprite-buttons.png?v=1.0#foo=bar); } .absolute-url { background-image: url(/images/sprite-buttons.png); } .absolute-full-url { background-image: url(http://localhost/images/sprite-buttons.png); } .no-protocol-url { background-image: url(//images/sprite-buttons.png); } .anchor-tag-url { background-image: url(#image-gradient); } @font-face{src:url(../fonts/pipeline.eot);src:url(../fonts/pipeline.eot?#iefix) format('embedded-opentype'),url(../fonts/pipeline.woff) format('woff'),url(../fonts/pipeline.ttf) format('truetype');} django-pipeline-1.5.4/tests/assets/fonts/0000775000076500000240000000000012573112042020276 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/fonts/pipeline.eot0000664000076500000240000000000012133622152022602 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/fonts/pipeline.svg0000664000076500000240000000000012133622152022612 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/fonts/pipeline.ttf0000664000076500000240000000000012133622152022610 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/fonts/pipeline.woff0000664000076500000240000000000012133622152022754 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/images/0000775000076500000240000000000012573112042020412 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/images/arrow.png0000664000076500000240000000015312133622152022251 0ustar timstaff00000000000000PNG  IHDR Ǵ2IDATxڅ 0 BNo!!􎤵w$ F0A"CD ]r +rIENDB`django-pipeline-1.5.4/tests/assets/images/embed/0000775000076500000240000000000012573112042021466 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/images/embed/arrow.png0000664000076500000240000000015312133622152023325 0ustar timstaff00000000000000PNG  IHDR Ǵ2IDATxڅ 0 BNo!!􎤵w$ F0A"CD ]r +rIENDB`django-pipeline-1.5.4/tests/assets/images/sprite-buttons.png0000664000076500000240000000000012133622152024110 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/js/0000775000076500000240000000000012573112042017561 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/js/application.js0000664000076500000240000000005712301051717022424 0ustar timstaff00000000000000function test() { alert('this is a test'); } django-pipeline-1.5.4/tests/assets/js/dummy.coffee0000664000076500000240000000006412133622152022065 0ustar timstaff00000000000000square = (x) -> x * x cube = (x) -> square(x) * x django-pipeline-1.5.4/tests/assets/js/first.js0000664000076500000240000000014212564155665021265 0ustar timstaff00000000000000(function() { window.concat = function() { console.log(arguments); } }()) // No semicolon django-pipeline-1.5.4/tests/assets/js/second.js0000664000076500000240000000012412564155665021411 0ustar timstaff00000000000000(function() { window.cat = function() { console.log("hello world"); } }()); django-pipeline-1.5.4/tests/assets/templates/0000775000076500000240000000000012573112042021143 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/templates/photo/0000775000076500000240000000000012573112042022274 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/templates/photo/detail.jst0000664000076500000240000000016512133622152024262 0ustar timstaff00000000000000
<%= caption %> by <%= author %>
django-pipeline-1.5.4/tests/assets/templates/photo/list.jst0000664000076500000240000000014412133622152023770 0ustar timstaff00000000000000
<%= caption %>
django-pipeline-1.5.4/tests/assets/templates/video/0000775000076500000240000000000012573112042022251 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/assets/templates/video/detail.jst0000664000076500000240000000015212133622152024233 0ustar timstaff00000000000000
django-pipeline-1.5.4/tests/models.py0000664000076500000240000000000012133622152017466 0ustar timstaff00000000000000django-pipeline-1.5.4/tests/settings.py0000664000076500000240000000611012566170040020057 0ustar timstaff00000000000000import os def local_path(path): return os.path.join(os.path.dirname(__file__), path) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'TEST_NAME': ':memory:' } } DEBUG = False SITE_ID = 1 INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.sessions', 'django.contrib.staticfiles', 'django.contrib.auth', 'django.contrib.admin', 'pipeline', 'tests.tests' ] MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware' ) ROOT_URLCONF = 'tests.urls' MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware' ) MEDIA_URL = '/media/' MEDIA_ROOT = local_path('media') STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage' STATIC_ROOT = local_path('static/') STATIC_URL = '/static/' STATICFILES_DIRS = ( ('pipeline', local_path('assets/')), ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'pipeline.finders.PipelineFinder', ) SECRET_KEY = "django-pipeline" TEMPLATE_DIRS = ( local_path('templates'), ) PIPELINE_CSS = { 'screen': { 'source_filenames': ( 'pipeline/css/first.css', 'pipeline/css/second.css', 'pipeline/css/urls.css' ), 'output_filename': 'screen.css' } } PIPELINE_JS = { 'scripts': { 'source_filenames': ( 'pipeline/js/first.js', 'pipeline/js/second.js', 'pipeline/js/application.js', 'pipeline/templates/**/*.jst' ), 'output_filename': 'scripts.js' }, 'scripts_async': { 'source_filenames': ( 'pipeline/js/first.js', 'pipeline/js/second.js', 'pipeline/js/application.js', 'pipeline/templates/**/*.jst' ), 'output_filename': 'scripts_async.js', 'extra_context': { 'async': True, } }, 'scripts_defer': { 'source_filenames': ( 'pipeline/js/first.js', 'pipeline/js/second.js', 'pipeline/js/application.js', 'pipeline/templates/**/*.jst' ), 'output_filename': 'scripts_defer.js', 'extra_context': { 'defer': True, } }, 'scripts_async_defer': { 'source_filenames': ( 'pipeline/js/first.js', 'pipeline/js/second.js', 'pipeline/js/application.js', 'pipeline/templates/**/*.jst' ), 'output_filename': 'scripts_async_defer.js', 'extra_context': { 'async': True, 'defer': True, } } } TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, 'DIRS': TEMPLATE_DIRS, }, { 'BACKEND': 'django.template.backends.jinja2.Jinja2', 'APP_DIRS': True, 'DIRS': TEMPLATE_DIRS, } ]django-pipeline-1.5.4/tests/static/0000775000076500000240000000000012573112042017132 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/0000775000076500000240000000000012573112042020222 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/css/0000775000076500000240000000000012573112042021012 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/css/base.css0000664000076500000240000003334112566170077022460 0ustar timstaff00000000000000/* DJANGO Admin styles */ body { margin: 0; padding: 0; font-size: 12px; font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; color: #333; background: #fff; } /* LINKS */ a:link, a:visited { color: #5b80b2; text-decoration: none; } a:hover { color: #036; } a img { border: none; } a.section:link, a.section:visited { color: #fff; text-decoration: none; } /* GLOBAL DEFAULTS */ p, ol, ul, dl { margin: .2em 0 .8em 0; } p { padding: 0; line-height: 140%; } h1,h2,h3,h4,h5 { font-weight: bold; } h1 { font-size: 18px; color: #666; padding: 0 6px 0 0; margin: 0 0 .2em 0; } h2 { font-size: 16px; margin: 1em 0 .5em 0; } h2.subhead { font-weight: normal; margin-top: 0; } h3 { font-size: 14px; margin: .8em 0 .3em 0; color: #666; font-weight: bold; } h4 { font-size: 12px; margin: 1em 0 .8em 0; padding-bottom: 3px; } h5 { font-size: 10px; margin: 1.5em 0 .5em 0; color: #666; text-transform: uppercase; letter-spacing: 1px; } ul li { list-style-type: square; padding: 1px 0; } ul.plainlist { margin-left: 0 !important; } ul.plainlist li { list-style-type: none; } li ul { margin-bottom: 0; } li, dt, dd { font-size: 11px; line-height: 14px; } dt { font-weight: bold; margin-top: 4px; } dd { margin-left: 0; } form { margin: 0; padding: 0; } fieldset { margin: 0; padding: 0; } blockquote { font-size: 11px; color: #777; margin-left: 2px; padding-left: 10px; border-left: 5px solid #ddd; } code, pre { font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; color: #666; font-size: 11px; } pre.literal-block { margin: 10px; background: #eee; padding: 6px 8px; } code strong { color: #930; } hr { clear: both; color: #eee; background-color: #eee; height: 1px; border: none; margin: 0; padding: 0; font-size: 1px; line-height: 1px; } /* TEXT STYLES & MODIFIERS */ .small { font-size: 11px; } .tiny { font-size: 10px; } p.tiny { margin-top: -2px; } .mini { font-size: 9px; } p.mini { margin-top: -3px; } .help, p.help { font-size: 10px !important; color: #999; } img.help-tooltip { cursor: help; } p img, h1 img, h2 img, h3 img, h4 img, td img { vertical-align: middle; } .quiet, a.quiet:link, a.quiet:visited { color: #999 !important; font-weight: normal !important; } .quiet strong { font-weight: bold !important; } .float-right { float: right; } .float-left { float: left; } .clear { clear: both; } .align-left { text-align: left; } .align-right { text-align: right; } .example { margin: 10px 0; padding: 5px 10px; background: #efefef; } .nowrap { white-space: nowrap; } /* TABLES */ table { border-collapse: collapse; border-color: #ccc; } td, th { font-size: 11px; line-height: 13px; border-bottom: 1px solid #eee; vertical-align: top; padding: 5px; font-family: "Lucida Grande", Verdana, Arial, sans-serif; } th { text-align: left; font-size: 12px; font-weight: bold; } thead th, tfoot td { color: #666; padding: 2px 5px; font-size: 11px; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; border-left: 1px solid #ddd; border-bottom: 1px solid #ddd; } tfoot td { border-bottom: none; border-top: 1px solid #ddd; } thead th:first-child, tfoot td:first-child { border-left: none !important; } thead th.optional { font-weight: normal !important; } fieldset table { border-right: 1px solid #eee; } tr.row-label td { font-size: 9px; padding-top: 2px; padding-bottom: 0; border-bottom: none; color: #666; margin-top: -1px; } tr.alt { background: #f6f6f6; } .row1 { background: #EDF3FE; } .row2 { background: #fff; } /* SORTABLE TABLES */ thead th { padding: 2px 5px; line-height: normal; } thead th a:link, thead th a:visited { color: #666; } thead th.sorted { background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x; } thead th.sorted .text { padding-right: 42px; } table thead th .text span { padding: 2px 5px; display:block; } table thead th .text a { display: block; cursor: pointer; padding: 2px 5px; } table thead th.sortable:hover { background: #fff url(../img/nav-bg-reverse.gif) 0 -5px repeat-x; } thead th.sorted a.sortremove { visibility: hidden; } table thead th.sorted:hover a.sortremove { visibility: visible; } table thead th.sorted .sortoptions { display: block; padding: 4px 5px 0 5px; float: right; text-align: right; } table thead th.sorted .sortpriority { font-size: .8em; min-width: 12px; text-align: center; vertical-align: top; } table thead th.sorted .sortoptions a { width: 14px; height: 12px; display: inline-block; } table thead th.sorted .sortoptions a.sortremove { background: url(../img/sorting-icons.gif) -4px -5px no-repeat; } table thead th.sorted .sortoptions a.sortremove:hover { background: url(../img/sorting-icons.gif) -4px -27px no-repeat; } table thead th.sorted .sortoptions a.ascending { background: url(../img/sorting-icons.gif) -5px -50px no-repeat; } table thead th.sorted .sortoptions a.ascending:hover { background: url(../img/sorting-icons.gif) -5px -72px no-repeat; } table thead th.sorted .sortoptions a.descending { background: url(../img/sorting-icons.gif) -5px -94px no-repeat; } table thead th.sorted .sortoptions a.descending:hover { background: url(../img/sorting-icons.gif) -5px -115px no-repeat; } /* ORDERABLE TABLES */ table.orderable tbody tr td:hover { cursor: move; } table.orderable tbody tr td:first-child { padding-left: 14px; background-image: url(../img/nav-bg-grabber.gif); background-repeat: repeat-y; } table.orderable-initalized .order-cell, body>tr>td.order-cell { display: none; } /* FORM DEFAULTS */ input, textarea, select, .form-row p, form .button { margin: 2px 0; padding: 2px 3px; vertical-align: middle; font-family: "Lucida Grande", Verdana, Arial, sans-serif; font-weight: normal; font-size: 11px; } textarea { vertical-align: top !important; } input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], textarea, select, .vTextField { border: 1px solid #ccc; } /* FORM BUTTONS */ .button, input[type=submit], input[type=button], .submit-row input, a.button { background: #fff url(../img/nav-bg.gif) bottom repeat-x; padding: 3px 5px; color: black; border: 1px solid #bbb; border-color: #ddd #aaa #aaa #ddd; } a.button { padding: 4px 5px; } .button:active, input[type=submit]:active, input[type=button]:active { background-image: url(../img/nav-bg-reverse.gif); background-position: top; } .button[disabled], input[type=submit][disabled], input[type=button][disabled] { background-image: url(../img/nav-bg.gif); background-position: bottom; opacity: 0.4; } .button.default, input[type=submit].default, .submit-row input.default { border: 2px solid #5b80b2; background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x; font-weight: bold; color: #fff; float: right; } .button.default:active, input[type=submit].default:active { background-image: url(../img/default-bg-reverse.gif); background-position: top; } .button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default { background-image: url(../img/default-bg.gif); background-position: bottom; opacity: 0.4; } /* MODULES */ .module { border: 1px solid #ccc; margin-bottom: 5px; background: #fff; } .module p, .module ul, .module h3, .module h4, .module dl, .module pre { padding-left: 10px; padding-right: 10px; } .module blockquote { margin-left: 12px; } .module ul, .module ol { margin-left: 1.5em; } .module h3 { margin-top: .6em; } .module h2, .module caption, .inline-group h2 { margin: 0; padding: 2px 5px 3px 5px; font-size: 11px; text-align: left; font-weight: bold; background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x; color: #fff; } .module table { border-collapse: collapse; } /* MESSAGES & ERRORS */ ul.messagelist { padding: 0; margin: 0; } ul.messagelist li { font-size: 12px; font-weight: bold; display: block; padding: 5px 5px 4px 25px; margin: 0 0 3px 0; border-bottom: 1px solid #ddd; color: #666; background: #dfd url(../img/icon_success.gif) 5px .3em no-repeat; } ul.messagelist li.warning { background: #ffc url(../img/icon_alert.gif) 5px .3em no-repeat; } ul.messagelist li.error { background: #ffefef url(../img/icon_error.gif) 5px .3em no-repeat; } .errornote { font-size: 12px !important; font-weight: bold; display: block; padding: 5px 5px 4px 25px; margin: 0 0 3px 0; border: 1px solid #c22; color: #c11; background: #ffefef url(../img/icon_error.gif) 5px .38em no-repeat; } .errornote, ul.errorlist { border-radius: 1px; } ul.errorlist { margin: 0 0 4px !important; padding: 0 !important; color: #fff; background: #c11; } ul.errorlist li { font-size: 12px !important; display: block; padding: 5px 5px 4px 7px; margin: 3px 0 0 0; } ul.errorlist li:first-child { margin-top: 0; } ul.errorlist li a { color: #fff; text-decoration: underline; } td ul.errorlist { margin: 0 !important; padding: 0 !important; } td ul.errorlist li { margin: 0 !important; } .errors, .form-row.errors { background: #ffefef; } .form-row.errors { border: 1px solid #c22; margin: -1px; } .errors input, .errors select, .errors textarea { border: 1px solid #c11; } div.system-message { background: #ffc; margin: 10px; padding: 6px 8px; font-size: .8em; } div.system-message p.system-message-title { padding: 4px 5px 4px 25px; margin: 0; color: #c11; background: #ffefef url(../img/icon_error.gif) 5px .3em no-repeat; } .description { font-size: 12px; padding: 5px 0 0 12px; } /* BREADCRUMBS */ div.breadcrumbs { background: #fff url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; padding: 2px 8px 3px 8px; font-size: 11px; color: #999; border-top: 1px solid #fff; border-bottom: 1px solid #ddd; text-align: left; } /* ACTION ICONS */ .addlink { padding-left: 12px; background: url(../img/icon_addlink.gif) 0 .2em no-repeat; } .changelink, .inlinechangelink { padding-left: 12px; background: url(../img/icon_changelink.gif) 0 .2em no-repeat; } .deletelink { padding-left: 12px; background: url(../img/icon_deletelink.gif) 0 .25em no-repeat; } a.deletelink:link, a.deletelink:visited { color: #CC3434; } a.deletelink:hover { color: #993333; } /* OBJECT TOOLS */ .object-tools { font-size: 10px; font-weight: bold; font-family: Arial,Helvetica,sans-serif; padding-left: 0; float: right; position: relative; margin-top: -2.4em; margin-bottom: -2em; } .form-row .object-tools { margin-top: 5px; margin-bottom: 5px; float: none; height: 2em; padding-left: 3.5em; } .object-tools li { display: block; float: left; margin-left: 5px; height: 16px; } .object-tools a { border-radius: 15px; } .object-tools a:link, .object-tools a:visited { display: block; float: left; color: #fff; padding: .2em 10px; background: #999; } .object-tools a:hover, .object-tools li:hover a { background-color: #5b80b2; } .object-tools a.viewsitelink, .object-tools a.golink { background: #999 url(../img/tooltag-arrowright.png) 95% center no-repeat; padding-right: 26px; } .object-tools a.addlink { background: #999 url(../img/tooltag-add.png) 95% center no-repeat; padding-right: 26px; } /* OBJECT HISTORY */ table#change-history { width: 100%; } table#change-history tbody th { width: 16em; } /* PAGE STRUCTURE */ #container { position: relative; width: 100%; min-width: 760px; padding: 0; } #content { margin: 10px 15px; } #content-main { float: left; width: 100%; } #content-related { float: right; width: 18em; position: relative; margin-right: -19em; } #footer { clear: both; padding: 10px; } /* COLUMN TYPES */ .colMS { margin-right: 20em !important; } .colSM { margin-left: 20em !important; } .colSM #content-related { float: left; margin-right: 0; margin-left: -19em; } .colSM #content-main { float: right; } .popup .colM { width: 95%; } .subcol { float: left; width: 46%; margin-right: 15px; } .dashboard #content { width: 500px; } /* HEADER */ #header { width: 100%; background: #417690; color: #ffc; overflow: hidden; } #header a:link, #header a:visited { color: #fff; } #header a:hover { text-decoration: underline; } #branding { float: left; } #branding h1 { padding: 0 10px; font-size: 18px; margin: 8px 0; font-weight: normal; } #branding h1, #branding h1 a:link, #branding h1 a:visited { color: #f4f379; } #branding h2 { padding: 0 10px; font-size: 14px; margin: -8px 0 8px 0; font-weight: normal; color: #ffc; } #branding a:hover { text-decoration: none; } #user-tools { float: right; padding: 1.2em 10px; font-size: 11px; text-align: right; } /* SIDEBAR */ #content-related h3 { font-size: 12px; color: #666; margin-bottom: 3px; } #content-related h4 { font-size: 11px; } #content-related .module h2 { background: #eee url(../img/nav-bg.gif) bottom left repeat-x; color: #666; } django-pipeline-1.5.4/tests/static/admin/css/changelists.css0000664000076500000240000001220612566170077024047 0ustar timstaff00000000000000/* CHANGELISTS */ #changelist { position: relative; width: 100%; } #changelist table { width: 100%; } .change-list .hiddenfields { display:none; } .change-list .filtered table { border-right: 1px solid #ddd; } .change-list .filtered { min-height: 400px; } .change-list .filtered { background: white url(../img/changelist-bg.gif) top right repeat-y !important; } .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { margin-right: 160px !important; width: auto !important; } .change-list .filtered table tbody th { padding-right: 1em; } #changelist-form .results { overflow-x: auto; } #changelist .toplinks { border-bottom: 1px solid #ccc !important; } #changelist .paginator { color: #666; border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: white url(../img/nav-bg.gif) 0 180% repeat-x; overflow: hidden; } .change-list .filtered .paginator { border-right: 1px solid #ddd; } /* CHANGELIST TABLES */ #changelist table thead th { padding: 0; white-space: nowrap; vertical-align: middle; } #changelist table thead th.action-checkbox-column { width: 1.5em; text-align: center; } #changelist table tbody td, #changelist table tbody th { border-left: 1px solid #ddd; } #changelist table tbody td:first-child, #changelist table tbody th:first-child { border-left: 0; border-right: 1px solid #ddd; } #changelist table tbody td.action-checkbox { text-align:center; } #changelist table tfoot { color: #666; } /* TOOLBAR */ #changelist #toolbar { padding: 3px; border-bottom: 1px solid #ddd; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; color: #666; } #changelist #toolbar form input { font-size: 11px; padding: 1px 2px; } #changelist #toolbar form #searchbar { padding: 2px; } #changelist #changelist-search img { vertical-align: middle; } /* FILTER COLUMN */ #changelist-filter { position: absolute; top: 0; right: 0; z-index: 1000; width: 160px; border-left: 1px solid #ddd; background: #efefef; margin: 0; } #changelist-filter h2 { font-size: 11px; padding: 2px 5px; border-bottom: 1px solid #ddd; } #changelist-filter h3 { font-size: 12px; margin-bottom: 0; } #changelist-filter ul { padding-left: 0; margin-left: 10px; } #changelist-filter li { list-style-type: none; margin-left: 0; padding-left: 0; } #changelist-filter a { color: #999; } #changelist-filter a:hover { color: #036; } #changelist-filter li.selected { border-left: 5px solid #ccc; padding-left: 5px; margin-left: -10px; } #changelist-filter li.selected a { color: #5b80b2 !important; } /* DATE DRILLDOWN */ .change-list ul.toplinks { display: block; background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; border-top: 1px solid white; float: left; padding: 0 !important; margin: 0 !important; width: 100%; } .change-list ul.toplinks li { padding: 3px 6px; font-weight: bold; list-style-type: none; display: inline-block; } .change-list ul.toplinks .date-back a { color: #999; } .change-list ul.toplinks .date-back a:hover { color: #036; } /* PAGINATOR */ .paginator { font-size: 11px; padding-top: 10px; padding-bottom: 10px; line-height: 22px; margin: 0; border-top: 1px solid #ddd; } .paginator a:link, .paginator a:visited { padding: 2px 6px; border: solid 1px #ccc; background: white; text-decoration: none; } .paginator a.showall { padding: 0 !important; border: none !important; } .paginator a.showall:hover { color: #036 !important; background: transparent !important; } .paginator .end { border-width: 2px !important; margin-right: 6px; } .paginator .this-page { padding: 2px 6px; font-weight: bold; font-size: 13px; vertical-align: top; } .paginator a:hover { color: white; background: #5b80b2; border-color: #036; } /* ACTIONS */ .filtered .actions { margin-right: 160px !important; border-right: 1px solid #ddd; } #changelist table input { margin: 0; } #changelist table tbody tr.selected { background-color: #FFFFCC; } #changelist .actions { color: #999; padding: 3px; border-top: 1px solid #fff; border-bottom: 1px solid #ddd; background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; } #changelist .actions.selected { background: #fffccf; border-top: 1px solid #fffee8; border-bottom: 1px solid #edecd6; } #changelist .actions span.all, #changelist .actions span.action-counter, #changelist .actions span.clear, #changelist .actions span.question { font-size: 11px; margin: 0 0.5em; display: none; } #changelist .actions:last-child { border-bottom: none; } #changelist .actions select { border: 1px solid #aaa; margin-left: 0.5em; padding: 1px 2px; } #changelist .actions label { font-size: 11px; margin-left: 0.5em; } #changelist #action-toggle { display: none; } #changelist .actions .button { font-size: 11px; padding: 1px 2px; } django-pipeline-1.5.4/tests/static/admin/css/dashboard.css0000664000076500000240000000066212566170077023475 0ustar timstaff00000000000000/* DASHBOARD */ .dashboard .module table th { width: 100%; } .dashboard .module table td { white-space: nowrap; } .dashboard .module table td a { display: block; padding-right: .6em; } /* RECENT ACTIONS MODULE */ .module ul.actionlist { margin-left: 0; } ul.actionlist li { list-style-type: none; } ul.actionlist li { overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; } django-pipeline-1.5.4/tests/static/admin/css/forms.css0000664000076500000240000001421312566170077022671 0ustar timstaff00000000000000@import url('widgets.css'); /* FORM ROWS */ .form-row { overflow: hidden; padding: 8px 12px; font-size: 11px; border-bottom: 1px solid #eee; } .form-row img, .form-row input { vertical-align: middle; } form .form-row p { padding-left: 0; font-size: 11px; } .hidden { display: none; } /* FORM LABELS */ form h4 { margin: 0 !important; padding: 0 !important; border: none !important; } label { font-weight: normal !important; color: #666; font-size: 12px; } .required label, label.required { font-weight: bold !important; color: #333 !important; } /* RADIO BUTTONS */ form ul.radiolist li { list-style-type: none; } form ul.radiolist label { float: none; display: inline; } form ul.inline { margin-left: 0; padding: 0; } form ul.inline li { float: left; padding-right: 7px; } /* ALIGNED FIELDSETS */ .aligned label { display: block; padding: 3px 10px 0 0; float: left; width: 8em; word-wrap: break-word; } .aligned ul label { display: inline; float: none; width: auto; } .colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { width: 350px; } form .aligned p, form .aligned ul { margin-left: 7em; padding-left: 30px; } form .aligned table p { margin-left: 0; padding-left: 0; } form .aligned p.help { clear: left; padding-left: 38px; } .aligned .vCheckboxLabel { float: none !important; display: inline; padding-left: 4px; } .colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { width: 610px; } .checkbox-row p.help { margin-left: 0; padding-left: 0 !important; } fieldset .field-box { float: left; margin-right: 20px; } /* WIDE FIELDSETS */ .wide label { width: 15em !important; } form .wide p { margin-left: 15em; } form .wide p.help { padding-left: 38px; } .colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField { width: 450px; } /* COLLAPSED FIELDSETS */ fieldset.collapsed * { display: none; } fieldset.collapsed h2, fieldset.collapsed { display: block !important; } fieldset.collapsed h2 { background-image: url(../img/nav-bg.gif); background-position: bottom left; color: #999; } fieldset.collapsed .collapse-toggle { background: transparent; display: inline !important; } /* MONOSPACE TEXTAREAS */ fieldset.monospace textarea { font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; } /* SUBMIT ROW */ .submit-row { padding: 5px 7px; text-align: right; background: white url(../img/nav-bg.gif) 0 100% repeat-x; border: 1px solid #ccc; margin: 5px 0; overflow: hidden; } body.popup .submit-row { overflow: auto; } .submit-row input { margin: 0 0 0 5px; } .submit-row p { margin: 0.3em; } .submit-row p.deletelink-box { float: left; } .submit-row .deletelink { background: url(../img/icon_deletelink.gif) 0 50% no-repeat; padding-left: 14px; } /* CUSTOM FORM FIELDS */ .vSelectMultipleField { vertical-align: top !important; } .vCheckboxField { border: none; } .vDateField, .vTimeField { margin-right: 2px; } .vDateField { min-width: 6.85em; } .vTimeField { min-width: 4.7em; } .vURLField { width: 30em; } .vLargeTextField, .vXMLLargeTextField { width: 48em; } .flatpages-flatpage #id_content { height: 40.2em; } .module table .vPositiveSmallIntegerField { width: 2.2em; } .vTextField { width: 20em; } .vIntegerField { width: 5em; } .vBigIntegerField { width: 10em; } .vForeignKeyRawIdAdminField { width: 5em; } /* INLINES */ .inline-group { padding: 0; border: 1px solid #ccc; margin: 10px 0; } .inline-group .aligned label { width: 8em; } .inline-related { position: relative; } .inline-related h3 { margin: 0; color: #666; padding: 3px 5px; font-size: 11px; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; border-bottom: 1px solid #ddd; } .inline-related h3 span.delete { float: right; } .inline-related h3 span.delete label { margin-left: 2px; font-size: 11px; } .inline-related fieldset { margin: 0; background: #fff; border: none; width: 100%; } .inline-related fieldset.module h3 { margin: 0; padding: 2px 5px 3px 5px; font-size: 11px; text-align: left; font-weight: bold; background: #bcd; color: #fff; } .inline-group .tabular fieldset.module { border: none; border-bottom: 1px solid #ddd; } .inline-related.tabular fieldset.module table { width: 100%; } .last-related fieldset { border: none; } .inline-group .tabular tr.has_original td { padding-top: 2em; } .inline-group .tabular tr td.original { padding: 2px 0 0 0; width: 0; _position: relative; } .inline-group .tabular th.original { width: 0px; padding: 0; } .inline-group .tabular td.original p { position: absolute; left: 0; height: 1.1em; padding: 2px 7px; overflow: hidden; font-size: 9px; font-weight: bold; color: #666; _width: 700px; } .inline-group ul.tools { padding: 0; margin: 0; list-style: none; } .inline-group ul.tools li { display: inline; padding: 0 5px; } .inline-group div.add-row, .inline-group .tabular tr.add-row td { color: #666; padding: 3px 5px; border-bottom: 1px solid #ddd; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; } .inline-group .tabular tr.add-row td { padding: 4px 5px 3px; border-bottom: none; } .inline-group ul.tools a.add, .inline-group div.add-row a, .inline-group .tabular tr.add-row td a { background: url(../img/icon_addlink.gif) 0 50% no-repeat; padding-left: 14px; font-size: 11px; outline: 0; /* Remove dotted border around link */ } .empty-form { display: none; } /* RELATED FIELD ADD ONE / LOOKUP */ .add-another, .related-lookup { margin-left: 5px; display: inline-block; } .add-another { width: 10px; height: 10px; background-image: url(../img/icon_addlink.gif); } .related-lookup { width: 16px; height: 16px; background-image: url(../img/selector-search.gif); } django-pipeline-1.5.4/tests/static/admin/css/ie.css0000664000076500000240000000205112566170077022135 0ustar timstaff00000000000000/* IE 6 & 7 */ /* Proper fixed width for dashboard in IE6 */ .dashboard #content { *width: 768px; } .dashboard #content-main { *width: 535px; } /* IE 6 ONLY */ /* Keep header from flowing off the page */ #container { _position: static; } /* Put the right sidebars back on the page */ .colMS #content-related { _margin-right: 0; _margin-left: 10px; _position: static; } /* Put the left sidebars back on the page */ .colSM #content-related { _margin-right: 10px; _margin-left: -115px; _position: static; } .form-row { _height: 1%; } /* Fix right margin for changelist filters in IE6 */ #changelist-filter ul { _margin-right: -10px; } /* IE ignores min-height, but treats height as if it were min-height */ .change-list .filtered { _height: 400px; } /* IE doesn't know alpha transparency in PNGs */ .inline-deletelink { background: transparent url(../img/inline-delete-8bit.png) no-repeat; } /* IE7 doesn't support inline-block */ .change-list ul.toplinks li { zoom: 1; *display: inline; } django-pipeline-1.5.4/tests/static/admin/css/login.css0000664000076500000240000000165412566170077022660 0ustar timstaff00000000000000/* LOGIN FORM */ body.login { background: #eee; } .login #container { background: white; border: 1px solid #ccc; width: 28em; min-width: 300px; margin-left: auto; margin-right: auto; margin-top: 100px; } .login #content-main { width: 100%; } .login form { margin-top: 1em; } .login .form-row { padding: 4px 0; float: left; width: 100%; } .login .form-row label { padding-right: 0.5em; line-height: 2em; font-size: 1em; clear: both; color: #333; } .login .form-row #id_username, .login .form-row #id_password { clear: both; padding: 6px; width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .login span.help { font-size: 10px; display: block; } .login .submit-row { clear: both; padding: 1em 0 0 9.4em; } .login .password-reset-link { text-align: center; } django-pipeline-1.5.4/tests/static/admin/css/rtl.css0000664000076500000240000000736012566170077022351 0ustar timstaff00000000000000body { direction: rtl; } /* LOGIN */ .login .form-row { float: right; } .login .form-row label { float: right; padding-left: 0.5em; padding-right: 0; text-align: left; } .login .submit-row { clear: both; padding: 1em 9.4em 0 0; } /* GLOBAL */ th { text-align: right; } .module h2, .module caption { text-align: right; } .addlink, .changelink { padding-left: 0px; padding-right: 12px; background-position: 100% 0.2em; } .deletelink { padding-left: 0px; padding-right: 12px; background-position: 100% 0.25em; } .object-tools { float: left; } thead th:first-child, tfoot td:first-child { border-left: 1px solid #ddd !important; } /* LAYOUT */ #user-tools { right: auto; left: 0; text-align: left; } div.breadcrumbs { text-align: right; } #content-main { float: right; } #content-related { float: left; margin-left: -19em; margin-right: auto; } .colMS { margin-left: 20em !important; margin-right: 10px !important; } /* SORTABLE TABLES */ table thead th.sorted .sortoptions { float: left; } thead th.sorted .text { padding-right: 0; padding-left: 42px; } /* dashboard styles */ .dashboard .module table td a { padding-left: .6em; padding-right: 12px; } /* changelists styles */ .change-list .filtered { background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important; } .change-list .filtered table { border-left: 1px solid #ddd; border-right: 0px none; } #changelist-filter { right: auto; left: 0; border-left: 0px none; border-right: 1px solid #ddd; } .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { margin-right: 0px !important; margin-left: 160px !important; } #changelist-filter li.selected { border-left: 0px none; padding-left: 0px; margin-left: 0; border-right: 5px solid #ccc; padding-right: 5px; margin-right: -10px; } .filtered .actions { border-left:1px solid #DDDDDD; margin-left:160px !important; border-right: 0 none; margin-right:0 !important; } #changelist table tbody td:first-child, #changelist table tbody th:first-child { border-right: 0; border-left: 1px solid #ddd; } /* FORMS */ .aligned label { padding: 0 0 3px 1em; float: right; } .submit-row { text-align: left } .submit-row p.deletelink-box { float: right; } .submit-row .deletelink { background: url(../img/icon_deletelink.gif) 0 50% no-repeat; padding-right: 14px; } .vDateField, .vTimeField { margin-left: 2px; } form ul.inline li { float: right; padding-right: 0; padding-left: 7px; } input[type=submit].default, .submit-row input.default { float: left; } fieldset .field-box { float: right; margin-left: 20px; margin-right: 0; } .errorlist li { background-position: 100% .3em; padding: 4px 25px 4px 5px; } .errornote { background-position: 100% .3em; padding: 4px 25px 4px 5px; } /* WIDGETS */ .calendarnav-previous { top: 0; left: auto; right: 0; } .calendarnav-next { top: 0; right: auto; left: 0; } .calendar caption, .calendarbox h2 { text-align: center; } .selector { float: right; } .selector .selector-filter { text-align: right; } .inline-deletelink { float: left; } /* MISC */ .inline-related h2, .inline-group h2 { text-align: right } .inline-related h3 span.delete { padding-right: 20px; padding-left: inherit; left: 10px; right: inherit; float:left; } .inline-related h3 span.delete label { margin-left: inherit; margin-right: 2px; } /* IE7 specific bug fixes */ div.colM { position: relative; } .submit-row input { float: left; } django-pipeline-1.5.4/tests/static/admin/css/widgets.css0000664000076500000240000002453612566170077023222 0ustar timstaff00000000000000/* SELECTOR (FILTER INTERFACE) */ .selector { width: 840px; float: left; } .selector select { width: 400px; height: 17.2em; } .selector-available, .selector-chosen { float: left; width: 400px; text-align: center; margin-bottom: 5px; } .selector-chosen select { border-top: none; } .selector-available h2, .selector-chosen h2 { border: 1px solid #ccc; } .selector .selector-available h2 { background: white url(../img/nav-bg.gif) bottom left repeat-x; color: #666; } .selector .selector-filter { background: white; border: 1px solid #ccc; border-width: 0 1px; padding: 3px; color: #999; font-size: 10px; margin: 0; text-align: left; } .selector .selector-filter label, .inline-group .aligned .selector .selector-filter label { width: 16px; padding: 2px; } .selector .selector-available input { width: 360px; } .selector ul.selector-chooser { float: left; width: 22px; background-color: #eee; border-radius: 10px; margin: 10em 5px 0 5px; padding: 0; } .selector-chooser li { margin: 0; padding: 3px; list-style-type: none; } .selector select { margin-bottom: 10px; margin-top: 0; } .selector-add, .selector-remove { width: 16px; height: 16px; display: block; text-indent: -3000px; overflow: hidden; } .selector-add { background: url(../img/selector-icons.gif) 0 -161px no-repeat; cursor: default; margin-bottom: 2px; } .active.selector-add { background: url(../img/selector-icons.gif) 0 -187px no-repeat; cursor: pointer; } .selector-remove { background: url(../img/selector-icons.gif) 0 -109px no-repeat; cursor: default; } .active.selector-remove { background: url(../img/selector-icons.gif) 0 -135px no-repeat; cursor: pointer; } a.selector-chooseall, a.selector-clearall { display: inline-block; text-align: left; margin-left: auto; margin-right: auto; font-weight: bold; color: #666; } a.selector-chooseall { padding: 3px 18px 3px 0; } a.selector-clearall { padding: 3px 0 3px 18px; } a.active.selector-chooseall:hover, a.active.selector-clearall:hover { color: #036; } a.selector-chooseall { background: url(../img/selector-icons.gif) right -263px no-repeat; cursor: default; } a.active.selector-chooseall { background: url(../img/selector-icons.gif) right -289px no-repeat; cursor: pointer; } a.selector-clearall { background: url(../img/selector-icons.gif) left -211px no-repeat; cursor: default; } a.active.selector-clearall { background: url(../img/selector-icons.gif) left -237px no-repeat; cursor: pointer; } /* STACKED SELECTORS */ .stacked { float: left; width: 500px; } .stacked select { width: 480px; height: 10.1em; } .stacked .selector-available, .stacked .selector-chosen { width: 480px; } .stacked .selector-available { margin-bottom: 0; } .stacked .selector-available input { width: 442px; } .stacked ul.selector-chooser { height: 22px; width: 50px; margin: 0 0 3px 40%; background-color: #eee; border-radius: 10px; } .stacked .selector-chooser li { float: left; padding: 3px 3px 3px 5px; } .stacked .selector-chooseall, .stacked .selector-clearall { display: none; } .stacked .selector-add { background: url(../img/selector-icons.gif) 0 -57px no-repeat; cursor: default; } .stacked .active.selector-add { background: url(../img/selector-icons.gif) 0 -83px no-repeat; cursor: pointer; } .stacked .selector-remove { background: url(../img/selector-icons.gif) 0 -5px no-repeat; cursor: default; } .stacked .active.selector-remove { background: url(../img/selector-icons.gif) 0 -31px no-repeat; cursor: pointer; } /* DATE AND TIME */ p.datetime { line-height: 20px; margin: 0; padding: 0; color: #666; font-size: 11px; font-weight: bold; } .datetime span { font-size: 11px; color: #ccc; font-weight: normal; white-space: nowrap; } table p.datetime { font-size: 10px; margin-left: 0; padding-left: 0; } /* URL */ p.url { line-height: 20px; margin: 0; padding: 0; color: #666; font-size: 11px; font-weight: bold; } .url a { font-weight: normal; } /* FILE UPLOADS */ p.file-upload { line-height: 20px; margin: 0; padding: 0; color: #666; font-size: 11px; font-weight: bold; } .file-upload a { font-weight: normal; } .file-upload .deletelink { margin-left: 5px; } span.clearable-file-input label { color: #333; font-size: 11px; display: inline; float: none; } /* CALENDARS & CLOCKS */ .calendarbox, .clockbox { margin: 5px auto; font-size: 11px; width: 16em; text-align: center; background: white; position: relative; } .clockbox { width: auto; } .calendar { margin: 0; padding: 0; } .calendar table { margin: 0; padding: 0; border-collapse: collapse; background: white; width: 100%; } .calendar caption, .calendarbox h2 { margin: 0; font-size: 11px; text-align: center; border-top: none; } .calendar th { font-size: 10px; color: #666; padding: 2px 3px; text-align: center; background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; border-bottom: 1px solid #ddd; } .calendar td { font-size: 11px; text-align: center; padding: 0; border-top: 1px solid #eee; border-bottom: none; } .calendar td.selected a { background: #C9DBED; } .calendar td.nonday { background: #efefef; } .calendar td.today a { background: #ffc; } .calendar td a, .timelist a { display: block; font-weight: bold; padding: 4px; text-decoration: none; color: #444; } .calendar td a:hover, .timelist a:hover { background: #5b80b2; color: white; } .calendar td a:active, .timelist a:active { background: #036; color: white; } .calendarnav { font-size: 10px; text-align: center; color: #ccc; margin: 0; padding: 1px 3px; } .calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { color: #999; } .calendar-shortcuts { background: white; font-size: 10px; line-height: 11px; border-top: 1px solid #eee; padding: 3px 0 4px; color: #ccc; } .calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { display: block; position: absolute; font-weight: bold; font-size: 12px; background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x; padding: 1px 4px 2px 4px; color: white; } .calendarnav-previous:hover, .calendarnav-next:hover { background: #036; } .calendarnav-previous { top: 0; left: 0; } .calendarnav-next { top: 0; right: 0; } .calendar-cancel { margin: 0 !important; padding: 0 !important; font-size: 10px; background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; border-top: 1px solid #ddd; } .calendar-cancel:hover { background: #e1e1e1 url(../img/nav-bg-reverse.gif) 0 50% repeat-x; } .calendar-cancel a { color: black; display: block; } ul.timelist, .timelist li { list-style-type: none; margin: 0; padding: 0; } .timelist a { padding: 2px; } /* INLINE ORDERER */ ul.orderer { position: relative; padding: 0 !important; margin: 0 !important; list-style-type: none; } ul.orderer li { list-style-type: none; display: block; padding: 0; margin: 0; border: 1px solid #bbb; border-width: 0 1px 1px 0; white-space: nowrap; overflow: hidden; background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y; } ul.orderer li:hover { cursor: move; background-color: #ddd; } ul.orderer li a.selector { margin-left: 12px; overflow: hidden; width: 83%; font-size: 10px !important; padding: 0.6em 0; } ul.orderer li a:link, ul.orderer li a:visited { color: #333; } ul.orderer li .inline-deletelink { position: absolute; right: 4px; margin-top: 0.6em; } ul.orderer li.selected { background-color: #f8f8f8; border-right-color: #f8f8f8; } ul.orderer li.deleted { background: #bbb url(../img/deleted-overlay.gif); } ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { color: #888; } ul.orderer li.deleted .inline-deletelink { background-image: url(../img/inline-restore.png); } ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { cursor: default; } /* EDIT INLINE */ .inline-deletelink { float: right; text-indent: -9999px; background: transparent url(../img/inline-delete.png) no-repeat; width: 15px; height: 15px; border: 0px none; outline: 0; /* Remove dotted border around link */ } .inline-deletelink:hover { background-position: -15px 0; cursor: pointer; } .editinline button.addlink { border: 0px none; color: #5b80b2; font-size: 100%; cursor: pointer; } .editinline button.addlink:hover { color: #036; cursor: pointer; } .editinline table .help { text-align: right; float: right; padding-left: 2em; } .editinline tfoot .addlink { white-space: nowrap; } .editinline table thead th:last-child { border-left: none; } .editinline tr.deleted { background: #ddd url(../img/deleted-overlay.gif); } .editinline tr.deleted .inline-deletelink { background-image: url(../img/inline-restore.png); } .editinline tr.deleted td:hover { cursor: default; } .editinline tr.deleted td:first-child { background-image: none !important; } /* EDIT INLINE - STACKED */ .editinline-stacked { min-width: 758px; } .editinline-stacked .inline-object { margin-left: 210px; background: white; } .editinline-stacked .inline-source { float: left; width: 200px; background: #f8f8f8; } .editinline-stacked .inline-splitter { float: left; width: 9px; background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat; border-right: 1px solid #ccc; } .editinline-stacked .controls { clear: both; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; padding: 3px 4px; font-size: 11px; border-top: 1px solid #ddd; } /* RELATED WIDGET WRAPPER */ .related-widget-wrapper { float: left; /* display properly in form rows with multiple fields */ overflow: hidden; /* clear floated contents */ } .related-widget-wrapper-link { opacity: 0.3; } .related-widget-wrapper-link:link { opacity: 1; } django-pipeline-1.5.4/tests/static/admin/img/0000775000076500000240000000000012573112042020776 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/img/changelist-bg.gif0000664000076500000240000000006212566170077024210 0ustar timstaff00000000000000GIF87a, Zf޼;django-pipeline-1.5.4/tests/static/admin/img/changelist-bg_rtl.gif0000664000076500000240000000011312566170077025066 0ustar timstaff00000000000000GIF89a!Created with The GIMP,`޼;django-pipeline-1.5.4/tests/static/admin/img/default-bg-reverse.gif0000664000076500000240000000150312566170077025165 0ustar timstaff00000000000000GIF87a㏰сʻ刪~ȃˀɡۍТ۸{ƈؚ̜͆{NJϟ٤ܮ℧˟ڶݧ޲䔴ԩ߶ɜ|Ȯ畴ԩߗ~Ȯᒲӫ|ȌДԱ㋬Η|Ǻ痶֑ӧފ}ǒҗդ܂ʬޚֻ匮Ы㙸֧ݻ}ǬႦʳᕳԌϚֆ̀ɒҪ߷ڐёҁʏѴ噸ם؜م̪̅߆ͺ華Ҹݩ˳査ٶ冩{Ʒ|Ƿ碽ۏұ݋~ɋ,wu06$M$$<0M6M<,,~ ""V O@^OoŽehfftUfUe44;;};11 1GGSG\_ǟ9r\q 9HAT15Vc>|rJP1H2fĈ~C'*dȰRV jŪk< 8p%kK:!:D, @LX Z (ɋ"H.hQŅ;|B3N>&<@$vlM#0ky,Y@=5 9qAwiaÍ(POoF (`B|Do(;django-pipeline-1.5.4/tests/static/admin/img/default-bg.gif0000664000076500000240000000150412566170077023515 0ustar timstaff00000000000000GIF87a㏰сʻ刪~ȃˀɡۍТ۸{ƈؚ̜͆{NJϟ٤ܮ℧˟ڶݧ޲䔴ԩ߶ɜ|Ȯ畴ԩߗ~Ȯᒲӫ|ȌДԱ㋬Η|Ǻ痶֑ӧފ}ǒҗդ܂ʬޚֻ匮Ы㙸֧ݻ}ǬႦʳᕳԌϚֆ̀ɒҪ߷ڐёҁʏѴ噸ם؜م̪̅߆ͺ華Ҹݩ˳査ٶ冩{Ʒ|Ƿ碽ۏұ݋~ɋ,LDLDi77((7(k v'' xl !!YYqs!`FaaF`&PI&&pPp3{--%-%EA/NHQ/AQH/EH*nX * Ԃ%3Bt,ЦC::"D~p`!>5r䠀(M*Xy2 2lSfĬ0fĈ~C'$(U2 JňD+V>p`52Rr2>#Ǖs# E@a5 cc1yx iAA3}(R?X2h @ UT)C ~8㿟e9';@կ[I`;v,X@A< yqKw 2&ė 2K h1]QTd6 bt\)9vŃ[kꁌ1~|| tdqYU Us}Ȍ1HQ)-48<$MSЊE, nȴ  6 򮽜M}\oﰻãT1)i|#M4j{9E:q9OY% 4S΍l(R"r-Kkn095iu2rÔF3x\ٻRAI|$I()LtL` +? x:L@)"A < ZVqf@iJ67H$ιVEGKKܿ!8|&f~*?ǘd}ip4fG7r2ãԦIENDB`django-pipeline-1.5.4/tests/static/admin/img/gis/move_vertex_on.png0000664000076500000240000000077212566170077025351 0ustar timstaff00000000000000PNG  IHDR}\bKGD pHYs  tIME  SuIDATHǵU;KPSI+8uH:8v_,.c)]\PZh&%4қ8hb(Mgqιζjۅn"TUE6Ѹà?@Fjbo2W.- 'p\7M_4M.%s$s~n.D³\J+2GBC0S?dxy\T ҼzAWiEOL1Q*pq%Pc"w+8?H+2ƕ|h)F5ߕSk T } z` 4L QAs*c͹?DQW8PGFjF:xnϠ(Ipa>! !<, bX cWֿq+IENDB`django-pipeline-1.5.4/tests/static/admin/img/icon-no.gif0000664000076500000240000000026012566170077023043 0ustar timstaff00000000000000GIF89a !!33..HH``bbXXZZuurr!, - @4(D@:@Ю1A;p cM0ITa;django-pipeline-1.5.4/tests/static/admin/img/icon-unknown.gif0000664000076500000240000000020212566170077024122 0ustar timstaff00000000000000GIF89a ѪՖ!, /=Z[LOS'(8C(G NuX5Ϙ@#;django-pipeline-1.5.4/tests/static/admin/img/icon-yes.gif0000664000076500000240000000045312566170077023233 0ustar timstaff00000000000000GIF89a B?DAmkަإki٧ȮܭtrکQOHFє]ZԜǂȀ~|٦ܮa^!, H@P8 4hz (8ЀBm.t2(Y$B\ UOJDA;django-pipeline-1.5.4/tests/static/admin/img/icon_addlink.gif0000664000076500000240000000016712566170077024125 0ustar timstaff00000000000000GIF89a urdaead`eami_[{wEA! , $0ID cq]V@Aԙ [Ay!eqxW;django-pipeline-1.5.4/tests/static/admin/img/icon_alert.gif0000664000076500000240000000022112566170077023615 0ustar timstaff00000000000000GIF89aT`B-NfK 6 r!,>Ix)sI  ]4 "PDz%6zzCqPPAՄ= 1D;django-pipeline-1.5.4/tests/static/admin/img/icon_calendar.gif0000664000076500000240000000030012566170077024255 0ustar timstaff00000000000000GIF89a!,mI8k|  FAnm' ,|k p`2pH,( Nt|^Qc)/Pj]{|A2;django-pipeline-1.5.4/tests/static/admin/img/icon_changelink.gif0000664000076500000240000000016712566170077024622 0ustar timstaff00000000000000GIF89a kjC}¤y! , $*ٻ҂($F9&c_ͱ;django-pipeline-1.5.4/tests/static/admin/img/icon_clock.gif0000664000076500000240000000060612566170077023610 0ustar timstaff00000000000000GIF89a;ۧ!;,p+u$V# Rcl*p"^p.@28 Y#ZB$:7u9*486:8 4 +8( 4$ )8 14 :38& /847D82"-C:%XWÁT6JDGEB7JA;django-pipeline-1.5.4/tests/static/admin/img/icon_deletelink.gif0000664000076500000240000000026512566170077024636 0ustar timstaff00000000000000GIF89a VWffNO^_FF_^__77^_ON>>+*rrVVrs0077ml+*vvWWNN!, 2uYHi5Me @2QPviQiCH;django-pipeline-1.5.4/tests/static/admin/img/icon_error.gif0000664000076500000240000000047712566170077023654 0ustar timstaff00000000000000GIF89aTTZZNN{{$$QQuu99 ``<<''xx0033!,\pH,11 t*8 t=-`X €yr<.U\:(ZBSB Dk E[NNFA;django-pipeline-1.5.4/tests/static/admin/img/icon_searchbox.png0000664000076500000240000000056012566170077024511 0ustar timstaff00000000000000PNG  IHDR>mpgAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDAT.ao#1510+'cpFI0D mB}6-}@ԯ_Ri~s$]{Uh0R^?ߘqx3Jefk9:%u^,$IQ zߟ) "c1 JY9=$E vކ=u{ѣ'6IyAq^[~;Fؽ:`_H)o_=;(G|${ݔ e3a&sIENDB`django-pipeline-1.5.4/tests/static/admin/img/icon_success.gif0000664000076500000240000000052512566170077024165 0ustar timstaff00000000000000GIF89aёލ謰魵벼zs~x{{ފ`VbXi`ofpgyq{syqH;NBTHVKYMh]mc!*,r@pH,0 (t V7)IZRCGF!Uqi(>O!B`R)! ))Se*S ZBbZBb[D#h"%E[ N NFA;django-pipeline-1.5.4/tests/static/admin/img/inline-delete-8bit.png0000664000076500000240000000061312566170077025104 0ustar timstaff00000000000000PNG  IHDR ^=%QPLTE?$XtRNS'4 5IDATxڅ۶0D1^zFDum!=o偬d2# 0~542<4868M?qL)'+!J @#D1HJt2\pu Iq֟߸sB+]Vh\gvg6SޟNPN.E_>N.&iby.~ #T$yIENDB`django-pipeline-1.5.4/tests/static/admin/img/inline-delete.png0000664000076500000240000000130312566170077024235 0ustar timstaff00000000000000PNG  IHDR ^=%PLTEAAATTTsssxxx,,,:::UUUYYYmmmpppłTSnZVtRNS  #'*-./02567:=>?@BEKLMNSYZ\^`defhknqrs}}~ٽtIDATxڅYW@ E[ (qCPK.BiPx~QAvV[Y{3!()rJ7(%T3XL6޼x8`&FQDoR@ /9X̺G/|dIB> [G$"IGHi5 +M?^L2$'8b& }黔o2 УC`h\1j-cr`(;撥}̪K/Z}Ο78a<psIENDB`django-pipeline-1.5.4/tests/static/admin/img/inline-restore-8bit.png0000664000076500000240000000055312566170077025330 0ustar timstaff00000000000000PNG  IHDR ^=%HPLTEtRNS.IDATxڅ De늊7m;I09)9eQ9wʹ6]n6{L24vqԧ,W>1[HT#)+>~H %0P%c ɘf FB!0z3(G>"@G7e=iM).RE?HlwIENDB`django-pipeline-1.5.4/tests/static/admin/img/inline-restore.png0000664000076500000240000000105512566170077024462 0ustar timstaff00000000000000PNG  IHDR ^=%PLTE>#;9tRNS  #'*-./02567:=>?@BEKLMNSYZ\`efhknr}~7?IDATxڅ[SP Z[E/\-ƀWg2eMbe ҇ Hg4p@NN x/ֲ#&gD숬 @ƽS d9_v&FGQ5 qS- }!]U# !g$h%A;` f-nqwPM|AzIӹdj۸~V߮7MD4ŀ/IENDB`django-pipeline-1.5.4/tests/static/admin/img/inline-splitter-bg.gif0000664000076500000240000000013612566170077025213 0ustar timstaff00000000000000GIF87a<=< 777䷷```mmmqqq,p3ZJI;django-pipeline-1.5.4/tests/static/admin/img/nav-bg-grabber.gif0000664000076500000240000000016412566170077024260 0ustar timstaff00000000000000GIF89aT!,9H;@ ؕd}\6Ŷ益Ld<DNJ*¦;django-pipeline-1.5.4/tests/static/admin/img/nav-bg-reverse.gif0000664000076500000240000000026212566170077024326 0ustar timstaff00000000000000GIF87a,gIͻ>`(dI:hptmx/| TGR2z\C5 SBh5+P >":[C:^aĖڲ ը,J< ]`ES2X˘3IϠ?Y9<`R)CPݪذ۸s6 B Tà:ZKY:)Ǽ:g^ ]+@'^czkNz^=W /< W@2 GuW]\`=k<3Ʌ@x(=H$!"p ,".u T2%ָ. t\9q&>A7\q%L6", axƖ\zrHejx" b9]"D-`oFfv,Ry矁wBfJw ,i!rYc^kZB^ƙa<@`eTZ+,n*α@$AaN#hp! Av Gv+D P̸h.ر 2Ȼr+ǻSCϐ/) 4b.2CPD pd|  4 6Hng)ബOt#W}"s7@=@939$-(-L!N,TWM5+P(׭Î=h+;l l/@g`БJ>ЁJt@)|/~>(7H)ީ`aZ܊\H:Ŧ"J0SzNrFPn{l `^zfaL> t7*k;*u3T$CN!2tA G 0<2b$:Eg03bTN7XtCN08tgUS.BP@:sXh)pX0e@a!c"4Pg2X?łA@ YMՔqd~_6 Qb x`\"jA $K0` !ZUU}2&`LhA)Ԥ0 Sj dN^rK[N Ae%KɀL2mQT:PB.l\.H\fbQrE qGJr)$#)LqA9ِ4YњV5my[] <y _ } `Kڀj`$f#c ; F;e1R`,g;Zd 4mGs0V4 Dj^ִy lb#[Ă6zt3HMR @@B`E0@5( ^H$0&cQ(*PA1 F+k6,v 7>@f b DW\BN[ւPt U@Ԡ"J&!L! /_ 0|b abq0wX+&@%8k& ȯ8; LpM{^yc;h/+LpWF+`y7j/&\$<׸MWd"A @jaC1 `2db113Aژ 1(@B  D.CBj%cq񋫜[j`y,/A,w94 >cl;nqc>57qԂ8! qqҍЅ1X: "T -ƅ^D"? N݋MN@&2*e:\iyd#Q@ Dj0#aCۡŠ-юGx&F;django-pipeline-1.5.4/tests/static/admin/img/selector-search.gif0000664000076500000240000000105012566170077024562 0ustar timstaff00000000000000GIF89a<<>>jjj666ӫXXXGGG```CCCEEE}}}ccc[[[lll___乹SSSԪNNNfffŚUUU{{{ZZZ~~~???|||iii^^^ႂdddAAA!,!4- ><  +  ,A1"%:?0&.*'@DE3B92 ;#7 C= F $ 8 (5/6) ;django-pipeline-1.5.4/tests/static/admin/img/sorting-icons.gif0000664000076500000240000000056112566170077024303 0ustar timstaff00000000000000GIF89aͽʽªcQ!,`$dihlB!["c0' X֢`8k«tNL&K,Ql6m|NRE}~}/ p~S.||#xzvpmS-+/pm.+)'),n/ H pZ L7n1tРŋ#B;django-pipeline-1.5.4/tests/static/admin/img/tooltag-add.png0000664000076500000240000000016712566170077023725 0ustar timstaff00000000000000PNG  IHDR(-SPLTEU|ltRNS@fIDATxڥ͡0iŦ/0%IENDB`django-pipeline-1.5.4/tests/static/admin/img/tooltag-arrowright.png0000664000076500000240000000031012566170077025353 0ustar timstaff00000000000000PNG  IHDRaIDATxӱ @a!MPHLY$* 6&)gW& < rK  z[vpìeOc @'Bw8,V߸<5&/laIENDB`django-pipeline-1.5.4/tests/static/admin/js/0000775000076500000240000000000012573112042020636 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/js/actions.js0000664000076500000240000001145612566170077022661 0ustar timstaff00000000000000(function($) { var lastChecked; $.fn.actions = function(opts) { var options = $.extend({}, $.fn.actions.defaults, opts); var actionCheckboxes = $(this); var list_editable_changed = false; var checker = function(checked) { if (checked) { showQuestion(); } else { reset(); } $(actionCheckboxes).prop("checked", checked) .parent().parent().toggleClass(options.selectedClass, checked); }, updateCounter = function() { var sel = $(actionCheckboxes).filter(":checked").length; // _actions_icnt is defined in the generated HTML // and contains the total amount of objects in the queryset $(options.counterContainer).html(interpolate( ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { sel: sel, cnt: _actions_icnt }, true)); $(options.allToggle).prop("checked", function() { var value; if (sel == actionCheckboxes.length) { value = true; showQuestion(); } else { value = false; clearAcross(); } return value; }); }, showQuestion = function() { $(options.acrossClears).hide(); $(options.acrossQuestions).show(); $(options.allContainer).hide(); }, showClear = function() { $(options.acrossClears).show(); $(options.acrossQuestions).hide(); $(options.actionContainer).toggleClass(options.selectedClass); $(options.allContainer).show(); $(options.counterContainer).hide(); }, reset = function() { $(options.acrossClears).hide(); $(options.acrossQuestions).hide(); $(options.allContainer).hide(); $(options.counterContainer).show(); }, clearAcross = function() { reset(); $(options.acrossInput).val(0); $(options.actionContainer).removeClass(options.selectedClass); }; // Show counter by default $(options.counterContainer).show(); // Check state of checkboxes and reinit state if needed $(this).filter(":checked").each(function(i) { $(this).parent().parent().toggleClass(options.selectedClass); updateCounter(); if ($(options.acrossInput).val() == 1) { showClear(); } }); $(options.allToggle).show().click(function() { checker($(this).prop("checked")); updateCounter(); }); $("a", options.acrossQuestions).click(function(event) { event.preventDefault(); $(options.acrossInput).val(1); showClear(); }); $("a", options.acrossClears).click(function(event) { event.preventDefault(); $(options.allToggle).prop("checked", false); clearAcross(); checker(0); updateCounter(); }); lastChecked = null; $(actionCheckboxes).click(function(event) { if (!event) { event = window.event; } var target = event.target ? event.target : event.srcElement; if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { var inrange = false; $(lastChecked).prop("checked", target.checked) .parent().parent().toggleClass(options.selectedClass, target.checked); $(actionCheckboxes).each(function() { if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { inrange = (inrange) ? false : true; } if (inrange) { $(this).prop("checked", target.checked) .parent().parent().toggleClass(options.selectedClass, target.checked); } }); } $(target).parent().parent().toggleClass(options.selectedClass, target.checked); lastChecked = target; updateCounter(); }); $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { list_editable_changed = true; }); $('form#changelist-form button[name="index"]').click(function(event) { if (list_editable_changed) { return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); } }); $('form#changelist-form input[name="_save"]').click(function(event) { var action_changed = false; $('select option:selected', options.actionContainer).each(function() { if ($(this).val()) { action_changed = true; } }); if (action_changed) { if (list_editable_changed) { return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); } else { return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); } } }); }; /* Setup plugin defaults */ $.fn.actions.defaults = { actionContainer: "div.actions", counterContainer: "span.action-counter", allContainer: "div.actions span.all", acrossInput: "div.actions input.select-across", acrossQuestions: "div.actions span.question", acrossClears: "div.actions span.clear", allToggle: "#action-toggle", selectedClass: "selected" }; })(django.jQuery); django-pipeline-1.5.4/tests/static/admin/js/actions.min.js0000664000076500000240000000573512566170077023446 0ustar timstaff00000000000000(function(a){var f;a.fn.actions=function(q){var b=a.extend({},a.fn.actions.defaults,q),g=a(this),e=!1,m=function(c){c?k():l();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},!0));a(b.allToggle).prop("checked",function(){var a;c==g.length?(a=!0,k()):(a=!1,n());return a})},k=function(){a(b.acrossClears).hide(); a(b.acrossQuestions).show();a(b.allContainer).hide()},p=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},n=function(){l();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};a(b.counterContainer).show();a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass); h();1==a(b.acrossInput).val()&&p()});a(b.allToggle).show().click(function(){m(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);p()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);n();m(0);h()});f=null;a(g).click(function(c){c||(c=window.event);var d=c.target?c.target:c.srcElement;if(f&&a.data(f)!=a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass, d.checked);a(g).each(function(){if(a.data(this)==a.data(f)||a.data(this)==a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){e=!0});a('form#changelist-form button[name="index"]').click(function(a){if(e)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))}); a('form#changelist-form input[name="_save"]').click(function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return e?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})}; a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery); django-pipeline-1.5.4/tests/static/admin/js/admin/0000775000076500000240000000000012573112042021726 5ustar timstaff00000000000000django-pipeline-1.5.4/tests/static/admin/js/admin/DateTimeShortcuts.js0000664000076500000240000004141112566170077025716 0ustar timstaff00000000000000// Inserts shortcut buttons after all of the following: // // var DateTimeShortcuts = { calendars: [], calendarInputs: [], clockInputs: [], dismissClockFunc: [], dismissCalendarFunc: [], calendarDivName1: 'calendarbox', // name of calendar
that gets toggled calendarDivName2: 'calendarin', // name of
that contains calendar calendarLinkName: 'calendarlink',// name of the link that is used to toggle clockDivName: 'clockbox', // name of clock
that gets toggled clockLinkName: 'clocklink', // name of the link that is used to toggle shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch timezoneOffset: 0, admin_media_prefix: '', init: function() { // Get admin_media_prefix by grabbing it off the window object. It's // set in the admin/base.html template, so if it's not there, someone's // overridden the template. In that case, we'll set a clearly-invalid // value in the hopes that someone will examine HTTP requests and see it. if (window.__admin_media_prefix__ != undefined) { DateTimeShortcuts.admin_media_prefix = window.__admin_media_prefix__; } else { DateTimeShortcuts.admin_media_prefix = '/missing-admin-media-prefix/'; } if (window.__admin_utc_offset__ != undefined) { var serverOffset = window.__admin_utc_offset__; var localOffset = new Date().getTimezoneOffset() * -60; DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; } var inputs = document.getElementsByTagName('input'); for (i=0; i 0) { message = ngettext( 'Note: You are %s hour ahead of server time.', 'Note: You are %s hours ahead of server time.', timezoneOffset ); } else { timezoneOffset *= -1 message = ngettext( 'Note: You are %s hour behind server time.', 'Note: You are %s hours behind server time.', timezoneOffset ); } message = interpolate(message, [timezoneOffset]); var $warning = $(''); $warning.attr('class', warningClass); $warning.text(message); $(inp).parent() .append($('
')) .append($warning) }, // Add clock widget to a given field addClock: function(inp) { var num = DateTimeShortcuts.clockInputs.length; DateTimeShortcuts.clockInputs[num] = inp; DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; }; // Shortcut links (clock icon and "Now" link) var shortcuts_span = document.createElement('span'); shortcuts_span.className = DateTimeShortcuts.shortCutsClass; inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); var now_link = document.createElement('a'); now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", -1);"); now_link.appendChild(document.createTextNode(gettext('Now'))); var clock_link = document.createElement('a'); clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');'); clock_link.id = DateTimeShortcuts.clockLinkName + num; quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_clock.gif', 'alt', gettext('Clock')); shortcuts_span.appendChild(document.createTextNode('\240')); shortcuts_span.appendChild(now_link); shortcuts_span.appendChild(document.createTextNode('\240|\240')); shortcuts_span.appendChild(clock_link); // Create clock link div // // Markup looks like: //
//

Choose a time

// //

Cancel

//
var clock_box = document.createElement('div'); clock_box.style.display = 'none'; clock_box.style.position = 'absolute'; clock_box.className = 'clockbox module'; clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); document.body.appendChild(clock_box); addEvent(clock_box, 'click', cancelEventPropagation); quickElement('h2', clock_box, gettext('Choose a time')); var time_list = quickElement('ul', clock_box); time_list.className = 'timelist'; quickElement("a", quickElement("li", time_list), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", -1);"); quickElement("a", quickElement("li", time_list), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 0);"); quickElement("a", quickElement("li", time_list), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 6);"); quickElement("a", quickElement("li", time_list), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 12);"); var cancel_p = quickElement('p', clock_box); cancel_p.className = 'calendar-cancel'; quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');'); django.jQuery(document).bind('keyup', function(event) { if (event.which == 27) { // ESC key closes popup DateTimeShortcuts.dismissClock(num); event.preventDefault(); } }); }, openClock: function(num) { var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num) // Recalculate the clockbox position // is it left-to-right or right-to-left layout ? if (getStyle(document.body,'direction')!='rtl') { clock_box.style.left = findPosX(clock_link) + 17 + 'px'; } else { // since style's width is in em, it'd be tough to calculate // px value of it. let's use an estimated px for now // TODO: IE returns wrong value for findPosX when in rtl mode // (it returns as it was left aligned), needs to be fixed. clock_box.style.left = findPosX(clock_link) - 110 + 'px'; } clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; // Show the clock box clock_box.style.display = 'block'; addEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); }, dismissClock: function(num) { document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; removeEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); }, handleClockQuicklink: function(num, val) { var d; if (val == -1) { d = DateTimeShortcuts.now(); } else { d = new Date(1970, 1, 1, val, 0, 0, 0) } DateTimeShortcuts.clockInputs[num].value = d.strftime(get_format('TIME_INPUT_FORMATS')[0]); DateTimeShortcuts.clockInputs[num].focus(); DateTimeShortcuts.dismissClock(num); }, // Add calendar widget to a given field. addCalendar: function(inp) { var num = DateTimeShortcuts.calendars.length; DateTimeShortcuts.calendarInputs[num] = inp; DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; }; // Shortcut links (calendar icon and "Today" link) var shortcuts_span = document.createElement('span'); shortcuts_span.className = DateTimeShortcuts.shortCutsClass; inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); var today_link = document.createElement('a'); today_link.setAttribute('href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); today_link.appendChild(document.createTextNode(gettext('Today'))); var cal_link = document.createElement('a'); cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');'); cal_link.id = DateTimeShortcuts.calendarLinkName + num; quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_calendar.gif', 'alt', gettext('Calendar')); shortcuts_span.appendChild(document.createTextNode('\240')); shortcuts_span.appendChild(today_link); shortcuts_span.appendChild(document.createTextNode('\240|\240')); shortcuts_span.appendChild(cal_link); // Create calendarbox div. // // Markup looks like: // //
//

// // February 2003 //

//
// //
// //

Cancel

//
var cal_box = document.createElement('div'); cal_box.style.display = 'none'; cal_box.style.position = 'absolute'; cal_box.className = 'calendarbox module'; cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); document.body.appendChild(cal_box); addEvent(cal_box, 'click', cancelEventPropagation); // next-prev links var cal_nav = quickElement('div', cal_box); var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');'); cal_nav_prev.className = 'calendarnav-previous'; var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');'); cal_nav_next.className = 'calendarnav-next'; // main box var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); cal_main.className = 'calendar'; DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); DateTimeShortcuts.calendars[num].drawCurrent(); // calendar shortcuts var shortcuts = quickElement('div', cal_box); shortcuts.className = 'calendar-shortcuts'; quickElement('a', shortcuts, gettext('Yesterday'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', -1);'); shortcuts.appendChild(document.createTextNode('\240|\240')); quickElement('a', shortcuts, gettext('Today'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); shortcuts.appendChild(document.createTextNode('\240|\240')); quickElement('a', shortcuts, gettext('Tomorrow'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', +1);'); // cancel bar var cancel_p = quickElement('p', cal_box); cancel_p.className = 'calendar-cancel'; quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');'); django.jQuery(document).bind('keyup', function(event) { if (event.which == 27) { // ESC key closes popup DateTimeShortcuts.dismissCalendar(num); event.preventDefault(); } }); }, openCalendar: function(num) { var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num) var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num) var inp = DateTimeShortcuts.calendarInputs[num]; // Determine if the current value in the input has a valid date. // If so, draw the calendar with that date's year and month. if (inp.value) { var format = get_format('DATE_INPUT_FORMATS')[0]; var selected = inp.value.strptime(format); var year = selected.getFullYear(); var month = selected.getMonth() + 1; var re = /\d{4}/ if (re.test(year.toString()) && month >= 1 && month <= 12) { DateTimeShortcuts.calendars[num].drawDate(month, year, selected); } } // Recalculate the clockbox position // is it left-to-right or right-to-left layout ? if (getStyle(document.body,'direction')!='rtl') { cal_box.style.left = findPosX(cal_link) + 17 + 'px'; } else { // since style's width is in em, it'd be tough to calculate // px value of it. let's use an estimated px for now // TODO: IE returns wrong value for findPosX when in rtl mode // (it returns as it was left aligned), needs to be fixed. cal_box.style.left = findPosX(cal_link) - 180 + 'px'; } cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; cal_box.style.display = 'block'; addEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); }, dismissCalendar: function(num) { document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none'; removeEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); }, drawPrev: function(num) { DateTimeShortcuts.calendars[num].drawPreviousMonth(); }, drawNext: function(num) { DateTimeShortcuts.calendars[num].drawNextMonth(); }, handleCalendarCallback: function(num) { var format = get_format('DATE_INPUT_FORMATS')[0]; // the format needs to be escaped a little format = format.replace('\\', '\\\\'); format = format.replace('\r', '\\r'); format = format.replace('\n', '\\n'); format = format.replace('\t', '\\t'); format = format.replace("'", "\\'"); return ["function(y, m, d) { DateTimeShortcuts.calendarInputs[", num, "].value = new Date(y, m-1, d).strftime('", format, "');DateTimeShortcuts.calendarInputs[", num, "].focus();document.getElementById(DateTimeShortcuts.calendarDivName1+", num, ").style.display='none';}"].join(''); }, handleCalendarQuickLink: function(num, offset) { var d = DateTimeShortcuts.now(); d.setDate(d.getDate() + offset) DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); DateTimeShortcuts.calendarInputs[num].focus(); DateTimeShortcuts.dismissCalendar(num); } } addEvent(window, 'load', DateTimeShortcuts.init); django-pipeline-1.5.4/tests/static/admin/js/admin/RelatedObjectLookups.js0000664000076500000240000001056012566170077026370 0ustar timstaff00000000000000// Handles related-objects functionality: lookup link for raw_id_fields // and Add Another links. function html_unescape(text) { // Unescape a string that was escaped using django.utils.html.escape. text = text.replace(/</g, '<'); text = text.replace(/>/g, '>'); text = text.replace(/"/g, '"'); text = text.replace(/'/g, "'"); text = text.replace(/&/g, '&'); return text; } // IE doesn't accept periods or dashes in the window name, but the element IDs // we use to generate popup window names may contain them, therefore we map them // to allowed characters in a reversible way so that we can locate the correct // element when the popup window is dismissed. function id_to_windowname(text) { text = text.replace(/\./g, '__dot__'); text = text.replace(/\-/g, '__dash__'); return text; } function windowname_to_id(text) { text = text.replace(/__dot__/g, '.'); text = text.replace(/__dash__/g, '-'); return text; } function showAdminPopup(triggeringLink, name_regexp) { var name = triggeringLink.id.replace(name_regexp, ''); name = id_to_windowname(name); var href = triggeringLink.href; if (href.indexOf('?') == -1) { href += '?_popup=1'; } else { href += '&_popup=1'; } var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); win.focus(); return false; } function showRelatedObjectLookupPopup(triggeringLink) { return showAdminPopup(triggeringLink, /^lookup_/); } function dismissRelatedLookupPopup(win, chosenId) { var name = windowname_to_id(win.name); var elem = document.getElementById(name); if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { elem.value += ',' + chosenId; } else { document.getElementById(name).value = chosenId; } win.close(); } function showRelatedObjectPopup(triggeringLink) { var name = triggeringLink.id.replace(/^(change|add|delete)_/, ''); name = id_to_windowname(name); var href = triggeringLink.href; var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); win.focus(); return false; } function dismissAddRelatedObjectPopup(win, newId, newRepr) { // newId and newRepr are expected to have previously been escaped by // django.utils.html.escape. newId = html_unescape(newId); newRepr = html_unescape(newRepr); var name = windowname_to_id(win.name); var elem = document.getElementById(name); var o; if (elem) { var elemName = elem.nodeName.toUpperCase(); if (elemName == 'SELECT') { o = new Option(newRepr, newId); elem.options[elem.options.length] = o; o.selected = true; } else if (elemName == 'INPUT') { if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { elem.value += ',' + newId; } else { elem.value = newId; } } // Trigger a change event to update related links if required. django.jQuery(elem).trigger('change'); } else { var toId = name + "_to"; o = new Option(newRepr, newId); SelectBox.add_to_cache(toId, o); SelectBox.redisplay(toId); } win.close(); } function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) { objId = html_unescape(objId); newRepr = html_unescape(newRepr); var id = windowname_to_id(win.name).replace(/^edit_/, ''); var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); var selects = django.jQuery(selectsSelector); selects.find('option').each(function() { if (this.value == objId) { this.innerHTML = newRepr; this.value = newId; } }); win.close(); }; function dismissDeleteRelatedObjectPopup(win, objId) { objId = html_unescape(objId); var id = windowname_to_id(win.name).replace(/^delete_/, ''); var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); var selects = django.jQuery(selectsSelector); selects.find('option').each(function() { if (this.value == objId) { django.jQuery(this).remove(); } }).trigger('change'); win.close(); }; // Kept for backward compatibility showAddAnotherPopup = showRelatedObjectPopup; dismissAddAnotherPopup = dismissAddRelatedObjectPopup; django-pipeline-1.5.4/tests/static/admin/js/calendar.js0000664000076500000240000001352112566170077022765 0ustar timstaff00000000000000/* calendar.js - Calendar functions by Adrian Holovaty depends on core.js for utility functions like removeChildren or quickElement */ // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions var CalendarNamespace = { monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), daysOfWeek: gettext('S M T W T F S').split(' '), firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), isLeapYear: function(year) { return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)); }, getDaysInMonth: function(month,year) { var days; if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) { days = 31; } else if (month==4 || month==6 || month==9 || month==11) { days = 30; } else if (month==2 && CalendarNamespace.isLeapYear(year)) { days = 29; } else { days = 28; } return days; }, draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999 var today = new Date(); var todayDay = today.getDate(); var todayMonth = today.getMonth()+1; var todayYear = today.getFullYear(); var todayClass = ''; // Use UTC functions here because the date field does not contain time // and using the UTC function variants prevent the local time offset // from altering the date, specifically the day field. For example: // // ``` // var x = new Date('2013-10-02'); // var day = x.getDate(); // ``` // // The day variable above will be 1 instead of 2 in, say, US Pacific time // zone. var isSelectedMonth = false; if (typeof selected != 'undefined') { isSelectedMonth = (selected.getUTCFullYear() == year && (selected.getUTCMonth()+1) == month); } month = parseInt(month); year = parseInt(year); var calDiv = document.getElementById(div_id); removeChildren(calDiv); var calTable = document.createElement('table'); quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month-1] + ' ' + year); var tableBody = quickElement('tbody', calTable); // Draw days-of-week header var tableRow = quickElement('tr', tableBody); for (var i = 0; i < 7; i++) { quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); } var startingPos = new Date(year, month-1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); var days = CalendarNamespace.getDaysInMonth(month, year); // Draw blanks before first of month tableRow = quickElement('tr', tableBody); for (var i = 0; i < startingPos; i++) { var _cell = quickElement('td', tableRow, ' '); _cell.className = "nonday"; } // Draw days of month var currentDay = 1; for (var i = startingPos; currentDay <= days; i++) { if (i%7 == 0 && currentDay != 1) { tableRow = quickElement('tr', tableBody); } if ((currentDay==todayDay) && (month==todayMonth) && (year==todayYear)) { todayClass='today'; } else { todayClass=''; } // use UTC function; see above for explanation. if (isSelectedMonth && currentDay == selected.getUTCDate()) { if (todayClass != '') todayClass += " "; todayClass += "selected"; } var cell = quickElement('td', tableRow, '', 'class', todayClass); quickElement('a', cell, currentDay, 'href', 'javascript:void(' + callback + '('+year+','+month+','+currentDay+'));'); currentDay++; } // Draw blanks after end of month (optional, but makes for valid code) while (tableRow.childNodes.length < 7) { var _cell = quickElement('td', tableRow, ' '); _cell.className = "nonday"; } calDiv.appendChild(calTable); } } // Calendar -- A calendar instance function Calendar(div_id, callback, selected) { // div_id (string) is the ID of the element in which the calendar will // be displayed // callback (string) is the name of a JavaScript function that will be // called with the parameters (year, month, day) when a day in the // calendar is clicked this.div_id = div_id; this.callback = callback; this.today = new Date(); this.currentMonth = this.today.getMonth() + 1; this.currentYear = this.today.getFullYear(); if (typeof selected != 'undefined') { this.selected = selected; } } Calendar.prototype = { drawCurrent: function() { CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback, this.selected); }, drawDate: function(month, year, selected) { this.currentMonth = month; this.currentYear = year; if(selected) { this.selected = selected; } this.drawCurrent(); }, drawPreviousMonth: function() { if (this.currentMonth == 1) { this.currentMonth = 12; this.currentYear--; } else { this.currentMonth--; } this.drawCurrent(); }, drawNextMonth: function() { if (this.currentMonth == 12) { this.currentMonth = 1; this.currentYear++; } else { this.currentMonth++; } this.drawCurrent(); }, drawPreviousYear: function() { this.currentYear--; this.drawCurrent(); }, drawNextYear: function() { this.currentYear++; this.drawCurrent(); } } django-pipeline-1.5.4/tests/static/admin/js/collapse.js0000664000076500000240000000162512566170077023020 0ustar timstaff00000000000000(function($) { $(document).ready(function() { // Add anchor tag for Show/Hide link $("fieldset.collapse").each(function(i, elem) { // Don't hide if fields in this fieldset have errors if ($(elem).find("div.errors").length == 0) { $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + ')'); } }); // Add toggle to anchor tag $("fieldset.collapse a.collapse-toggle").click(function(ev) { if ($(this).closest("fieldset").hasClass("collapsed")) { // Show $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); } else { // Hide $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); } return false; }); }); })(django.jQuery); django-pipeline-1.5.4/tests/static/admin/js/collapse.min.js0000664000076500000240000000121312566170077023573 0ustar timstaff00000000000000(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){a(b).find("div.errors").length==0&&a(b).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [a(this).attr("id")]);return false})})})(django.jQuery); django-pipeline-1.5.4/tests/static/admin/js/core.js0000664000076500000240000001654212566170077022152 0ustar timstaff00000000000000// Core javascript helper functions // basic browser identification & version var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); // Cross-browser event handlers. function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on" + evType, fn); return r; } else { return false; } } function removeEvent(obj, evType, fn) { if (obj.removeEventListener) { obj.removeEventListener(evType, fn, false); return true; } else if (obj.detachEvent) { obj.detachEvent("on" + evType, fn); return true; } else { return false; } } function cancelEventPropagation(e) { if (!e) e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); } // quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); function quickElement() { var obj = document.createElement(arguments[0]); if (arguments[2]) { var textNode = document.createTextNode(arguments[2]); obj.appendChild(textNode); } var len = arguments.length; for (var i = 3; i < len; i += 2) { obj.setAttribute(arguments[i], arguments[i+1]); } arguments[1].appendChild(obj); return obj; } // "a" is reference to an object function removeChildren(a) { while (a.hasChildNodes()) a.removeChild(a.lastChild); } // ---------------------------------------------------------------------------- // Cross-browser xmlhttp object // from http://jibbering.com/2002/4/httprequest.html // ---------------------------------------------------------------------------- var xmlhttp; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } // ---------------------------------------------------------------------------- // Find-position functions by PPK // See http://www.quirksmode.org/js/findpos.html // ---------------------------------------------------------------------------- function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); obj = obj.offsetParent; } // IE offsetParent does not include the top-level if (isIE && obj.parentElement){ curleft += obj.offsetLeft - obj.scrollLeft; } } else if (obj.x) { curleft += obj.x; } return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); obj = obj.offsetParent; } // IE offsetParent does not include the top-level if (isIE && obj.parentElement){ curtop += obj.offsetTop - obj.scrollTop; } } else if (obj.y) { curtop += obj.y; } return curtop; } //----------------------------------------------------------------------------- // Date object extensions // ---------------------------------------------------------------------------- Date.prototype.getTwelveHours = function() { hours = this.getHours(); if (hours == 0) { return 12; } else { return hours <= 12 ? hours : hours-12 } } Date.prototype.getTwoDigitMonth = function() { return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); } Date.prototype.getTwoDigitDate = function() { return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); } Date.prototype.getTwoDigitTwelveHour = function() { return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); } Date.prototype.getTwoDigitHour = function() { return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); } Date.prototype.getTwoDigitMinute = function() { return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); } Date.prototype.getTwoDigitSecond = function() { return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); } Date.prototype.getHourMinute = function() { return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); } Date.prototype.getHourMinuteSecond = function() { return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); } Date.prototype.strftime = function(format) { var fields = { c: this.toString(), d: this.getTwoDigitDate(), H: this.getTwoDigitHour(), I: this.getTwoDigitTwelveHour(), m: this.getTwoDigitMonth(), M: this.getTwoDigitMinute(), p: (this.getHours() >= 12) ? 'PM' : 'AM', S: this.getTwoDigitSecond(), w: '0' + this.getDay(), x: this.toLocaleDateString(), X: this.toLocaleTimeString(), y: ('' + this.getFullYear()).substr(2, 4), Y: '' + this.getFullYear(), '%' : '%' }; var result = '', i = 0; while (i < format.length) { if (format.charAt(i) === '%') { result = result + fields[format.charAt(i + 1)]; ++i; } else { result = result + format.charAt(i); } ++i; } return result; } // ---------------------------------------------------------------------------- // String object extensions // ---------------------------------------------------------------------------- String.prototype.pad_left = function(pad_length, pad_string) { var new_string = this; for (var i = 0; new_string.length < pad_length; i++) { new_string = pad_string + new_string; } return new_string; } String.prototype.strptime = function(format) { var split_format = format.split(/[.\-/]/); var date = this.split(/[.\-/]/); var i = 0; while (i < split_format.length) { switch (split_format[i]) { case "%d": var day = date[i]; break; case "%m": var month = date[i] - 1; break; case "%Y": var year = date[i]; break; case "%y": var year = date[i]; break; } ++i; }; return new Date(year, month, day); } // ---------------------------------------------------------------------------- // Get the computed style for and element // ---------------------------------------------------------------------------- function getStyle(oElm, strCssRule){ var strValue = ""; if(document.defaultView && document.defaultView.getComputedStyle){ strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); } else if(oElm.currentStyle){ strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ return p1.toUpperCase(); }); strValue = oElm.currentStyle[strCssRule]; } return strValue; } django-pipeline-1.5.4/tests/static/admin/js/inlines.js0000664000076500000240000002566712566170077022673 0ustar timstaff00000000000000/** * Django admin inlines * * Based on jQuery Formset 1.1 * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com) * @requires jQuery 1.2.6 or later * * Copyright (c) 2009, Stanislaus Madueke * All rights reserved. * * Spiced up with Code from Zain Memon's GSoC project 2009 * and modified for Django by Jannis Leidel, Travis Swicegood and Julien Phalip. * * Licensed under the New BSD License * See: http://www.opensource.org/licenses/bsd-license.php */ (function($) { $.fn.formset = function(opts) { var options = $.extend({}, $.fn.formset.defaults, opts); var $this = $(this); var $parent = $this.parent(); var updateElementIndex = function(el, prefix, ndx) { var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); var replacement = prefix + "-" + ndx; if ($(el).prop("for")) { $(el).prop("for", $(el).prop("for").replace(id_regex, replacement)); } if (el.id) { el.id = el.id.replace(id_regex, replacement); } if (el.name) { el.name = el.name.replace(id_regex, replacement); } }; var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off"); var nextIndex = parseInt(totalForms.val(), 10); var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off"); // only show the add button if we are allowed to add more items, // note that max_num = None translates to a blank string. var showAddButton = maxForms.val() === '' || (maxForms.val()-totalForms.val()) > 0; $this.each(function(i) { $(this).not("." + options.emptyCssClass).addClass(options.formCssClass); }); if ($this.length && showAddButton) { var addButton; if ($this.prop("tagName") == "TR") { // If forms are laid out as table rows, insert the // "add" button in a new table row: var numCols = this.eq(-1).children().length; $parent.append('' + options.addText + ""); addButton = $parent.find("tr:last a"); } else { // Otherwise, insert it immediately after the last form: $this.filter(":last").after('"); addButton = $this.filter(":last").next().find("a"); } addButton.click(function(e) { e.preventDefault(); var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS"); var template = $("#" + options.prefix + "-empty"); var row = template.clone(true); row.removeClass(options.emptyCssClass) .addClass(options.formCssClass) .attr("id", options.prefix + "-" + nextIndex); if (row.is("tr")) { // If the forms are laid out in table rows, insert // the remove button into the last table cell: row.children(":last").append('"); } else if (row.is("ul") || row.is("ol")) { // If they're laid out as an ordered/unordered list, // insert an
  • after the last list item: row.append('
  • ' + options.deleteText + "
  • "); } else { // Otherwise, just insert the remove button as the // last child element of the form's container: row.children(":first").append('' + options.deleteText + ""); } row.find("*").each(function() { updateElementIndex(this, options.prefix, totalForms.val()); }); // Insert the new form when it has been fully edited row.insertBefore($(template)); // Update number of total forms $(totalForms).val(parseInt(totalForms.val(), 10) + 1); nextIndex += 1; // Hide add button in case we've hit the max, except we want to add infinitely if ((maxForms.val() !== '') && (maxForms.val()-totalForms.val()) <= 0) { addButton.parent().hide(); } // The delete button of each row triggers a bunch of other things row.find("a." + options.deleteCssClass).click(function(e) { e.preventDefault(); // Remove the parent form containing this button: var row = $(this).parents("." + options.formCssClass); row.remove(); nextIndex -= 1; // If a post-delete callback was provided, call it with the deleted form: if (options.removed) { options.removed(row); } // Update the TOTAL_FORMS form count. var forms = $("." + options.formCssClass); $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); // Show add button again once we drop below max if ((maxForms.val() === '') || (maxForms.val()-forms.length) > 0) { addButton.parent().show(); } // Also, update names and ids for all remaining form controls // so they remain in sequence: for (var i=0, formCount=forms.length; i0;i.each(function(){a(this).not("."+ b.emptyCssClass).addClass(b.formCssClass)});if(i.length&&l){var f;if(i.prop("tagName")=="TR"){i=this.eq(-1).children().length;g.append(''+b.addText+"");f=g.find("tr:last a")}else{i.filter(":last").after('");f=i.filter(":last").next().find("a")}f.click(function(e){e.preventDefault();var k=a("#id_"+b.prefix+"-TOTAL_FORMS");e=a("#"+ b.prefix+"-empty");var h=e.clone(true);h.removeClass(b.emptyCssClass).addClass(b.formCssClass).attr("id",b.prefix+"-"+d);if(h.is("tr"))h.children(":last").append('");else h.is("ul")||h.is("ol")?h.append('
  • '+b.deleteText+"
  • "):h.children(":first").append(''+b.deleteText+""); h.find("*").each(function(){m(this,b.prefix,k.val())});h.insertBefore(a(e));a(k).val(parseInt(k.val(),10)+1);d+=1;c.val()!==""&&c.val()-k.val()<=0&&f.parent().hide();h.find("a."+b.deleteCssClass).click(function(j){j.preventDefault();j=a(this).parents("."+b.formCssClass);j.remove();d-=1;b.removed&&b.removed(j);j=a("."+b.formCssClass);a("#id_"+b.prefix+"-TOTAL_FORMS").val(j.length);if(c.val()===""||c.val()-j.length>0)f.parent().show();for(var n=0,o=j.length;n= 0 && j < len ? [ this[j] ] : [] ); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: deletedIds.sort, splice: deletedIds.splice }; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( support.ownLast ) { for ( key in obj ) { return hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, type: function( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call(obj) ] || "object" : typeof obj; }, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Support: Android<4.1, IE<9 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( indexOf ) { return indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; while ( j < len ) { first[ i++ ] = second[ j++ ]; } // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: function() { return +( new Date() ); }, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.2.0-pre * http://sizzlejs.com/ * * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-12-16 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // http://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; nodeType = context.nodeType; if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } if ( !seed && documentIsHTML ) { // Try to shortcut find operations when possible (e.g., not under DocumentFragment) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document (jQuery #6963) if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType !== 1 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; parent = doc.defaultView; // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent !== parent.top ) { // IE11 does not have attachEvent, so all must suffer if ( parent.addEventListener ) { parent.addEventListener( "unload", unloadHandler, false ); } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", unloadHandler ); } } /* Support tests ---------------------------------------------------------------------- */ documentIsHTML = !isXML( doc ); /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Support: IE<9 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 docElem.appendChild( div ).innerHTML = "" + ""; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibing-combinator selector` fails if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch (e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[0] = null; return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (oldCache = outerCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements outerCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context !== document && context; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is no seed and only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = ""; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = ""; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } }); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // Use the correct document accordingly with window argument (sandbox) document = window.document, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.extend({ dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); jQuery.fn.extend({ has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); var rnotwhite = (/\S+/g); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !(--remaining) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend({ // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } }); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } } /** * The ready event handler and self cleanup method */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; var strundefined = typeof undefined; // Support: IE<9 // Iteration over object's inherited properties before its own var i; for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom jQuery(function() { // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); }); (function() { var div = document.createElement( "div" ); // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } // Null elements to avoid leaks in IE. div = null; })(); /** * Determines whether an object can have data */ jQuery.acceptData = function( elem ) { var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 && nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true && elem.getAttribute("classid") === noData; }; var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) // throw uncatchable exceptions if you attempt to set expando properties noData: { "applet ": true, "embed ": true, // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } }); jQuery.fn.extend({ data: function( key, value ) { var i, name, data, elem = this[0], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }; var rcheckableType = (/^(?:checkbox|radio)$/i); (function() { // Minified: var a,b,c var input = document.createElement( "input" ), div = document.createElement( "div" ), fragment = document.createDocumentFragment(); // Setup div.innerHTML = "
    a"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName( "tbody" ).length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) input.type = "checkbox"; input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE6-IE11+ div.innerHTML = ""; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); div.innerHTML = ""; // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() support.noCloneEvent = true; if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } })(); (function() { var i, eventName, div = document.createElement( "div" ); // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) for ( i in { submit: true, change: true, focusin: true }) { eventName = "on" + i; if ( !(support[ i + "Bubbles" ] = eventName in window) ) { // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; })(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && jQuery.acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); jQuery._removeData( doc, fix ); } else { jQuery._data( doc, fix, attaches ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "" ], legend: [ 1, "
    ", "
    " ], area: [ 1, "", "" ], param: [ 1, "", "" ], thead: [ 1, "", "
    " ], tr: [ 2, "", "
    " ], col: [ 2, "", "
    " ], td: [ 3, "", "
    " ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
    ", "
    " ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!support.noCloneEvent || !support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted from table fragments if ( !support.tbody ) { // String was a , *may* have spurious elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare or wrap[1] === "
    " && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } deletedIds.push( id ); } } } } } }); jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, remove: function( selector, keepData /* Internal Use Only */ ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var arg = arguments[ 0 ]; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { arg = this.parentNode; jQuery.cleanData( getAll( this ) ); if ( arg ) { arg.replaceChild( elem, this ); } }); // Force removal if there was no new content (e.g., from empty arguments) return arg && (arg.length || arg.nodeType) ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback ) { // Flatten any nested arrays args = concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); var iframe, elemdisplay = {}; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var style, elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // Use of this method is a temporary fix (more like optmization) until something better comes along, // since it was removed from specification and supported only in FF style.display : jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = (iframe || jQuery( "