Code adjustments

This commit is contained in:
Tobias Reich 2014-10-18 18:02:06 +02:00
parent 263eed3447
commit fbea4b4dac
4 changed files with 513 additions and 517 deletions

BIN
dist/main.js vendored

Binary file not shown.

BIN
dist/view.js vendored

Binary file not shown.

View File

@ -5,27 +5,27 @@
* @copyright 2014 by Tobias Reich * @copyright 2014 by Tobias Reich
*/ */
build = { build = {};
divider: function(title) { build.divider = function(title) {
return "<div class='divider fadeIn'><h1>" + title + "</h1></div>"; return "<div class='divider fadeIn'><h1>" + title + "</h1></div>";
}, },
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>";
}, },
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>";
}, },
album: function(albumJSON) { build.album = function(albumJSON) {
if (!albumJSON) return ""; if (!albumJSON) return "";
@ -68,7 +68,7 @@ build = {
}, },
photo: function(photoJSON) { build.photo = function(photoJSON) {
if (!photoJSON) return ""; if (!photoJSON) return "";
@ -103,7 +103,7 @@ build = {
}, },
imageview: function(photoJSON, size, visibleControls) { build.imageview = function(photoJSON, size, visibleControls) {
if (!photoJSON) return ""; if (!photoJSON) return "";
@ -140,7 +140,7 @@ build = {
}, },
no_content: function(typ) { build.no_content = function(typ) {
var no_content = ""; var no_content = "";
@ -157,7 +157,7 @@ build = {
}, },
modal: function(title, text, button, marginTop, closeButton) { build.modal = function(title, text, button, marginTop, closeButton) {
var modal = "", var modal = "",
custom_style = ""; custom_style = "";
@ -194,7 +194,7 @@ build = {
}, },
signInModal: function() { build.signInModal = function() {
var modal = ""; var modal = "";
@ -215,7 +215,7 @@ build = {
}, },
uploadModal: function(title, files) { build.uploadModal = function(title, files) {
var modal = ""; var modal = "";
@ -248,7 +248,7 @@ build = {
}, },
contextMenu: function(items) { build.contextMenu = function(items) {
var menu = ""; var menu = "";
@ -274,7 +274,7 @@ build = {
}, },
tags: function(tags, forView) { build.tags = function(tags, forView) {
var html = "", var html = "",
editTagsHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_tags"); editTagsHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_tags");
@ -302,7 +302,7 @@ build = {
}, },
infoboxPhoto: function(photoJSON, forView) { build.infoboxPhoto = function(photoJSON, forView) {
if (!photoJSON) return ""; if (!photoJSON) return "";
@ -407,7 +407,7 @@ build = {
}, },
infoboxAlbum: function(albumJSON, forView) { build.infoboxAlbum = function(albumJSON, forView) {
if (!albumJSON) return ""; if (!albumJSON) return "";
@ -493,5 +493,3 @@ build = {
return infobox; return infobox;
} }
};

View File

@ -5,63 +5,61 @@
* @copyright 2014 by Tobias Reich * @copyright 2014 by Tobias Reich
*/ */
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;
}, },
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;
}, },
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;
}, },
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;
}, },
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;
}, },
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;
}, },
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;
}, },
message: function() { visible.message = function() {
if ($('.message').length>0) return true; if ($('.message').length>0) return true;
else return false; else return false;
}, },
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;
}, },
contextMenu: function() { visible.contextMenu = function() {
if ($('.contextmenu').length>0) return true; if ($('.contextmenu').length>0) return true;
else return false; else return false;
}, },
multiselect: function() { visible.multiselect = function() {
if ($('#multiselect').length>0) return true; if ($('#multiselect').length>0) return true;
else return false; else return false;
} }
};