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

View File

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

View File

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