mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add scripts
This commit is contained in:
parent
d2f14592e9
commit
fa2a619280
3 changed files with 897 additions and 0 deletions
35
dashboard-ui/thirdparty/apiclient/alt/events.js
vendored
Normal file
35
dashboard-ui/thirdparty/apiclient/alt/events.js
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
(function (globalScope) {
|
||||
|
||||
globalScope.Events = {
|
||||
|
||||
on: function (obj, eventName, selector, fn) {
|
||||
|
||||
Logger.log('event.on ' + eventName);
|
||||
bean.on(obj, eventName, selector, fn);
|
||||
},
|
||||
|
||||
off: function (obj, eventName, selector, fn) {
|
||||
|
||||
Logger.log('event.off ' + eventName);
|
||||
bean.off(obj, eventName, selector);
|
||||
},
|
||||
|
||||
trigger: function (obj, eventName, params) {
|
||||
|
||||
Logger.log('event.trigger ' + eventName);
|
||||
|
||||
// Need to push an extra param to make the argument order consistent with jquery
|
||||
var newParams = [];
|
||||
newParams.push({});
|
||||
|
||||
if (params && params.length) {
|
||||
for (var i = 0, length = params.length; i < length; i++) {
|
||||
newParams.push(params[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bean.fire(obj, eventName, newParams);
|
||||
}
|
||||
};
|
||||
|
||||
})(window);
|
Loading…
Add table
Add a link
Reference in a new issue