Removed all global functions

This commit is contained in:
Kasper Rynning-Tønnesen
2015-12-10 20:23:30 +01:00
parent 25ce1db098
commit d9e2f7ab6c
6 changed files with 51 additions and 17 deletions

View File

@@ -22,7 +22,7 @@
<div class="brand-logo truncate zbrand"> <div class="brand-logo truncate zbrand">
<a href="/" class="hide-on-large-only">Zöff</a> <a href="/" class="hide-on-large-only">Zöff</a>
<span class="hide-on-large-only">/</span> <span class="hide-on-large-only">/</span>
<span id="chan" class="chan clickable" title="Show big URL" onclick="show()"><?php echo(ucfirst($list));?></span> <span id="chan" class="chan clickable" title="Show big URL"><?php echo(ucfirst($list));?></span>
</div> </div>
<ul class="title-container"> <ul class="title-container">
@@ -123,9 +123,9 @@
<div class="search-title truncate"></div> <div class="search-title truncate"></div>
<span class="result_info"></span> <span class="result_info"></span>
<a href="#add" class="waves-effect waves-orange btn-flat add-many" title="Add several videos"> <div class="waves-effect waves-orange btn-flat" id="add-many" title="Add several videos">
<i class="mdi-av-playlist-add"></i> <i class="mdi-av-playlist-add"></i>
</a> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -221,7 +221,7 @@
</span> </span>
</span> </span>
<div class="card-action center-align list-remove hide"> <div class="card-action center-align list-remove hide">
<a title="Remove song" id="del" onclick="vote('id','del')" class="waves-effect btn-flat clickable">Delete</a> <a title="Remove song" id="del" class="waves-effect btn-flat clickable">Delete</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -779,14 +779,14 @@ nav ul li:hover, nav ul li.active {
margin: 15px 20px; margin: 15px 20px;
} }
.result{height:100px;margin-left:40px;} .result{height:100px;margin-left:40px;}
.add-many{ #add-many{
float:right; float:right;
color:white; color:white;
} }
.add-many:hover{ #add-many:hover{
color:orange; color:orange;
} }
.add-many i{ line-height: 36px !important;} #add-many i{ line-height: 36px !important;}
#results{ #results{
background-color: rgba(0,0,0,0.8); background-color: rgba(0,0,0,0.8);
margin-top: -27px; margin-top: -27px;

File diff suppressed because one or more lines are too long

View File

@@ -219,10 +219,12 @@ var List = {
song.find(".list-title").text(video_title); song.find(".list-title").text(video_title);
song.find(".list-title").attr("title", video_title); song.find(".list-title").attr("title", video_title);
song.find(".list-votes").text(video_votes); song.find(".list-votes").text(video_votes);
song.find(".vote-container").attr("onclick", "vote('"+video_id+"','pos')"); //song.find(".vote-container").attr("onclick", "vote('"+video_id+"','pos')");
song.find(".vote-container").attr("data-video-id", video_id);
song.find(".list-image").attr(image_attr,video_thumb); song.find(".list-image").attr(image_attr,video_thumb);
song.find("#list-song").attr("id", video_id); song.find("#list-song").attr("id", video_id);
song.find("#del").attr("onclick", "vote('"+video_id+"', 'del')"); song.find("#del").attr("data-video-id", video_id);
//song.find("#del").attr("onclick", "vote('"+video_id+"', 'del')");
return song.html(); return song.html();
}, },

View File

@@ -53,9 +53,9 @@ socket.on("get_list", function(){
$(document).ready(function() $(document).ready(function()
{ {
window.vote = List.vote; //window.vote = List.vote;
window.submit = Search.submit; //window.submit = Search.submit;
window.submitAndClose = Search.submitAndClose; //window.submitAndClose = Search.submitAndClose;
if(!localStorage["list_update"] || localStorage["list_update"] != "13.06.15") if(!localStorage["list_update"] || localStorage["list_update"] != "13.06.15")
{ {
@@ -98,7 +98,6 @@ $(document).ready(function()
document.getElementById("search").blur(); document.getElementById("search").blur();
Youtube.readyLooks(); Youtube.readyLooks();
}else{ }else{
Chat.setup_chat_listener(chan); Chat.setup_chat_listener(chan);
Chat.allchat_listener(); Chat.allchat_listener();
Hostcontroller.host_listener(); Hostcontroller.host_listener();
@@ -243,6 +242,7 @@ $(".chat-tab").click(function(){
$("#text-chat-input").focus(); $("#text-chat-input").focus();
}); });
$("#skip").on("click", function(){ $("#skip").on("click", function(){
List.skip(); List.skip();
}); });
@@ -282,4 +282,30 @@ $("#admin-lock").on("click", function()
$("#closeSettings").on("click", function() $("#closeSettings").on("click", function()
{ {
Admin.hide_settings(); Admin.hide_settings();
});
$("#results").on( "click", "#temp-results", function(e){
if($(e.target).html() != $("<i class='mdi-av-playlist-add'></i>").html()){
var id = $(this).attr("data-video-id");
var title = $(this).attr("data-video-title");
var length = $(this).attr("data-video-length")
Search.submitAndClose(id, title, length);
}
});
$("#results").on( "click", "#add-many", function(e){
var id = $(this).attr("data-video-id");
var title = $(this).attr("data-video-title");
var length = $(this).attr("data-video-length")
Search.submit(id, title, length);
});
$("#wrapper").on( "click", ".vote-container", function(e){
var id = $(this).attr("data-video-id");
List.vote(id, "pos");
});
$("#wrapper").on( "click", "#del", function(e){
var id = $(this).attr("data-video-id");
List.vote(id, "del");
}); });

View File

@@ -81,8 +81,14 @@ var Search = {
songs.find(".search-title").text(title); songs.find(".search-title").text(title);
songs.find(".result_info").text(duration); songs.find(".result_info").text(duration);
songs.find(".thumb").attr("data-original", thumb); songs.find(".thumb").attr("data-original", thumb);
songs.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");"); //songs.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");");
$($(songs).find("div")[0]).attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");"); songs.find("#add-many").attr("data-video-id", id);
songs.find("#add-many").attr("data-video-title", enc_title);
songs.find("#add-many").attr("data-video-length", secs);
//$($(songs).find("div")[0]).attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");");
songs.find("#temp-results").attr("data-video-id", id);
songs.find("#temp-results").attr("data-video-title", enc_title);
songs.find("#temp-results").attr("data-video-length", secs);
//$($(songs).find("div")[0]).attr("id", id) //$($(songs).find("div")[0]).attr("id", id)
output += songs.html(); output += songs.html();