Skip to content

Commit 1f268d5

Browse files
committed
Merge pull request #4334 from saimn/js-sources
Add back in full source files for jQuery/dataTables Includes manual tweaks of README
1 parent 695d38b commit 1f268d5

7 files changed

Lines changed: 25969 additions & 12 deletions

File tree

‎astropy/extern/README.rst‎

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,23 @@ In particular, this currently includes for Python:
2323

2424
And for JavaScript:
2525

26-
- jQuery_: This is used currently for the browsed-based table viewer feature.
26+
- jQuery_: This is used currently for the browser-based table viewer feature.
2727

2828
- DataTables_: This is a plug-in for jQuery used also for the browser-based
2929
table viewer.
3030

31+
Notes for developers
32+
--------------------
33+
34+
35+
jQuery/DataTables
36+
^^^^^^^^^^^^^^^^^
37+
the minified files are the ones that are used in the table viewer feature, but
38+
the non-minified versions are also present in the ``js/`` sub-directory for
39+
packaging reasons. These files must also be distributed, to provide the source
40+
files from which the minified ones can be compiled. This is a requirement for
41+
Linux distributions such as Debian and Fedora.
42+
3143

3244
Notes for third-party packagers
3345
-------------------------------
@@ -55,7 +67,8 @@ version altogether. To do this, edit the ``_SIX_SEARCH_PATH`` list in
5567
_SIX_SEARCH_PATH = ['six']
5668

5769
No other imports in Astropy need to be updated. Imports from
58-
``astropy.extern.six`` are automatically updated to point to the system version of the module.
70+
``astropy.extern.six`` are automatically updated to point to the system version
71+
of the module.
5972

6073

6174
jQuery/DataTables
@@ -65,10 +78,25 @@ Packagers may either use system copies of these JavaScript modules, or require
6578
use of online versions (perhaps via URLs of cloud-hosted versions of these
6679
modules).
6780

68-
To change the default paths for these files edit the ``astropy.table.jsviewer``
69-
module in Astropy to change the default values for the ``jquery_url`` and/or
70-
``datatables_url`` options. Use a ``file://`` URL for locally-installed
71-
versions of these files.
81+
It is possible to change the default urls for the remote versions of these
82+
files by using the Astropy
83+
`Configuration system <http://docs.astropy.org/en/stable/config/>`_. The default
84+
configuration file (``$HOME/.astropy/config``) contains a commented section
85+
``[table.jsviewer]`` with two items for jQuery and DataTables. It is also
86+
possible to display the default value and modify it by importing the
87+
configuration module::
88+
89+
In [1]: from astropy.table.jsviewer import conf
90+
91+
In [2]: conf.jquery_url
92+
Out[2]: u'https://code.jquery.com/jquery-1.11.3.min.js'
93+
94+
In [3]: conf.jquery_url = '...'
95+
96+
Third-party packagers can override the defaults for these configuration items
97+
(by modifying the configuration objects in ``astropy/table/jsviewer.py``, or
98+
provide astropy config files that include the overrides appropriate for the
99+
packaged version.
72100

73101

74102
Other

0 commit comments

Comments
 (0)