Merge pull request #435 from electerious/develop

Lychee 3.0.8
This commit is contained in:
Tobias Reich 2015-12-20 13:36:06 +01:00
commit c21bc9a01f
13 changed files with 88 additions and 102 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -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 ## v3.0.7
Released November 15, 2015 Released November 15, 2015

View File

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

View File

@ -33,7 +33,7 @@ class Guest extends Access {
# Error # Error
default: exit('Error: Function not found! Please check the spelling of the called function.'); 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 {
} }
?> ?>

View File

@ -195,7 +195,7 @@ class Album extends Module {
# Execute query # Execute query
$albums = $this->database->query($query); $albums = $this->database->query($query);
if (!$albums) { 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); exit('Error: ' . $this->database->error);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,10 +6,10 @@
lychee = { lychee = {
title : document.title, title : document.title,
version : '3.0.7', version : '3.0.8',
version_code : '030007', 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', updateURL : 'https://github.com/electerious/Lychee',
website : 'http://lychee.electerious.com', website : 'http://lychee.electerious.com',
@ -233,7 +233,7 @@ lychee.getUpdate = function() {
$.ajax({ $.ajax({
url : lychee.update_path, 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() },
}) })
} }

View File

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