History

js: add mp.utils.append_file

Also, for consistency with other APIs, mp.utils.{write,append}_file now return true on success (and still throw on any error).

Avi Halachmi (:avih) committed 5 years ago

Commit bc9d5561 parent 03b9f8e3 files · +23 −11Browse files

Showing the changes to player/javascript/defaults.js (1 of 3 files). Show all

Unified · Split

player/javascript/defaults.js+2−0
@@ -665,6 +665,8 @@ mp.get_time = function() { return mp.get_time_ms() / 1000 }; · 664 unmodified lines
665665 mp.utils.getcwd = function() { return mp.get_property("working-directory") };
666666 mp.utils.getpid = function() { return mp.get_property_number("pid") }
667667 mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") };
668+mp.utils.write_file = mp.utils._write_file.bind(null, false);
669+mp.utils.append_file = mp.utils._write_file.bind(null, true);
668670 mp.dispatch_event = dispatch_event;
669671 mp.process_timers = process_timers;
670672 mp.notify_idle_observers = notify_idle_observers;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t