Browse Source

Merge pull request #435 from electerious/develop

Lychee 3.0.8
Tobias Reich 8 years ago
parent
commit
c21bc9a01f

File diff suppressed because it is too large
+ 0 - 0
dist/main.js


+ 7 - 0
docs/Changelog.md

@@ -1,3 +1,10 @@
+## v3.0.8
+
+Released December 20, 2015
+
+- `Improved` Lychee update site now with SSL (#317)
+- `Improved` Set undefined vars, remove unused vars and code that cannot be reached (Thanks @mattsches, #435)
+
 ## v3.0.7
 
 Released November 15, 2015

+ 0 - 2
index.html

@@ -6,8 +6,6 @@
 		<title>Lychee</title>
 
 		<meta name="author" content="Tobias Reich">
-		<meta name="keywords" content="">
-		<meta name="description" content="">
 
 		<link type="text/css" rel="stylesheet" href="dist/main.css">
 

+ 2 - 2
php/access/Guest.php

@@ -33,7 +33,7 @@ class Guest extends Access {
 
 			# Error
 			default:					exit('Error: Function not found! Please check the spelling of the called function.');
-										return false; break;
+										break;
 
 		}
 
@@ -177,4 +177,4 @@ class Guest extends Access {
 
 }
 
-?>
+?>

+ 1 - 1
php/modules/Album.php

@@ -195,7 +195,7 @@ class Album extends Module {
 		# Execute query
 		$albums = $this->database->query($query);
 		if (!$albums) {
-			Log::error($database, __METHOD__, __LINE__, 'Could not get all albums (' . $database->error . ')');
+			Log::error($this->database, __METHOD__, __LINE__, 'Could not get all albums (' . $this->database->error . ')');
 			exit('Error: ' . $this->database->error);
 		}
 

+ 1 - 0
php/modules/Database.php

@@ -277,6 +277,7 @@ if(!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
 		# This avoids problems with placeholders in user-input
 		# $skip = Number of placeholders which need to be skipped
 		$skip	= 0;
+		$temp   = '';
 		$num	= array(
 			'placeholder'	=> substr_count($query, '?'),
 			'data'			=> count($data)

+ 0 - 1
php/modules/Import.php

@@ -11,7 +11,6 @@ class Import extends Module {
 
 	private $database	= null;
 	private $settings	= null;
-	private $albumIDs	= null;
 
 	public function __construct($database, $plugins, $settings) {
 

+ 1 - 6
php/modules/Photo.php

@@ -486,8 +486,6 @@ class Photo extends Module {
 
 		if (extension_loaded('imagick')&&$this->settings['imagick']==='1') {
 
-			$rotateImage = 0;
-
 			switch ($info['orientation']) {
 
 				case 3:
@@ -535,7 +533,6 @@ class Photo extends Module {
 					break;
 
 				case 3:
-					$process	= true;
 					$sourceImg	= imagerotate($sourceImg, -180, 0);
 					break;
 
@@ -552,7 +549,6 @@ class Photo extends Module {
 					break;
 
 				case 6:
-					$process	= true;
 					$sourceImg	= imagerotate($sourceImg, -90, 0);
 					$newWidth	= $info['height'];
 					$newHeight	= $info['width'];
@@ -566,7 +562,6 @@ class Photo extends Module {
 					break;
 
 				case 8:
-					$process	= true;
 					$sourceImg	= imagerotate($sourceImg, 90, 0);
 					$newWidth	= $info['height'];
 					$newHeight	= $info['width'];
@@ -1251,4 +1246,4 @@ class Photo extends Module {
 
 }
 
-?>
+?>

+ 1 - 2
php/modules/Plugins.php

@@ -20,7 +20,6 @@ class Plugins implements \SplSubject {
 		if (!isset($files)) return false;
 
 		# Init vars
-		$plugins		= $this;
 		$this->files	= $files;
 
 		# Load plugins
@@ -92,4 +91,4 @@ class Plugins implements \SplSubject {
 
 }
 
-?>
+?>

+ 66 - 78
src/gulpfile.js

@@ -1,13 +1,13 @@
-var	gulp = require('gulp'),
+var	gulp    = require('gulp'),
 	plugins = require('gulp-load-plugins')(),
-	paths = {};
+	paths   = {}
 
 /* Error Handler -------------------------------- */
 
 var catchError = function(err) {
 
-	console.log(err.toString());
-	this.emit('end');
+	console.log(err.toString())
+	this.emit('end')
 
 }
 
@@ -38,41 +38,38 @@ paths.view = {
 
 gulp.task('view--js', function() {
 
-	var stream =
-		gulp.src(paths.view.js)
-			.pipe(plugins.concat('_view--javascript.js', {newLine: "\n"}))
-			.pipe(plugins.babel({ compact: true }))
-			.on('error', catchError)
-			.pipe(gulp.dest('../dist/'));
+	var babel = plugins.babel({
+		presets: ['es2015']
+	})
 
-	return stream;
+	return gulp.src(paths.view.js)
+	           .pipe(plugins.concat('_view--javascript.js', {newLine: "\n"}))
+	           .pipe(babel)
+	           .on('error', catchError)
+	           .pipe(gulp.dest('../dist/'))
 
-});
+})
 
 gulp.task('view--scripts', ['view--js'], function() {
 
-	var stream =
-		gulp.src(paths.view.scripts)
-			.pipe(plugins.concat('view.js', {newLine: "\n"}))
-			.pipe(plugins.uglify())
-			.on('error', catchError)
-			.pipe(gulp.dest('../dist/'));
+	return gulp.src(paths.view.scripts)
+	           .pipe(plugins.concat('view.js', {newLine: "\n"}))
+	           .pipe(plugins.uglify())
+	           .on('error', catchError)
+	           .pipe(gulp.dest('../dist/'))
 
-	return stream;
-
-});
+})
 
 gulp.task('view--svg', function() {
 
-	var stream =
-		gulp.src(paths.view.php)
-			.pipe(plugins.inject(gulp.src(paths.view.svg), {
-				starttag: '<!-- inject:svg -->',
-				transform: function(filePath, file) { return file.contents.toString('utf8') }
-			}))
-			.pipe(gulp.dest('../'));
+	return gulp.src(paths.view.php)
+	           .pipe(plugins.inject(gulp.src(paths.view.svg), {
+	           	starttag: '<!-- inject:svg -->',
+	           	transform: function(filePath, file) { return file.contents.toString('utf8') }
+	           }))
+	           .pipe(gulp.dest('../'))
 
- });
+ })
 
 /* Main ----------------------------------------- */
 
@@ -108,83 +105,74 @@ paths.main = {
 
 gulp.task('main--js', function() {
 
-	var stream =
-		gulp.src(paths.main.js)
-			.pipe(plugins.concat('_main--javascript.js', {newLine: "\n"}))
-			.pipe(plugins.babel({ compact: true }))
-			.on('error', catchError)
-			.pipe(gulp.dest('../dist/'));
+	var babel = plugins.babel({
+		presets: ['es2015']
+	})
 
-	return stream;
+	return gulp.src(paths.main.js)
+	           .pipe(plugins.concat('_main--javascript.js', {newLine: "\n"}))
+	           .pipe(babel)
+	           .on('error', catchError)
+	           .pipe(gulp.dest('../dist/'))
 
-});
+})
 
 gulp.task('main--scripts', ['main--js'], function() {
 
-	var stream =
-		gulp.src(paths.main.scripts)
-			.pipe(plugins.concat('main.js', {newLine: "\n"}))
-			.pipe(plugins.uglify())
-			.on('error', catchError)
-			.pipe(gulp.dest('../dist/'));
-
-	return stream;
+	return gulp.src(paths.main.scripts)
+	           .pipe(plugins.concat('main.js', {newLine: "\n"}))
+	           .pipe(plugins.uglify())
+	           .on('error', catchError)
+	           .pipe(gulp.dest('../dist/'))
 
-});
+})
 
 gulp.task('main--styles', function() {
 
-	var stream =
-		gulp.src(paths.main.styles)
-			.pipe(plugins.sass())
-			.on('error', catchError)
-			.pipe(plugins.concat('main.css', {newLine: "\n"}))
-			.pipe(plugins.autoprefixer('last 4 versions', '> 5%'))
-			.pipe(plugins.minifyCss())
-			.pipe(gulp.dest('../dist/'));
+	return gulp.src(paths.main.styles)
+	           .pipe(plugins.sass())
+	           .on('error', catchError)
+	           .pipe(plugins.concat('main.css', {newLine: "\n"}))
+	           .pipe(plugins.autoprefixer('last 4 versions', '> 5%'))
+	           .pipe(plugins.minifyCss())
+	           .pipe(gulp.dest('../dist/'))
 
-	return stream;
-
-});
+})
 
 gulp.task('main--svg', function() {
 
-	var stream =
-		gulp.src(paths.main.html)
-			.pipe(plugins.inject(gulp.src(paths.main.svg), {
-				starttag: '<!-- inject:svg -->',
-				transform: function(filePath, file) { return file.contents.toString('utf8') }
-			}))
-			.pipe(gulp.dest('../'));
+	return gulp.src(paths.main.html)
+	           .pipe(plugins.inject(gulp.src(paths.main.svg), {
+	           	starttag: '<!-- inject:svg -->',
+	           	transform: function(filePath, file) { return file.contents.toString('utf8') }
+	           }))
+	           .pipe(gulp.dest('../'))
 
- });
+ })
 
 /* Clean ----------------------------------------- */
 
 gulp.task('clean', function() {
 
-	var stream =
-		gulp.src('../dist/_*.*', { read: false })
-			.pipe(plugins.rimraf({ force: true }))
-			.on('error', catchError);
-
-	return stream;
+	return gulp.src('../dist/_*.*', { read: false })
+	           .pipe(plugins.rimraf({ force: true }))
+	           .on('error', catchError)
 
-});
+})
 
 /* Tasks ----------------------------------------- */
 
 gulp.task('default', ['view--svg', 'view--scripts', 'main--svg', 'main--scripts', 'main--styles'], function() {
 
-	gulp.start('clean');
+	gulp.start('clean')
 
-});
+})
 
 gulp.task('watch', ['default'], function() {
 
-	gulp.watch(paths.view.js,		['view--scripts']);
+	gulp.watch(paths.view.js, ['view--scripts'])
 
-	gulp.watch(paths.main.js,		['main--scripts']);
-	gulp.watch(paths.main.scss,		['main--styles']);
+	gulp.watch(paths.main.js, ['main--scripts'])
+	gulp.watch(paths.main.scss, ['main--styles'])
 
-});
+})

+ 5 - 4
src/package.json

@@ -10,17 +10,18 @@
     "url": "https://github.com/electerious/Lychee.git"
   },
   "devDependencies": {
+    "babel-preset-es2015": "^6.3.13",
     "basiccontext": "^3.5.0",
-    "basicmodal": "^3.1.7",
+    "basicmodal": "^3.3.0",
     "gulp": "^3.9.0",
     "gulp-autoprefixer": "3.1.0",
-    "gulp-babel": "^5.3.0",
+    "gulp-babel": "^6.1.1",
     "gulp-concat": "^2.6.0",
     "gulp-inject": "^3.0.0",
     "gulp-load-plugins": "^1.1.0",
-    "gulp-minify-css": "^1.2.1",
+    "gulp-minify-css": "^1.2.2",
     "gulp-rimraf": "^0.2.0",
-    "gulp-sass": "^2.1.0",
+    "gulp-sass": "^2.1.1",
     "gulp-uglify": "^1.5.1",
     "jquery": "^2.1.4",
     "mousetrap": "^1.5.3"

+ 4 - 4
src/scripts/lychee.js

@@ -6,10 +6,10 @@
 lychee = {
 
 	title           : document.title,
-	version         : '3.0.7',
-	version_code    : '030007',
+	version         : '3.0.8',
+	version_code    : '030008',
 
-	update_path     : 'http://lychee.electerious.com/version/index.php',
+	update_path     : '//update.electerious.com/index.json',
 	updateURL       : 'https://github.com/electerious/Lychee',
 	website         : 'http://lychee.electerious.com',
 
@@ -233,7 +233,7 @@ lychee.getUpdate = function() {
 
 	$.ajax({
 		url     : lychee.update_path,
-		success : function(data) { if (parseInt(data)>parseInt(lychee.version_code)) $('.version span').show() }
+		success : function(data) { if (data.lychee.version>parseInt(lychee.version_code)) $('.version span').show() },
 	})
 
 }

+ 0 - 2
view.php

@@ -6,8 +6,6 @@
 		<title>Lychee</title>
 
 		<meta name="author" content="Tobias Reich">
-		<meta name="keywords" content="">
-		<meta name="description" content="">
 
 		<!-- CSS -->
 		<link type="text/css" rel="stylesheet" href="dist/main.css">

Some files were not shown because too many files changed in this diff