PageSourceSearch

http://disrupt.radio/assets/js/player/jplayer.playlist.min.js

js disrupt.radio collected 2026-10-02 14:30:04 UTC 16,692 bytes, 312 lines download raw bytes

1!(function (s, t) {
2    var e = this;
3    (jPlayerPlaylist = function (t, e, i) {
4        var l = this;
5        (this.current = 0),
6            (this.loop = !1),
7            (this.shuffled = !1),
8            (this.removing = !1),
9            (this.cssSelector = s.extend({}, this._cssSelector, t)),
10            (this.options = s.extend(
11                !0,
12                {
13                    keyBindings: {
14                        next: {
15                            key: 221,
16                            fn: function () {
17                                l.next();
18                            },
19                        },
20                        previous: {
21                            key: 219,
22                            fn: function () {
23                                l.previous();
24                            },
25                        },
26                        shuffle: {
27                            key: 83,
28                            fn: function () {
29                                l.shuffle();
30                            },
31                        },
32                    },
33                    stateClass: { shuffled: "jp-state-shuffled" },
34                },
35                this._options,
36                i
37            )),
38            (this.playlist = []),
39            (this.original = []),
40            this._initPlaylist(e),
41            (this.cssSelector.details = this.cssSelector.cssSelectorAncestor + " .jp-details"),
42            (this.cssSelector.playlist = this.cssSelector.cssSelectorAncestor + " .jp-playlist"),
43            (this.cssSelector.next = this.cssSelector.cssSelectorAncestor + " .jp-next"),
44            (this.cssSelector.previous = this.cssSelector.cssSelectorAncestor + " .jp-previous"),
45            (this.cssSelector.shuffle = this.cssSelector.cssSelectorAncestor + " .jp-shuffle"),
46            (this.cssSelector.shuffleOff = this.cssSelector.cssSelectorAncestor + " .jp-shuffle-off"),
47            (this.options.cssSelectorAncestor = this.cssSelector.cssSelectorAncestor),
48            (this.options.repeat = function (s) {
49                l.loop = s.jPlayer.options.loop;
50            }),
51            s(this.cssSelector.jPlayer).bind(s.jPlayer.event.ready, function () {
52                l._init();
53            }),
54            s(this.cssSelector.jPlayer).bind(s.jPlayer.event.ended, function () {
55                s(".jp-audio").hasClass("jp-state-looped") ? l.play(l.current) : l.next();
56            }),
57            s(this.cssSelector.jPlayer).bind(s.jPlayer.event.play, function () {
58                s(this).jPlayer("pauseOthers");
59            }),
60            s(this.cssSelector.jPlayer).bind(s.jPlayer.event.resize, function (t) {
61                t.jPlayer.options.fullScreen ? s(l.cssSelector.details).show() : s(l.cssSelector.details).hide();
62            }),
63            s(this.cssSelector.previous).click(function (s) {
64                s.preventDefault(), l.previous(), l.blur(this);
65            }),
66            s(this.cssSelector.next).click(function (s) {
67                s.preventDefault(), l.next(), l.blur(this);
68            }),
69            s(this.cssSelector.shuffle).click(function (t) {
70                t.preventDefault(), l.shuffle(!l.shuffled || !s(l.cssSelector.jPlayer).jPlayer("option", "useStateClassSkin")), l.blur(this);
71            }),
72            s(this.cssSelector.shuffleOff)
73                .click(function (s) {
74                    s.preventDefault(), l.shuffle(!1), l.blur(this);
75                })
76                .hide(),
77            this.options.fullScreen || s(this.cssSelector.details).hide(),
78            s(this.cssSelector.playlist + " ul").empty(),
79            this._createItemHandlers(),
80            s(this.cssSelector.jPlayer).jPlayer(this.options);
81    }),
82        (jPlayerPlaylist.prototype = {
83            _cssSelector: { jPlayer: "#jquery_jplayer_1", cssSelectorAncestor: "#jp_container_1" },
84            _options: {
85                playlistOptions: {
86                    autoPlay: !1,
87                    loopOnPrevious: !1,
88                    shuffleOnLoop: !0,
89                    enableRemoveControls: !1,
90                    displayTime: "slow",
91                    addTime: "fast",
92                    removeTime: "fast",
93                    shuffleTime: "slow",
94                    itemClass: "jp-playlist-item",
95                    freeGroupClass: "jp-free-media",
96                    freeItemClass: "jp-playlist-item-free",
97                    removeItemClass: "jp-playlist-item-remove",
98                    repeat: "jp-repeat",
99                },
100            },
101            option: function (s, e) {
102                if (e === t) return this.options.playlistOptions[s];
103                switch (((this.options.playlistOptions[s] = e), s)) {
104                    case "enableRemoveControls":
105                        this._updateControls();
106                        break;
107                    case "itemClass":
108                    case "freeGroupClass":
109                    case "freeItemClass":
110                    case "removeItemClass":
111                        this._refresh(!0), this._createItemHandlers();
112                }
113                return this;
114            },
115            _init: function () {
116                var s = this;
117                this._refresh(function () {
118                    s.options.playlistOptions.autoPlay ? s.play(s.current) : s.select(s.current);
119                });
120            },
121            _initPlaylist: function (t) {
122                (this.current = 0), (this.shuffled = !1), (this.removing = !1), (this.original = s.extend(!0, [], t)), this._originalPlaylist();
123            },
124            _originalPlaylist: function () {
125                var t = this;
126                (this.playlist = []),
127                    s.each(this.original, function (s) {
128                        t.playlist[s] = t.original[s];
129                    });
130            },
131            _refresh: function (t) {
132                var e = this;
133                if (t && !s.isFunction(t))
134                    s(this.cssSelector.playlist + " ul").empty(),
135                        s.each(this.playlist, function (t) {
136                            s(e.cssSelector.playlist + " ul").append(e._createListItem(e.playlist[t]));
137                        }),
138                        this._updateControls();
139                else {
140                    var i = s(this.cssSelector.playlist + " ul").children().length ? this.options.playlistOptions.displayTime : 0;
141                    s(this.cssSelector.playlist + " ul").slideUp(i, function () {
142                        var i = s(this);
143                        s(this).empty(),
144                            s.each(e.playlist, function (s) {
145                                i.append(e._createListItem(e.playlist[s]));
146                            }),
147                            e._updateControls(),
148                            s.isFunction(t) && t(),
149                            e.playlist.length ? s(this).slideDown(e.options.playlistOptions.displayTime) : s(this).show();
150                    });
151                }
152            },
153            _createListItem: function (t) {
154                var i = this,
155                    l = "<li><div>";
156                if (
157                    ((l +=
158                        "<a href='javascript:;' class='" +
159                        this.options.playlistOptions.itemClass +
160                        "' tabindex='0'><span class='que_img'><img src='" +
161                        t.image +
162                        "' width='50px' height='50px'></span ><div class='que_data'>" +
163                        t.title +
164                        (t.artist ? " <span class='jp-artist'>by " + t.artist + "</span>" : "") +
165                        "</div></a>"),
166                    (l += "<a href='javascript:;' class='" + this.options.playlistOptions.removeItemClass + "'><span class='que_close'><img src='" + baseURL + "/assets/images/svg/close.svg'></span></a>"),
167                    t.free)
168                ) {
169                    var o = !0;
170                    (l += "<span class='" + this.options.playlistOptions.freeGroupClass + "'>("),
171                        s.each(t, function (t, e) {
172                            s.jPlayer.prototype.format[t] && (o ? (o = !1) : (l += " | "), (l += "<a class='" + i.options.playlistOptions.freeItemClass + "' href='" + e + "' tabindex='-1'>" + t + "</a>"));
173                        }),
174                        (l += ")</span>");
175                }
176                return (l += "</div></li>");
177            },
178            _createItemHandlers: function () {
179                var t = this;
180                s(this.cssSelector.playlist)
181                    .off("click", "a." + this.options.playlistOptions.itemClass)
182                    .on("click", "a." + this.options.playlistOptions.itemClass, function (e) {
183                        e.preventDefault();
184                        var i = s(this).parent().parent().index();
185                        t.current !== i ? t.play(i) : s(t.cssSelector.jPlayer).jPlayer("play"), t.blur(this);
186                    }),
187                    s(this.cssSelector.playlist)
188                        .off("click", "a." + this.options.playlistOptions.freeItemClass)
189                        .on("click", "a." + this.options.playlistOptions.freeItemClass, function (e) {
190                            e.preventDefault(),
191                                s(this)
192                                    .parent()
193                                    .parent()
194                                    .find("." + t.options.playlistOptions.itemClass)
195                                    .click(),
196                                t.blur(this);
197                        }),
198                    s(this.cssSelector.playlist)
199                        .off("click", "a." + this.options.playlistOptions.removeItemClass)
200                        .on("click", "a." + this.options.playlistOptions.removeItemClass, function (e) {
201                            e.preventDefault();
202                            var i = s(this).parent().parent().index();
203                            t.remove(i), t.blur(this);
204                            s('.jp-playlist').hide();
205                        });
206            },
207            _updateControls: function () {
208                this.options.playlistOptions.enableRemoveControls
209                    ? s(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).show()
210                    : s(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).hide(),
211                    this.shuffled ? s(this.cssSelector.jPlayer).jPlayer("addStateClass", "shuffled") : s(this.cssSelector.jPlayer).jPlayer("removeStateClass", "shuffled"),
212                    s(this.cssSelector.shuffle).length &&
213                        s(this.cssSelector.shuffleOff).length &&
214                        (this.shuffled ? (s(this.cssSelector.shuffleOff).show(), s(this.cssSelector.shuffle).hide()) : (s(this.cssSelector.shuffleOff).hide(), s(this.cssSelector.shuffle).show()));
215            },
216            _highlight: function (e) {
217                this.playlist.length &&
218                    e !== t &&
219                    (s(this.cssSelector.playlist + " .jp-playlist-current").removeClass("jp-playlist-current"),
220                    s(this.cssSelector.playlist + " li:nth-child(" + (e + 1) + ")")
221                        .addClass("jp-playlist-current")
222                        .find(".jp-playlist-item")
223                        .addClass("jp-playlist-current"));
224            },
225            setPlaylist: function (s) {
226                this._initPlaylist(s), this._init();
227            },
228            add: function (t, e) {
229                s(".ms_empty_queue").html(""),
230                    s(this.cssSelector.playlist + " ul")
231                        .append(this._createListItem(t))
232                        .find("li:last-child")
233                        .hide()
234                        .slideDown(this.options.playlistOptions.addTime),
235                    this._updateControls(),
236                    this.original.push(t),
237                    this.playlist.push(t),
238                    e ? this.play(this.playlist.length - 1) : 1 === this.original.length && this.select(0);
239            },
240            remove: function (e) {
241                var i = this;
242                return (
243                    1 === i.original.length && (s(".ms_player_wrapper").addClass("close_player"), s(".jp-now-playing").html("")),
244                    e === t
245                        ? (this._initPlaylist([]),
246                          this._refresh(function () {
247                              s(i.cssSelector.jPlayer).jPlayer("clearMedia");
248                          }),
249                          !0)
250                        : !this.removing &&
251                          ((e = 0 > e ? i.original.length + e : e) >= 0 &&
252                              e < this.playlist.length &&
253                              ((this.removing = !0),
254                              s(this.cssSelector.playlist + " li:nth-child(" + (e + 1) + ")").slide
254Up(this.options.playlistOptions.removeTime, function () {
255                                  if ((s(this).remove(), i.shuffled)) {
256                                      var t = i.playlist[e];
257                                      s.each(i.original, function (s) {
258                                          return i.original[s] === t ? (i.original.splice(s, 1), !1) : void 0;
259                                      }),
260                                          i.playlist.splice(e, 1);
261                                  } else i.original.splice(e, 1), i.playlist.splice(e, 1);
262                                  i.original.length
263                                      ? e === i.current
264                                          ? ((i.current = e < i.original.length ? i.current : i.original.length - 1), i.select(i.current))
265                                          : e < i.current && i.current--
266                                      : (s(i.cssSelector.jPlayer).jPlayer("clearMedia"), (i.current = 0), (i.shuffled = !1), i._updateControls()),
267                                      (i.removing = !1);
268                              })),
269                          !0)
270                );
271            },
272            select: function (t) {
273                (t = 0 > t ? this.original.length + t : t) >= 0 && t < this.playlist.length ? ((this.current = t), this._highlight(t), s(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current])) : (this.current = 0);
274            },
275            play: function (e, i) {
276                void 0 === i && (i = 0),
277                    (e = 0 > e ? this.original.length + e : e) >= 0 && e < this.playlist.length
278                        ? this.playlist.length && (this.select(e), s(this.cssSelector.jPlayer).jPlayer("play", i))
279                        : e === t && s(this.cssSelector.jPlayer).jPlayer("play", i);
280            },
281            pause: function () {
282                s(this.cssSelector.jPlayer).jPlayer("pause");
283            },
284            next: function () {
285                var s = this.current + 1 < this.playlist.length ? this.current + 1 : 0;
286                this.loop ? (0 === s && this.shuffled && this.options.playlistOptions.shuffleOnLoop && this.playlist.length > 1 ? this.shuffle(!0, !0) : this.play(s)) : s > 0 && this.play(s);
287            },
288            previous: function () {
289                var s = this.current - 1 >= 0 ? this.current - 1 : this.playlist.length - 1;
290                ((this.loop && this.options.playlistOptions.loopOnPrevious) || s < this.playlist.length - 1) && this.play(s);
291            },
292            shuffle: function (e, i) {
293                var l = this;
294                e === t && (e = !this.shuffled),
295                    (e || e !== this.shuffled) &&
296                        s(this.cssSelector.playlist + " ul").slideUp(this.options.playlistOptions.shuffleTime, function () {
297                            (l.shuffled = e),
298                                e
299                                    ? l.playlist.sort(function () {
300                                          return 0.5 - Math.random();
301                                      })
302                                    : l._originalPlaylist(),
303                                l._refresh(!0),
304                                i || !s(l.cssSelector.jPlayer).data("jPlayer").status.paused ? l.play(0) : l.select(0),
305                                s(this).slideDown(l.options.playlistOptions.shuffleTime);
306                        });
307            },
308            blur: function (t) {
309                s(this.cssSelector.jPlayer).jPlayer("option", "autoBlur") && s(t).blur();
310            },
311        });
312})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.