mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Search fixes #125, faster lazy-load image, detects localhost
This commit is contained in:
@@ -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]
|
||||
@@ -19,4 +19,4 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule /(.*)$ /$1 [L]
|
||||
|
||||
Options -Indexes
|
||||
Options -Indexes
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
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
BIN
static/images/loading.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 786 B |
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user