Code adjustments

This commit is contained in:
Tobias Reich 2014-10-18 18:08:35 +02:00
parent fbea4b4dac
commit f882bac6f2
4 changed files with 200 additions and 202 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -11,19 +11,19 @@ build.divider = function(title) {
return "<div class='divider fadeIn'><h1>" + title + "</h1></div>"; return "<div class='divider fadeIn'><h1>" + title + "</h1></div>";
}, }
build.editIcon = function(id) { build.editIcon = function(id) {
return "<div id='" + id + "' class='edit'><a class='icon-pencil'></a></div>"; return "<div id='" + id + "' class='edit'><a class='icon-pencil'></a></div>";
}, }
build.multiselect = function(top, left) { build.multiselect = function(top, left) {
return "<div id='multiselect' style='top: " + top + "px; left: " + left + "px;'></div>"; return "<div id='multiselect' style='top: " + top + "px; left: " + left + "px;'></div>";
}, }
build.album = function(albumJSON) { build.album = function(albumJSON) {
@ -66,7 +66,7 @@ build.album = function(albumJSON) {
return album; return album;
}, }
build.photo = function(photoJSON) { build.photo = function(photoJSON) {
@ -101,7 +101,7 @@ build.photo = function(photoJSON) {
return photo; return photo;
}, }
build.imageview = function(photoJSON, size, visibleControls) { build.imageview = function(photoJSON, size, visibleControls) {
@ -138,7 +138,7 @@ build.imageview = function(photoJSON, size, visibleControls) {
return view; return view;
}, }
build.no_content = function(typ) { build.no_content = function(typ) {
@ -155,7 +155,7 @@ build.no_content = function(typ) {
return no_content; return no_content;
}, }
build.modal = function(title, text, button, marginTop, closeButton) { build.modal = function(title, text, button, marginTop, closeButton) {
@ -192,7 +192,7 @@ build.modal = function(title, text, button, marginTop, closeButton) {
return modal; return modal;
}, }
build.signInModal = function() { build.signInModal = function() {
@ -213,7 +213,7 @@ build.signInModal = function() {
return modal; return modal;
}, }
build.uploadModal = function(title, files) { build.uploadModal = function(title, files) {
@ -246,7 +246,7 @@ build.uploadModal = function(title, files) {
return modal; return modal;
}, }
build.contextMenu = function(items) { build.contextMenu = function(items) {
@ -272,7 +272,7 @@ build.contextMenu = function(items) {
return menu; return menu;
}, }
build.tags = function(tags, forView) { build.tags = function(tags, forView) {
@ -300,7 +300,7 @@ build.tags = function(tags, forView) {
return html; return html;
}, }
build.infoboxPhoto = function(photoJSON, forView) { build.infoboxPhoto = function(photoJSON, forView) {
@ -405,7 +405,7 @@ build.infoboxPhoto = function(photoJSON, forView) {
return infobox; return infobox;
}, }
build.infoboxAlbum = function(albumJSON, forView) { build.infoboxAlbum = function(albumJSON, forView) {

View File

@ -5,18 +5,18 @@
* @copyright 2014 by Tobias Reich * @copyright 2014 by Tobias Reich
*/ */
multiselect = { multiselect = {};
position: { multiselect.position = {
top: null, top: null,
right: null, right: null,
bottom: null, bottom: null,
left: null left: null
}, }
show: function(e) { multiselect.show = function(e) {
if (mobileBrowser()) return false; if (mobileBrowser()) return false;
if (lychee.publicMode) return false; if (lychee.publicMode) return false;
@ -34,9 +34,9 @@ multiselect = {
$('body').append(build.multiselect(multiselect.position.top, multiselect.position.left)); $('body').append(build.multiselect(multiselect.position.top, multiselect.position.left));
$(document).on('mousemove', multiselect.resize); $(document).on('mousemove', multiselect.resize);
}, }
selectAll: function() { multiselect.selectAll = function() {
var e, var e,
newWidth, newWidth,
@ -71,9 +71,9 @@ multiselect = {
multiselect.getSelection(e); multiselect.getSelection(e);
}, }
resize: function(e) { multiselect.resize = function(e) {
var mouse_x = e.pageX, var mouse_x = e.pageX,
mouse_y = e.pageY, mouse_y = e.pageY,
@ -131,15 +131,15 @@ multiselect = {
} }
}, }
stopResize: function() { multiselect.stopResize = function() {
$(document).off('mousemove'); $(document).off('mousemove');
}, }
getSize: function() { multiselect.getSize = function() {
if (!visible.multiselect()) return false; if (!visible.multiselect()) return false;
@ -150,9 +150,9 @@ multiselect = {
height: parseInt($('#multiselect').css('height').replace('px', '')) height: parseInt($('#multiselect').css('height').replace('px', ''))
}; };
}, }
getSelection: function(e) { multiselect.getSelection = function(e) {
var tolerance = 150, var tolerance = 150,
id, id,
@ -189,9 +189,9 @@ multiselect = {
else if (ids.length!==0&&visible.albums()) contextMenu.albumMulti(ids, e); else if (ids.length!==0&&visible.albums()) contextMenu.albumMulti(ids, e);
else multiselect.close(); else multiselect.close();
}, }
close: function() { multiselect.close = function() {
multiselect.stopResize(); multiselect.stopResize();
@ -205,6 +205,4 @@ multiselect = {
$('#multiselect').remove(); $('#multiselect').remove();
}, 300); }, 300);
} }
};

View File

@ -10,54 +10,54 @@ visible = {};
visible.albums = function() { visible.albums = function() {
if ($('#tools_albums').css('display')==='block') return true; if ($('#tools_albums').css('display')==='block') return true;
else return false; else return false;
}, }
visible.album = function() { visible.album = function() {
if ($('#tools_album').css('display')==='block') return true; if ($('#tools_album').css('display')==='block') return true;
else return false; else return false;
}, }
visible.photo = function() { visible.photo = function() {
if ($('#imageview.fadeIn').length>0) return true; if ($('#imageview.fadeIn').length>0) return true;
else return false; else return false;
}, }
visible.search = function() { visible.search = function() {
if (search.code!==null&&search.code!=='') return true; if (search.code!==null&&search.code!=='') return true;
else return false; else return false;
}, }
visible.infobox = function() { visible.infobox = function() {
if ($('#infobox.active').length>0) return true; if ($('#infobox.active').length>0) return true;
else return false; else return false;
}, }
visible.infoboxbutton = function() { visible.infoboxbutton = function() {
if (visible.albums()) return false; if (visible.albums()) return false;
if (visible.photo()) return true; if (visible.photo()) return true;
if (visible.album()&&$('#button_info_album:visible').length>0) return true; if (visible.album()&&$('#button_info_album:visible').length>0) return true;
else return false; else return false;
}, }
visible.controls = function() { visible.controls = function() {
if (lychee.loadingBar.css('opacity')<1) return false; if (lychee.loadingBar.css('opacity')<1) return false;
else return true; else return true;
}, }
visible.message = function() { visible.message = function() {
if ($('.message').length>0) return true; if ($('.message').length>0) return true;
else return false; else return false;
}, }
visible.signin = function() { visible.signin = function() {
if ($('.message .sign_in').length>0) return true; if ($('.message .sign_in').length>0) return true;
else return false; else return false;
}, }
visible.contextMenu = function() { visible.contextMenu = function() {
if ($('.contextmenu').length>0) return true; if ($('.contextmenu').length>0) return true;
else return false; else return false;
}, }
visible.multiselect = function() { visible.multiselect = function() {
if ($('#multiselect').length>0) return true; if ($('#multiselect').length>0) return true;