Search fixes #125, faster lazy-load image, detects localhost

This commit is contained in:
Nicolas A. Tonne
2015-07-08 22:23:31 +02:00
parent d85f59996a
commit eb53955a6b
7 changed files with 17 additions and 19 deletions

View File

@@ -5,8 +5,8 @@ RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#Comment out the two folling lines when running server locally to fix issues with localhost
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
#RewriteCond %{HTTPS} !=on
#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule (?i)^remote/(.*) php/controller.php?id=$1 [L]

View File

@@ -205,7 +205,7 @@
<div id="list-song" class="card left-align list-song">
<span class="clickable vote-container" title="Vote!">
<a class="clickable center-align votebg">
<span class="lazy card-image cardbg list-image" style="background-image:url('/static/images/loading.gif');"></span>
<span class="lazy card-image cardbg list-image" style="background-image:url('/static/images/loading.png');"></span>
</a>
<span class="card-content">
<span class="flow-text truncate list-title"></span>

View File

@@ -1,18 +1,6 @@
var server;
/******
This if for the localhost running
******/
localhost = false;
//https server
if(localhost)
{
var http = require('http');
server = http.createServer(app);
}else
{
try{
var fs = require('fs');
var privateKey = fs.readFileSync('/etc/apache2/ssl/private.key', 'utf8');
var certificate = fs.readFileSync('/etc/apache2/ssl/ssl.crt', 'utf8');
@@ -20,6 +8,13 @@ if(localhost)
var https = require('https');
server = https.createServer(credentials, app);
}
catch(err){
console.log("Starting without https (probably on localhost)");
if(err["errno"] != 34)console.log(err);
var http = require('http');
server = http.createServer(app);
}
var express = require('express');
var app = express();

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/images/loading.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

View File

@@ -31,6 +31,9 @@ var Search = {
if(Helper.contains($("#search_loader").attr("class").split(" "), "hide"))
$("#search_loader").removeClass("hide");
if(Helper.contains($("#results").attr("class").split(" "), "hide"))
$("#results").removeClass("hide");
$.ajax({
type: "GET",
url: yt_url,