Skip to content
Permalink
Browse files

Added session_terminal parameter

  • Loading branch information...
thesoultaker48 committed Sep 18, 2018
1 parent 3269df2 commit 6e0c49353a9bdc2a5441da5899f0052f2c64ce17
Showing with 21 additions and 20 deletions.
  1. +21 −20 templates/app_music/javascripts/app_music.js
@@ -6,9 +6,10 @@

class app_music {

constructor(terminal) {
constructor(play_terminal) {
this.container = '#app_music';
this.terminal = terminal;
this.play_terminal = play_terminal;
this.session_terminal = 'MAIN';

this.main_timer = null;
this.status_timer = null;
@@ -258,7 +259,7 @@ class app_music {
check_features(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=features'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=features'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -455,7 +456,7 @@ class app_music {
get_status(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=status'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=status'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -493,7 +494,7 @@ class app_music {
play(file, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=play&param='+encodeURIComponent(file)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=play&param='+encodeURIComponent(file)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -510,7 +511,7 @@ class app_music {
pause(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pause'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pause'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -527,7 +528,7 @@ class app_music {
stop(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=stop'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=stop'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -544,7 +545,7 @@ class app_music {
next(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=next'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=next'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -566,7 +567,7 @@ class app_music {
});
} else {
$.ajax({
url: '/popup/app_player.html?ajax=1&command=previous'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=previous'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -584,7 +585,7 @@ class app_music {
seek(position, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=seek&param='+parseInt(position, 10)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=seek&param='+parseInt(position, 10)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -601,7 +602,7 @@ class app_music {
set_volume(level, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=set_volume&param='+parseInt(level, 10)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=set_volume&param='+parseInt(level, 10)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -618,7 +619,7 @@ class app_music {
pl_get(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_get'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_get'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -643,7 +644,7 @@ class app_music {
pl_add(file, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_add&param='+encodeURIComponent(file)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_add&param='+encodeURIComponent(file)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -660,7 +661,7 @@ class app_music {
pl_delete(id, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_delete&param='+parseInt(id, 10)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_delete&param='+parseInt(id, 10)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -677,7 +678,7 @@ class app_music {
pl_empty(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_empty'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_empty'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -694,7 +695,7 @@ class app_music {
pl_play(id, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_play&param='+parseInt(id, 10)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_play&param='+parseInt(id, 10)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -711,7 +712,7 @@ class app_music {
pl_sort(order, callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_sort&param='+encodeURIComponent(file)+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_sort&param='+encodeURIComponent(file)+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -728,7 +729,7 @@ class app_music {
pl_random(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_random'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_random'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -745,7 +746,7 @@ class app_music {
pl_loop(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_loop'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_loop'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {
@@ -762,7 +763,7 @@ class app_music {
pl_repeat(callback) {
var _this = this;
$.ajax({
url: '/popup/app_player.html?ajax=1&command=pl_repeat'+(this.terminal.length>0?'&play_terminal='+this.terminal:''),
url: '/popup/app_player.html?ajax=1&command=pl_repeat'+(this.play_terminal.length>0?'&play_terminal='+this.play_terminal:'')+(this.session_terminal.length>0?'&session_terminal='+this.session_terminal:''),
dataType: 'json'
}).done(function(json) {
if(json.success) {

0 comments on commit 6e0c493

Please sign in to comment.
You can’t perform that action at this time.