##// END OF EJS Templates
Don't try to load widget.js automatically since it was moved...
Don't try to load widget.js automatically since it was moved load using init_widget_js

File last commit:

r14231:dc861793
r14238:337e0e94
Show More
javascript.py
28 lines | 1.0 KiB | text/x-python | PythonLexer
"""Utilities to manipulate Javascript files.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import glob
import os
from IPython.display import display, Javascript
#-----------------------------------------------------------------------------
# Methods
#-----------------------------------------------------------------------------
def display_all_js(directory):
# Display each javascript file in the directory.
for filename in glob.glob(os.path.join(directory, '*.js')):
with open(filename, 'r') as f:
display(Javascript(data=f.read()))