prososy listo
This commit is contained in:
@@ -37,6 +37,7 @@ use Dojo::Model::Data;
|
|||||||
|
|
||||||
# candy =======================================================================
|
# candy =======================================================================
|
||||||
$r->any('/json/candy/:command')->to('data#candy');
|
$r->any('/json/candy/:command')->to('data#candy');
|
||||||
|
$r->any('/candy')->to('home#candy');
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# admin =======================================================================
|
# admin =======================================================================
|
||||||
|
|||||||
@@ -30,30 +30,30 @@ sub candy{
|
|||||||
my $c=shift;
|
my $c=shift;
|
||||||
my $r="-1";
|
my $r="-1";
|
||||||
if (connectT()) {
|
if (connectT()) {
|
||||||
if ($c->param("command") =~/^isOn$/){ $r = isOn(); }
|
$r = isOn() if ($c->param("command") =~/^isOn$/);
|
||||||
elsif( $c->session("pmid") == 4 ){
|
|
||||||
$r = turnOn() if ($c->param("command") =~/^on$/);
|
$r = turnOn() if ($c->param("command") =~/^on$/);
|
||||||
$r = turnOff() if ($c->param("command") =~/^off$/);
|
$r = turnOff() if ($c->param("command") =~/^off$/);
|
||||||
}}
|
disconnectT();
|
||||||
|
}
|
||||||
else {$r="connection error";};
|
else {$r="connection error";};
|
||||||
$c->render(json => {a=>$r});
|
$c->render(json => {a=>$r});
|
||||||
|
# $c->render(json => {a=>$server_name});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub turnOff{
|
sub turnOff{
|
||||||
return 1 unless (isOn());
|
grep(/Result: true/,join('',sendT('host:deactivate("'.$server_name.'")')))?1:0
|
||||||
grep(/Result: true/,sendT("host:deactivate('$server_name')"))?1:0;
|
unless (isOn()==0);
|
||||||
}
|
}
|
||||||
sub turnOn{
|
sub turnOn{
|
||||||
return 1 unless (!isOn());
|
grep(/Result: true/,join('',sendT('host:activate("'.$server_name.'")')))?1:0
|
||||||
grep(/Result: true/,sendT("host:activate('$server_name')"))?1:0;
|
unless (isOn()==1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub isOn{ grep(/\s$server_name/,sendT("host:list()"))? 1:0; }
|
sub isOn{return grep(/\s$server_name/,sendT("host:list()"))? 1:0; }
|
||||||
|
|
||||||
sub sendT{
|
sub sendT{
|
||||||
commandT(shift);
|
commandT(shift);
|
||||||
my @r = $t->getlines(All=>0);
|
my @r = $t->getlines(All=>0);
|
||||||
disconnectT();
|
|
||||||
return @r
|
return @r
|
||||||
}
|
}
|
||||||
sub connectT{
|
sub connectT{
|
||||||
|
|||||||
@@ -100,6 +100,17 @@ sub tst{
|
|||||||
$c->stash($c->dbv->conf_radio);
|
$c->stash($c->dbv->conf_radio);
|
||||||
$c->stash(nick=>$c->session("nick"));
|
$c->stash(nick=>$c->session("nick"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub candy{
|
||||||
|
my $c=shift;
|
||||||
|
$c->stash( css=>["/ext/candy/libs.min.css","/home/candy/default.css"]);
|
||||||
|
$c->stash( js=>["/home/candy/loader.js","/ext/candy/libs.min.js","/ext/candy/candy.min.js"]);
|
||||||
|
|
||||||
|
$c->stash(layout=> "clean");
|
||||||
|
$c->stash($c->dbv->conf_chat);
|
||||||
|
$c->stash(nick=>$c->session("nick"));
|
||||||
|
}
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ sub new { bless {}, shift };
|
|||||||
sub conf_radio{
|
sub conf_radio{
|
||||||
return $Dojo::Conf::radio;
|
return $Dojo::Conf::radio;
|
||||||
}
|
}
|
||||||
|
sub conf_chat{
|
||||||
|
return $Dojo::Conf::chat;
|
||||||
|
}
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
# Read vdg admin ==============================================================
|
# Read vdg admin ==============================================================
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
d3.select("#clink").on("click",function(){
|
d3.select("#clink").on("click",function(){
|
||||||
var newWindow = window.open('candy','_blank');
|
var newWindow = window.open('/candy','_blank');
|
||||||
});
|
});
|
||||||
// revisa que llama dos veces a la pagina
|
// revisa que llama dos veces a la pagina
|
||||||
var ciface =" #exec candy_loader/candyInterface.pl&v=";
|
var ciface ="/json/candy/";
|
||||||
d3.json(ciface+"isOn" ,function(d){
|
d3.json(ciface+"isOn" ,function(d){
|
||||||
if(d != undefined){
|
if(d != undefined){
|
||||||
if (d.a==1) { on(); }
|
if (d.a==1) { on(); }
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ ul {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
background: url( #ext candy/res/img/tab-transitions.png) repeat-y left;
|
background: url(/ext/candy/res/img/tab-transitions.png) repeat-y left;
|
||||||
border-radius: 0 3px 0 0;
|
border-radius: 0 3px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chat-tabs .active .transition {
|
#chat-tabs .active .transition {
|
||||||
background: url( #ext candy/res/img/tab-transitions.png) repeat-y -50px;
|
background: url(/ext/candy/res/img/tab-transitions.png) repeat-y -50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-tabs .close:hover {
|
#chat-tabs .close:hover {
|
||||||
@@ -134,11 +134,11 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chat-toolbar #emoticons-icon {
|
#chat-toolbar #emoticons-icon {
|
||||||
background-image: url( #ext candy/res/img/action/emoticons.png);
|
background-image: url(/ext/candy/res/img/action/emoticons.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-toolbar .context {
|
#chat-toolbar .context {
|
||||||
background-image: url( #ext candy/res/img/action/settings.png);
|
background-image: url(/ext/candy/res/img/action/settings.png);
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,31 +147,31 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chat-sound-control {
|
#chat-sound-control {
|
||||||
background-image: url( #ext candy/res/img/action/sound-off.png);
|
background-image: url(/ext/candy/res/img/action/sound-off.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-sound-control.checked {
|
#chat-sound-control.checked {
|
||||||
background-image: url( #ext candy/res/img/action/sound-on.png);
|
background-image: url(/ext/candy/res/img/action/sound-on.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-autoscroll-control {
|
#chat-autoscroll-control {
|
||||||
background-image: url( #ext candy/res/img/action/autoscroll-off.png);
|
background-image: url(/ext/candy/res/img/action/autoscroll-off.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-autoscroll-control.checked {
|
#chat-autoscroll-control.checked {
|
||||||
background-image: url( #ext candy/res/img/action/autoscroll-on.png);
|
background-image: url(/ext/candy/res/img/action/autoscroll-on.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-statusmessage-control {
|
#chat-statusmessage-control {
|
||||||
background-image: url( #ext candy/res/img/action/statusmessage-off.png);
|
background-image: url(/ext/candy/res/img/action/statusmessage-off.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-statusmessage-control.checked {
|
#chat-statusmessage-control.checked {
|
||||||
background-image: url( #ext candy/res/img/action/statusmessage-on.png);
|
background-image: url(/ext/candy/res/img/action/statusmessage-on.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-toolbar .usercount {
|
#chat-toolbar .usercount {
|
||||||
background-image: url( #ext candy/res/img/action/usercount.png);
|
background-image: url(/ext/candy/res/img/action/usercount.png);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
width: auto;
|
width: auto;
|
||||||
@@ -259,17 +259,17 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.roster-pane li.role-moderator {
|
.roster-pane li.role-moderator {
|
||||||
background-image: url( #ext candy/res/img/roster/role-moderator.png);
|
background-image: url(/ext/candy/res/img/roster/role-moderator.png);
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.roster-pane li.affiliation-owner {
|
.roster-pane li.affiliation-owner {
|
||||||
background-image: url( #ext candy/res/img/roster/affiliation-owner.png);
|
background-image: url(/ext/candy/res/img/roster/affiliation-owner.png);
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.roster-pane li.ignore {
|
.roster-pane li.ignore {
|
||||||
background-image: url( #ext candy/res/img/roster/ignore.png);
|
background-image: url(/ext/candy/res/img/roster/ignore.png);
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.arrow {
|
||||||
background: url( #ext candy/res/img/tooltip-arrows.gif) no-repeat left bottom;
|
background: url(/ext/candy/res/img/tooltip-arrows.gif) no-repeat left bottom;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -536,27 +536,27 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .private {
|
#context-menu .private {
|
||||||
background-image: url( #ext candy/res/img/action/private.png);
|
background-image: url(/ext/candy/res/img/action/private.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .ignore {
|
#context-menu .ignore {
|
||||||
background-image: url( #ext candy/res/img/action/ignore.png);
|
background-image: url(/ext/candy/res/img/action/ignore.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .unignore {
|
#context-menu .unignore {
|
||||||
background-image: url( #ext candy/res/img/action/unignore.png);
|
background-image: url(/ext/candy/res/img/action/unignore.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .kick {
|
#context-menu .kick {
|
||||||
background-image: url( #ext candy/res/img/action/kick.png);
|
background-image: url(/ext/candy/res/img/action/kick.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .ban {
|
#context-menu .ban {
|
||||||
background-image: url( #ext candy/res/img/action/ban.png);
|
background-image: url(/ext/candy/res/img/action/ban.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .subject {
|
#context-menu .subject {
|
||||||
background-image: url( #ext candy/res/img/action/subject.png);
|
background-image: url(/ext/candy/res/img/action/subject.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu .emoticons {
|
#context-menu .emoticons {
|
||||||
@@ -602,7 +602,7 @@ ul {
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 90;
|
z-index: 90;
|
||||||
background-image: url( #ext candy/res/img/overlay.png);
|
background-image: url(/ext/candy/res/img/overlay.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-modal.modal-login {
|
#chat-modal.modal-login {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ window.onload = function(){
|
|||||||
debug: false,
|
debug: false,
|
||||||
autojoin: [chat_channel]
|
autojoin: [chat_channel]
|
||||||
},
|
},
|
||||||
view: { language: 'es', assets: 'ext/candy/res/'}
|
view: { language: 'es', assets: '/ext/candy/res/'}
|
||||||
});
|
});
|
||||||
Candy.Core.connect(chat_srv,null," <%= nick %>");
|
Candy.Core.connect(chat_srv,null,nick);
|
||||||
Candy.Core.onWindowUnload = function(){window.close();};
|
Candy.Core.onWindowUnload = function(){window.close();};
|
||||||
$(Candy).on("candy:view.connection.status-6",function(){
|
$(Candy).on("candy:view.connection.status-6",function(){
|
||||||
window.close();});
|
window.close();});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
d3.select("#clink").on("click",function(){
|
d3.select("#clink").on("click",function(){
|
||||||
var newWindow = window.open('ext/candy','_blank');
|
var newWindow = window.open('/candy','_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
checkChat();
|
checkChat();
|
||||||
|
|
||||||
function checkChat(){
|
function checkChat(){
|
||||||
d3.json("json/candy/candy_loader/candyInterface.pl&v=isOn",function(d){
|
d3.json("/json/candy/isOn",function(d){
|
||||||
if(d != undefined){
|
if(d != undefined){
|
||||||
if (d.a==1) { d3.select("#clink").style("visibility","visible");}
|
if (d.a==1) { d3.select("#clink").style("visibility","visible");}
|
||||||
else if (d.a==0) { d3.select("#clink").style("visibility","hidden");}
|
else if (d.a==0) { d3.select("#clink").style("visibility","hidden");}
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous">
|
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous">
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
const chat_addr= <%= $chat_addr %>;
|
|
||||||
const chat_srv= <%= $chat_srv %>;
|
|
||||||
const chat_channel= <%= $chat_channel %>;
|
|
||||||
</script>
|
|
||||||
<%= javascript "/ext/libs.min.js"; %>
|
|
||||||
<%= javascript "/ext/candy.min.js"; %>
|
|
||||||
<%= stylesheet "/ext/lib.min.css"; %>
|
|
||||||
|
|
||||||
<section id="schat" class="chat">
|
<section id="schat" class="chat">
|
||||||
<div id="candy"></div>
|
<div id="candy"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const nick="<%= $nick %>";
|
||||||
|
const chat_addr="<%= $chat_addr %>";
|
||||||
|
const chat_srv="<%= $chat_srv %>";
|
||||||
|
const chat_channel="<%= $chat_channel %>";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<section class="flex chat"><article>
|
<section class="flex chat"><article>
|
||||||
</section></article> </section>
|
</section></article> </section>
|
||||||
<script>
|
<script>
|
||||||
|
const nick="<%= $nick %>";
|
||||||
const radio_server="<%= $radio_server %>";
|
const radio_server="<%= $radio_server %>";
|
||||||
const listen_url="<%= $listen_url %>";
|
const listen_url="<%= $listen_url %>";
|
||||||
const channel="<%= $channel %>";
|
const channel="<%= $channel %>";
|
||||||
|
|||||||
19
templates/layouts/clean.html.ep
Normal file
19
templates/layouts/clean.html.ep
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><%= title %></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- <script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script> -->
|
||||||
|
<% map{%><%= stylesheet "$_"%><%}(@{stash('css')}) if defined(stash('css'));%>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<% map{%><%= include "$_"%><%}(@{stash('prepend')})
|
||||||
|
if defined(stash('prepend'));%>
|
||||||
|
<%= content %>
|
||||||
|
<% map{%><%= include "$_"%><%}(@{stash('apend')})
|
||||||
|
if defined(stash('apend'));%>
|
||||||
|
<% map{%><%= javascript "$_"%><%}(@{stash('js')}) if defined(stash('js'));%>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
Reference in New Issue
Block a user