From 0dabed6f073e47fac50f8479461b0785e204b9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Wed, 24 Jun 2015 20:07:29 +0200 Subject: [PATCH] gulp listener on remotecontroller too, and updated remotecontroller.js --- .htaccess | 4 ++-- php/controller.php | 9 ++++----- server/gulpfile.js | 12 ++++++++++++ server/server.js | 2 +- static/build-js/main-fp.js | 1 + static/build-js/main.js | 2 +- static/build-js/remotecontroller-min.js | 1 + static/js/remotecontroller.js | 14 +++++++------- 8 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 static/build-js/main-fp.js create mode 100644 static/build-js/remotecontroller-min.js diff --git a/.htaccess b/.htaccess index 105d8c48..fbb84555 100755 --- a/.htaccess +++ b/.htaccess @@ -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 ^remote/(.*) php/controller.php?id=$1 [L] diff --git a/php/controller.php b/php/controller.php index 83eea38c..4e6723de 100755 --- a/php/controller.php +++ b/php/controller.php @@ -80,13 +80,13 @@
- + - + - +
@@ -169,7 +169,6 @@ - - + diff --git a/server/gulpfile.js b/server/gulpfile.js index bc1e756e..90fdfeae 100644 --- a/server/gulpfile.js +++ b/server/gulpfile.js @@ -25,7 +25,19 @@ gulp.task('nochan', function () { .pipe(gulp.dest('../static/build-js')); }); +gulp.task('remotecontroller', function () { + gulp.src(['../static/js/remotecontroller.js']) + .pipe(uglify({ + mangle: true, + compress: true, + enclose: true + })) + .pipe(concat('remotecontroller-min.js')) + .pipe(gulp.dest('../static/build-js')); +}); + gulp.task('default', function(){ gulp.watch('../static/js/*.js', ['js']); gulp.watch('../static/js/nochan.js', ['nochan']); + gulp.watch('../static/js/remotecontroller.js', ['remotecontroller']); }); \ No newline at end of file diff --git a/server/server.js b/server/server.js index 53f8a6f2..3d82d056 100755 --- a/server/server.js +++ b/server/server.js @@ -4,7 +4,7 @@ var server; This if for the localhost running ******/ -localhost = false; +localhost = true; //https server if(localhost) diff --git a/static/build-js/main-fp.js b/static/build-js/main-fp.js new file mode 100644 index 00000000..b561e1a8 --- /dev/null +++ b/static/build-js/main-fp.js @@ -0,0 +1 @@ +!function(){function e(e){var n="",a=0;e.sort(t),pre_card=$(o);for(x in e){var i=e[x][3];if(20>a){var s=e[x][1],l=e[x][0],r="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",c=e[x][4],d=pre_card;d.find(".chan-name").text(i),d.find(".chan-name").attr("title",i),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",i),$("#channels").append(d.html())}n+="