summaryrefslogtreecommitdiffstats
path: root/DOCS/man
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-02-07 17:35:48 +0200
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2020-02-07 18:22:12 +0200
commit756960bf3cd6110c85b97f3edbd3bf0e2a2b91d4 (patch)
tree004dd368108cf52d8d73964f91a8ae7d86100437 /DOCS/man
parent68a1b47d4d4a7d59d4f43850902d4194eb7c0552 (diff)
downloadmpv-756960bf3cd6110c85b97f3edbd3bf0e2a2b91d4.tar.bz2
mpv-756960bf3cd6110c85b97f3edbd3bf0e2a2b91d4.tar.xz
js: require: directory-scripts: first look at <dir>/modules/
Also, add the function mp.get_script_directory() to let scripts know if they're loaded as a directory and where.
Diffstat (limited to 'DOCS/man')
-rw-r--r--DOCS/man/javascript.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index 49ddb481e4..0a43d213b6 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -139,6 +139,8 @@ success, ``fn`` is called always a-sync, ``error`` is empty string on success.
``mp.get_script_name()``
+``mp.get_script_directory()``
+
``mp.osd_message(text [,duration])``
``mp.get_wakeup_pipe()``
@@ -309,7 +311,8 @@ or ``~/x``. Otherwise it's considered a global module id and searched according
load ``x.js`` at one of the array paths, and id ``foo/x`` tries to load ``x.js``
inside dir ``foo`` at one of the paths.
-The ``mp.module_paths`` array is empty by default.
+The ``mp.module_paths`` array is empty by default except for scripts which are
+loaded as a directory where it contains one item - ``<directory>/modules/``.
``mp.module_paths`` may be updated from a script (preferably via custom init -
see below) which will affect future calls to ``require`` for global module id's
which are not already loaded/cached.