diff --git a/.gitignore b/.gitignore index 95f0487..254c796 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,18 @@ -build/node_modules/ -build/bower_components/ +src/node_modules/ +src/bower_components/ -php/config.php data/config.php -uploads/import/* uploads/big/* +uploads/import/* +uploads/medium/* uploads/thumb/* plugins/* -etc/* -!uploads/import/index.html !uploads/big/index.html +!uploads/import/index.html +!uploads/medium/index.html !uploads/thumb/index.html -!plugins/check/ \ No newline at end of file + +!plugins/check/ +!plugins/displaylog/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6faff3d..cc00b9f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ When reporting a bug on GitHub, make sure you include the following information: - How to reproduce the issue (step-by-step) - What you have already tried - Output of the diagnostics (`plugins/check/index.php`) -- Browser and Browser version +- Browser and system version - Attach files when you have problems which specific photos ## Coding Guidelines diff --git a/Dockerfile b/Dockerfile index 43da1aa..29ab650 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,27 +4,31 @@ FROM ubuntu:14.04 RUN apt-get update RUN apt-get -y install git curl nano wget build-essential -# Install apache and PHP -RUN apt-get -y install apache2 mysql-server libapache2-mod-php5 -RUN apt-get -y install php5-mysql php5-gd php5-curl -#RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini +# Install Apache, PHP, MySQL, and ImageMagick +RUN apt-get -y install apache2 mysql-server libapache2-mod-php5 imagemagick +RUN apt-get -y install php5-mysql php5-gd php5-curl php5-imagick -# Decouple database from container -VOLUME ["/database"] - -# Configure the database to use our data dir -RUN sed -i -e "s/^datadir\s*=.*/datadir = \/database/" /etc/mysql/my.cnf +# Modify php.ini to contain the following settings: +# max_execution_time = 200 +# post_max_size = 100M +# upload_max_size = 100M +# upload_max_filesize = 20M +# memory_limit = 256M +RUN sed -i -e "s/^max_execution_time\s*=.*/max_execution_time = 200/" \ +-e "s/^post_max_size\s*=.*/post_max_size = 100M/" \ +-e "s/^upload_max_filesize\s*=.*/upload_max_filesize = 20M\nupload_max_size = 100M/" \ +-e "s/^memory_limit\s*=.*/memory_limit = 256M/" /etc/php5/apache2/php.ini # Link /var/www to /app directory RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html WORKDIR /app # Clone lychee -RUN git clone https://github.com/renfredxh/Lychee.git . +RUN git clone https://github.com/electerious/Lychee.git . # Set file permissions -RUN chown www-data:www-data /app -R +RUN chown -R www-data:www-data /app RUN chmod -R 777 uploads/ data/ EXPOSE 80 -CMD scripts/start +CMD src/commands/start \ No newline at end of file diff --git a/README.md b/README.md index f84aeff..a302adb 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ #### A great looking and easy-to-use Photo-Management-System. -![Lychee](http://l.electerious.com/uploads/big/136b4779d133a94666d5f0d151b8ea2f.png) -![Lychee](http://l.electerious.com/uploads/big/580f1300f884c330fa34b652decb0571.png) +![Lychee](http://l.electerious.com/uploads/big/68375288e048658e253a7c0c964f19b9.jpg) +![Lychee](http://l.electerious.com/uploads/big/198f237580ea004529ab7b6faad90274.jpg) Lychee is a free photo-management tool, which runs on your server or web-space. Installing is a matter of seconds. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. Try the [Live Demo](http://electerious.com/lychee_demo/) or read more on our [Website](http://lychee.electerious.com). @@ -39,6 +39,10 @@ In order to use the Dropbox import from your server, you need a valid drop-ins a Lychee supports [Twitter Cards](https://dev.twitter.com/docs/cards) and [Open Graph](http://opengraphprotocol.org) for shared images (not albums). In order to use Twitter Cards you need to request an approval for your domain. Simply share an image with Lychee, copy its link and paste it in [Twitters Card Validator](https://dev.twitter.com/docs/cards/validation/validator). +### Imagick + +Lychee uses [Imagick](http://www.imagemagick.org) when installed on your server. In this case you will benefit from a faster processing of your uploads, better looking thumbnails and intermediate sized images for small screen devices. You can disable the usage of [Imagick](http://www.imagemagick.org) in [the settings](docs/Settings.md). + ### Plugins and Extensions The plugin-system of Lychee allows you to execute scripts, when a certain action fires. Plugins are hooks, which are injected directly into Lychee. [Plugin documentation »](docs/Plugins.md) diff --git a/assets/img/no_images.svg b/assets/img/no_images.svg deleted file mode 100644 index 106c6e4..0000000 --- a/assets/img/no_images.svg +++ /dev/null @@ -1 +0,0 @@ -no_images \ No newline at end of file diff --git a/assets/img/password.svg b/assets/img/password.svg deleted file mode 100644 index 34bca5b..0000000 --- a/assets/img/password.svg +++ /dev/null @@ -1 +0,0 @@ -password \ No newline at end of file diff --git a/assets/js/_frameworks.js b/assets/js/_frameworks.js deleted file mode 100755 index 55b5696..0000000 --- a/assets/js/_frameworks.js +++ /dev/null @@ -1,17 +0,0 @@ -/* ToolTips */ -(function(c){function b(e,d){return(typeof e=="function")?(e.call(d)):e}function a(e,d){this.$element=c(e);this.options=d;this.enabled=true;this.fixTitle()}a.prototype={show:function(){var g=this.getTitle();if(g&&this.enabled){var f=this.tip();f.find(".tipsy-inner")[this.options.html?"html":"text"](g);f[0].className="tipsy";f.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var j=c.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}); -var d=f[0].offsetWidth,i=f[0].offsetHeight,h=b(this.options.gravity,this.$element[0]);var e;switch(h.charAt(0)){case"n":e={top:j.top+j.height+this.options.offset,left:j.left+j.width/2-d/2};break;case"s":e={top:j.top-i-this.options.offset,left:j.left+j.width/2-d/2};break;case"e":e={top:j.top+j.height/2-i/2,left:j.left-d-this.options.offset};break;case"w":e={top:j.top+j.height/2-i/2,left:j.left+j.width+this.options.offset};break}if(h.length==2){if(h.charAt(1)=="w"){e.left=j.left+j.width/2-15}else{e.left=j.left+j.width/2-d+15 -}}f.css(e).addClass("tipsy-"+h);f.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+h.charAt(0);if(this.options.className){f.addClass(b(this.options.className,this.$element[0]))}if(this.options.fade){f.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{f.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){c(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var d=this.$element; -if(d.attr("title")||typeof(d.attr("original-title"))!="string"){d.attr("original-title",d.attr("title")||"").removeAttr("title")}},getTitle:function(){var f,d=this.$element,e=this.options;this.fixTitle();var f,e=this.options;if(typeof e.title=="string"){f=d.attr(e.title=="title"?"original-title":e.title)}else{if(typeof e.title=="function"){f=e.title.call(d[0])}}f=(""+f).replace(/(^\s*|\s*$)/,"");return f||e.fallback},tip:function(){if(!this.$tip){this.$tip=c('
').html('
') -}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};c.fn.tipsy=function(h){if(h===true){return this.data("tipsy")}else{if(typeof h=="string"){var j=this.data("tipsy");if(j){j[h]()}return this}}h=c.extend({},c.fn.tipsy.defaults,h);function g(l){var m=c.data(l,"tipsy");if(!m){m=new a(l,c.fn.tipsy.elementOptions(l,h)); -c.data(l,"tipsy",m)}return m}function k(){var l=g(this);l.hoverState="in";if(h.delayIn==0){l.show()}else{l.fixTitle();setTimeout(function(){if(l.hoverState=="in"){l.show()}},h.delayIn)}}function f(){var l=g(this);l.hoverState="out";if(h.delayOut==0){l.hide()}else{setTimeout(function(){if(l.hoverState=="out"){l.hide()}},h.delayOut)}}if(!h.live){this.each(function(){g(this)})}if(h.trigger!="manual"){var d=h.live?"live":"bind",i=h.trigger=="hover"?"mouseenter":"focus",e=h.trigger=="hover"?"mouseleave":"blur"; -this[d](i,k)[d](e,f)}return this};c.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:0.8,title:"title",trigger:"hover"};c.fn.tipsy.elementOptions=function(e,d){return c.metadata?c.extend({},d,c(e).metadata()):d};c.fn.tipsy.autoNS=function(){return c(this).offset().top>(c(document).scrollTop()+c(window).height()/2)?"s":"n"};c.fn.tipsy.autoWE=function(){return c(this).offset().left>(c(document).scrollLeft()+c(window).width()/2)?"e":"w" -};c.fn.tipsy.autoBounds=function(e,d){return function(){var f={ns:d[0],ew:(d.length>1?d[1]:false)},i=c(document).scrollTop()+e,g=c(document).scrollLeft()+e,h=c(this);if(h.offset().top1){this.each(function(){var e=a(this);if(this.tagName.toLowerCase()=="img"&&e.attr("src")){var g=e.attr("src").replace(/\.(?!.*\.)/,d["retina-suffix"]+".");b(g,function(h){e.attr("src",h.src);var i=a("
").append(e.clone()).remove().html();if(!(/(width|height)=["']\d+["']/.test(i))){e.attr("width",h.width/2) -}})}if(d["retina-background"]){var f=e.css("background-image");if(/^url\(.*\)$/.test(f)){var g=f.substring(4,f.length-1).replace(/\.(?!.*\.)/,d["retina-suffix"]+".");b(g,function(h){e.css("background-image","url("+h.src+")");if(e.css("background-size")=="auto auto"){e.css("background-size",(h.width/2)+"px auto")}})}}})}}})(jQuery); \ No newline at end of file diff --git a/assets/js/album.js b/assets/js/album.js deleted file mode 100644 index 93eec83..0000000 --- a/assets/js/album.js +++ /dev/null @@ -1,400 +0,0 @@ -/** - * @name Album Module - * @description Takes care of every action an album can handle and execute. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -album = { - - json: null, - - getID: function() { - - var id; - - if (photo.json) id = photo.json.album; - else if (album.json) id = album.json.id; - else id = $(".album:hover, .album.active").attr("data-id"); - - // Search - if (!id) id = $(".album:hover, .album.active").attr("data-id"); - if (!id) id = $(".photo:hover, .photo.active").attr("data-album-id"); - - if (id) return id; - else return false; - - }, - - load: function(albumID, refresh) { - - var startTime, - params, - durationTime, - waitTime; - - password.get(albumID, function() { - - if (!refresh) { - loadingBar.show(); - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut"); - lychee.animate(".divider", "fadeOut"); - } - - startTime = new Date().getTime(); - - params = "getAlbum&albumID=" + albumID + "&password=" + password.value; - lychee.api(params, function(data) { - - if (data==="Warning: Album private!") { - if (document.location.hash.replace("#", "").split("/")[1]!=undefined) { - // Display photo only - lychee.setMode("view"); - } else { - // Album not public - lychee.content.show(); - lychee.goto(""); - } - return false; - } - - if (data==="Warning: Wrong password!") { - album.load(albumID, refresh); - return false; - } - - album.json = data; - - durationTime = (new Date().getTime() - startTime); - if (durationTime>300) waitTime = 0; else if (refresh) waitTime = 0; else waitTime = 300 - durationTime; - if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0; - - setTimeout(function() { - - view.album.init(); - - if (!refresh) { - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn"); - view.header.mode("album"); - } - - }, waitTime); - - }); - - }); - - }, - - parse: function() { - - if (!album.json.title) album.json.title = "Untitled"; - - }, - - add: function() { - - var title, - params, - buttons, - isNumber = function(n) { return !isNaN(parseFloat(n)) && isFinite(n) }; - - buttons = [ - ["Create Album", function() { - - title = $(".message input.text").val(); - - if (title.length===0) title = "Untitled"; - - modal.close(); - - params = "addAlbum&title=" + escape(encodeURI(title)); - lychee.api(params, function(data) { - - if (data===true) data = 1; // Avoid first album to be true - - if (data!==false&&isNumber(data)) { - albums.refresh(); - lychee.goto(data); - } else { - lychee.error(null, params, data); - } - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("New Album", "Enter a title for this album: ", buttons); - - }, - - delete: function(albumIDs) { - - var params, - buttons, - albumTitle; - - if (!albumIDs) return false; - if (albumIDs instanceof Array===false) albumIDs = [albumIDs]; - - buttons = [ - ["", function() { - - params = "deleteAlbum&albumIDs=" + albumIDs; - lychee.api(params, function(data) { - - if (visible.albums()) { - - albumIDs.forEach(function(id) { - albums.json.num--; - view.albums.content.delete(id); - delete albums.json.content[id]; - }); - - } else { - - albums.refresh(); - lychee.goto(""); - - } - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["", function() {}] - ]; - - if (albumIDs.toString()==="0") { - - buttons[0][0] = "Clear Unsorted"; - buttons[1][0] = "Keep Unsorted"; - - modal.show("Clear Unsorted", "Are you sure you want to delete all photos from 'Unsorted'?
This action can't be undone!", buttons); - - } else if (albumIDs.length===1) { - - buttons[0][0] = "Delete Album and Photos"; - buttons[1][0] = "Keep Album"; - - // Get title - if (album.json) albumTitle = album.json.title; - else if (albums.json) albumTitle = albums.json.content[albumIDs].title; - - modal.show("Delete Album", "Are you sure you want to delete the album '" + albumTitle + "' and all of the photos it contains? This action can't be undone!", buttons); - - } else { - - buttons[0][0] = "Delete Albums and Photos"; - buttons[1][0] = "Keep Albums"; - - modal.show("Delete Albums", "Are you sure you want to delete all " + albumIDs.length + " selected albums and all of the photos they contain? This action can't be undone!", buttons); - - } - - }, - - setTitle: function(albumIDs) { - - var oldTitle = "", - newTitle, - params, - buttons; - - if (!albumIDs) return false; - if (albumIDs instanceof Array===false) albumIDs = [albumIDs]; - - if (albumIDs.length===1) { - // Get old title if only one album is selected - if (album.json) oldTitle = album.json.title; - else if (albums.json) oldTitle = albums.json.content[albumIDs].title; - if (!oldTitle) oldTitle = ""; - oldTitle = oldTitle.replace("'", "'"); - } - - buttons = [ - ["Set Title", function() { - - // Get input - newTitle = $(".message input.text").val(); - - // Remove html from input - newTitle = lychee.removeHTML(newTitle); - - // Set to Untitled when empty - newTitle = (newTitle==="") ? "Untitled" : newTitle; - - if (visible.album()) { - - album.json.title = newTitle; - view.album.title(); - - if (albums.json) { - var id = albumIDs[0]; - albums.json.content[id].title = newTitle; - } - - } else if (visible.albums()) { - - albumIDs.forEach(function(id) { - albums.json.content[id].title = newTitle; - view.albums.content.title(id); - }); - - } - - params = "setAlbumTitle&albumIDs=" + albumIDs + "&title=" + escape(encodeURI(newTitle)); - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - if (albumIDs.length===1) modal.show("Set Title", "Enter a new title for this album: ", buttons); - else modal.show("Set Titles", "Enter a title for all " + albumIDs.length + " selected album: ", buttons); - - }, - - setDescription: function(photoID) { - - var oldDescription = album.json.description.replace("'", "'"), - description, - params, - buttons; - - buttons = [ - ["Set Description", function() { - - // Get input - description = $(".message input.text").val(); - - // Remove html from input - description = lychee.removeHTML(description); - - if (visible.album()) { - album.json.description = description; - view.album.description(); - } - - params = "setAlbumDescription&albumID=" + photoID + "&description=" + escape(encodeURI(description)); - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Set Description", "Please enter a description for this album: ", buttons); - - }, - - setPublic: function(albumID, e) { - - var params, - password = "", - listed = false, - downloadable = false; - - albums.refresh(); - - if (!visible.message()&&album.json.public==0) { - - modal.show("Share Album", "This album will be shared with the following properties:

Visible

Listed to visitors of your Lychee.

Downloadable

Visitors of your Lychee can download this album.

Password protected

Only accessible with a valid password.

", [["Share Album", function() { album.setPublic(album.getID(), e) }], ["Cancel", function() {}]], -170); - - $(".message .choice input[name='password']").on("change", function() { - - if ($(this).prop('checked')===true) $(".message .choice input.text").show(); - else $(".message .choice input.text").hide(); - - }); - - return true; - - } - - if (visible.message()) { - - if ($(".message .choice input[name='password']:checked").val()==="password") { - password = md5($(".message input.text").val()); - album.json.password = 1; - } else { - password = ""; - album.json.password = 0; - } - - if ($(".message .choice input[name='listed']:checked").val()==="listed") listed = true; - if ($(".message .choice input[name='downloadable']:checked").val()==="downloadable") downloadable = true; - - } - - params = "setAlbumPublic&albumID=" + albumID + "&password=" + password + "&visible=" + listed + "&downloadable=" + downloadable; - - if (visible.album()) { - - album.json.public = (album.json.public==0) ? 1 : 0; - album.json.password = (album.json.public==0) ? 0 : album.json.password; - - view.album.public(); - view.album.password(); - - if (album.json.public==1) contextMenu.shareAlbum(albumID, e); - - } - - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }, - - share: function(service) { - - var link = "", - url = location.href; - - switch (service) { - case 0: - link = "https://twitter.com/share?url=" + encodeURI(url); - break; - case 1: - link = "http://www.facebook.com/sharer.php?u=" + encodeURI(url) + "&t=" + encodeURI(album.json.title); - break; - case 2: - link = "mailto:?subject=" + encodeURI(album.json.title) + "&body=" + encodeURI(url); - break; - default: - link = ""; - break; - } - - if (link.length>5) location.href = link; - - }, - - getArchive: function(albumID) { - - var link, - url = "php/api.php?function=getAlbumArchive&albumID=" + albumID; - - if (location.href.indexOf("index.html")>0) link = location.href.replace(location.hash, "").replace("index.html", url); - else link = location.href.replace(location.hash, "") + url; - - if (lychee.publicMode) link += "&password=" + password.value; - - location.href = link; - - } - -}; \ No newline at end of file diff --git a/assets/js/albums.js b/assets/js/albums.js deleted file mode 100644 index dc57e54..0000000 --- a/assets/js/albums.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @name Albums Module - * @description Takes care of every action albums can handle and execute. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -albums = { - - json: null, - - load: function() { - - var startTime, - durationTime, - waitTime; - - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut"); - lychee.animate(".divider", "fadeOut"); - - startTime = new Date().getTime(); - - if(albums.json===null) { - - lychee.api("getAlbums", function(data) { - - /* Smart Albums */ - data.unsortedAlbum = { - id: 0, - title: "Unsorted", - sysdate: data.unsortedNum + " photos", - unsorted: 1, - thumb0: data.unsortedThumb0, - thumb1: data.unsortedThumb1, - thumb2: data.unsortedThumb2 - }; - - data.starredAlbum = { - id: "f", - title: "Starred", - sysdate: data.starredNum + " photos", - star: 1, - thumb0: data.starredThumb0, - thumb1: data.starredThumb1, - thumb2: data.starredThumb2 - }; - - data.publicAlbum = { - id: "s", - title: "Public", - sysdate: data.publicNum + " photos", - public: 1, - thumb0: data.publicThumb0, - thumb1: data.publicThumb1, - thumb2: data.publicThumb2 - }; - - data.recentAlbum = { - id: "r", - title: "Recent", - sysdate: data.recentNum + " photos", - recent: 1, - thumb0: data.recentThumb0, - thumb1: data.recentThumb1, - thumb2: data.recentThumb2 - }; - - albums.json = data; - - durationTime = (new Date().getTime() - startTime); - if (durationTime>300) waitTime = 0; else waitTime = 300 - durationTime; - if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0; - if (visible.album()&&lychee.content.html()==="") waitTime = 0; - - setTimeout(function() { - view.header.mode("albums"); - view.albums.init(); - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn"); - }, waitTime); - }); - - } else { - - setTimeout(function() { - view.header.mode("albums"); - view.albums.init(); - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn"); - }, 300); - - } - }, - - parse: function(album) { - - if (album.password&&lychee.publicMode) { - album.thumb0 = "assets/img/password.svg"; - album.thumb1 = "assets/img/password.svg"; - album.thumb2 = "assets/img/password.svg"; - } else { - if (!album.thumb0) album.thumb0 = "assets/img/no_images.svg"; - if (!album.thumb1) album.thumb1 = "assets/img/no_images.svg"; - if (!album.thumb2) album.thumb2 = "assets/img/no_images.svg"; - } - - }, - - refresh: function() { - - albums.json = null; - - } - -}; \ No newline at end of file diff --git a/assets/js/build.js b/assets/js/build.js deleted file mode 100644 index 9476761..0000000 --- a/assets/js/build.js +++ /dev/null @@ -1,489 +0,0 @@ -/** - * @name Build Module - * @description This module is used to generate HTML-Code. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -build = { - - divider: function(title) { - - return "

" + title + "

"; - - }, - - editIcon: function(id) { - - return "
"; - - }, - - multiselect: function(top, left) { - - return "
"; - - }, - - album: function(albumJSON) { - - if (!albumJSON) return ""; - - var album = "", - longTitle = "", - title = albumJSON.title, - typeThumb = ""; - - if (title!==null&&title.length>18) { - title = albumJSON.title.substr(0, 18) + "..."; - longTitle = albumJSON.title; - } - - if (albumJSON.thumb0.split('.').pop()==="svg") typeThumb = "nonretina"; - - album += "
"; - album += "thumb"; - album += "thumb"; - album += "thumb"; - album += "
"; - - if (albumJSON.password&&!lychee.publicMode) album += "

" + title + "

"; - else album += "

" + title + "

"; - - album += "" + albumJSON.sysdate + ""; - album += "
"; - - if (!lychee.publicMode) { - - if(albumJSON.star==1) album += ""; - if(albumJSON.public==1) album += ""; - if(albumJSON.unsorted==1) album += ""; - if(albumJSON.recent==1) album += ""; - - } - - album += "
"; - - return album; - - }, - - photo: function(photoJSON) { - - if (!photoJSON) return ""; - - var photo = "", - longTitle = "", - title = photoJSON.title; - - if (title!==null&&title.length>18) { - title = photoJSON.title.substr(0, 18) + "..."; - longTitle = photoJSON.title; - } - - photo += "
"; - photo += "thumb"; - photo += "
"; - photo += "

" + title + "

"; - - if (photoJSON.cameraDate==1) { - photo += "" + photoJSON.sysdate + ""; - } else { - photo += "" + photoJSON.sysdate + ""; - } - - photo += "
"; - - if (photoJSON.star==1) photo += ""; - if (!lychee.publicMode&&photoJSON.public==1&&album.json.public!=1) photo += ""; - - photo += "
"; - - return photo; - - }, - - imageview: function(photoJSON, isSmall, visibleControls) { - - if (!photoJSON) return ""; - - var view = ""; - - view += ""; - view += ""; - - if (isSmall) { - - if (visibleControls) - view += "
"; - else - view += "
"; - - } else { - - if (visibleControls) - view += "
"; - else - view += "
"; - - } - - return view; - - }, - - no_content: function(typ) { - - var no_content = ""; - - no_content += "
"; - no_content += ""; - - if (typ==="search") no_content += "

No results

"; - else if (typ==="share") no_content += "

No public albums

"; - else if (typ==="cog") no_content += "

No configuration

"; - - no_content += "
"; - - return no_content; - - }, - - modal: function(title, text, button, marginTop, closeButton) { - - var modal = "", - custom_style = ""; - - if (marginTop) custom_style = "style='margin-top: " + marginTop + "px;'"; - - modal += "
"; - modal += "
"; - modal += "

" + title + "

"; - - if (closeButton!==false) { - - modal += ""; - - } - - modal += "

" + text + "

"; - - $.each(button, function(index) { - - if (this[0]!=="") { - - if (index===0) modal += "" + this[0] + ""; - else modal += "" + this[0] + ""; - - } - - }); - - modal += "
"; - modal += "
"; - - return modal; - - }, - - signInModal: function() { - - var modal = ""; - - modal += "
"; - modal += "
"; - modal += "

Sign In

"; - modal += ""; - modal += ""; - modal += "
Version " + lychee.version + "Update available!
"; - modal += "Sign in"; - modal += "
"; - modal += "
"; - - return modal; - - }, - - uploadModal: function(title, files) { - - var modal = ""; - - modal += "
"; - modal += "
"; - modal += "

" + title + "

"; - modal += ""; - modal += "
"; - - for (var i = 0; i < files.length; i++) { - - if (files[i].name.length>40) files[i].name = files[i].name.substr(0, 17) + "..." + files[i].name.substr(files[i].name.length-20, 20); - - modal += "
"; - modal += "" + lychee.escapeHTML(files[i].name) + ""; - - if (files[i].supported===true) modal += ""; - else modal += "Not supported"; - - modal += "

"; - modal += "
"; - - } - - modal += "
"; - modal += "
"; - modal += "
"; - - return modal; - - }, - - contextMenu: function(items) { - - var menu = ""; - - menu += "
"; - menu += "
"; - menu += ""; - menu += ""; - - $.each(items, function(index) { - - if (items[index][0]==="separator"&&items[index][1]===-1) menu += ""; - else if (items[index][1]===-1) menu += ""; - else if (items[index][2]!=undefined) menu += ""; - else menu += ""; - - }); - - menu += ""; - menu += "
" + items[index][0] + "
" + items[index][0] + "
" + items[index][0] + "
"; - menu += "
"; - - return menu; - - }, - - tags: function(tags, forView) { - - var html = "", - editTagsHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_tags"); - - if (tags!=="") { - - tags = tags.split(","); - - tags.forEach(function(tag, index, array) { - - html += "" + tag + ""; - - }); - - html += editTagsHTML; - - } else { - - - html = "
No Tags" + editTagsHTML + "
"; - - } - - return html; - - }, - - infoboxPhoto: function(photoJSON, forView) { - - if (!photoJSON) return ""; - - var infobox = "", - public, - editTitleHTML, - editDescriptionHTML, - infos, - exifHash = ""; - - infobox += "

About

"; - infobox += "
"; - - switch (photoJSON.public) { - case "0": - public = "No"; - break; - case "1": - public = "Yes"; - break; - case "2": - public = "Yes (Album)"; - break; - default: - public = "-"; - break; - } - - editTitleHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_title"); - editDescriptionHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_description"); - - infos = [ - ["", "Basics"], - ["Title", photoJSON.title + editTitleHTML], - ["Uploaded", photoJSON.sysdate], - ["Description", photoJSON.description + editDescriptionHTML], - ["", "Image"], - ["Size", photoJSON.size], - ["Format", photoJSON.type], - ["Resolution", photoJSON.width + " x " + photoJSON.height], - ["Tags", build.tags(photoJSON.tags, forView)] - ]; - - exifHash = photoJSON.takestamp+photoJSON.make+photoJSON.model+photoJSON.shutter+photoJSON.aperture+photoJSON.focal+photoJSON.iso; - - if (exifHash!="0"&&exifHash!=="null") { - - infos = infos.concat([ - ["", "Camera"], - ["Captured", photoJSON.takedate], - ["Make", photoJSON.make], - ["Type/Model", photoJSON.model], - ["Shutter Speed", photoJSON.shutter], - ["Aperture", photoJSON.aperture], - ["Focal Length", photoJSON.focal], - ["ISO", photoJSON.iso] - ]); - - } - - infos = infos.concat([ - ["", "Share"], - ["Public", public] - ]); - - $.each(infos, function(index) { - - if (infos[index][1]===""||infos[index][1]===undefined||infos[index][1]===null) infos[index][1] = "-"; - - switch (infos[index][0]) { - - case "": // Separator - infobox += ""; - infobox += "

" + infos[index][1] + "

"; - infobox += ""; - break; - - case "Tags": // Tags - if (forView!==true&&!lychee.publicMode) { - infobox += "
"; - infobox += "

" + infos[index][0] + "

"; - infobox += "
" + infos[index][1] + "
"; - } - break; - - default: // Item - infobox += ""; - infobox += "" + infos[index][0] + ""; - infobox += "" + infos[index][1] + ""; - infobox += ""; - break; - - } - - }); - - infobox += ""; - infobox += "
"; - infobox += "
"; - - return infobox; - - }, - - infoboxAlbum: function(albumJSON, forView) { - - if (!albumJSON) return ""; - - var infobox = "", - public = "-", - password = "-", - downloadable = "-", - editTitleHTML, - editDescriptionHTML, - infos; - - infobox += "

About

"; - infobox += "
"; - - switch (albumJSON.public) { - case "0": - public = "No"; - break; - case "1": - public = "Yes"; - break; - } - - switch (albumJSON.password) { - case false: - password = "No"; - break; - case true: - password = "Yes"; - break; - } - - switch (albumJSON.downloadable) { - case "0": - downloadable = "No"; - break; - case "1": - downloadable = "Yes"; - break; - } - - editTitleHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_title_album"); - editDescriptionHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_description_album"); - - infos = [ - ["", "Basics"], - ["Title", albumJSON.title + editTitleHTML], - ["Description", albumJSON.description + editDescriptionHTML], - ["", "Album"], - ["Created", albumJSON.sysdate], - ["Images", albumJSON.num], - ["", "Share"], - ["Public", public], - ["Downloadable", downloadable], - ["Password", password] - ]; - - $.each(infos, function(index) { - - if (infos[index][1]===""||infos[index][1]===undefined||infos[index][1]===null) infos[index][1] = "-"; - - if (infos[index][0]==="") { - - infobox += ""; - infobox += "

" + infos[index][1] + "

"; - infobox += ""; - - } else { - - infobox += ""; - infobox += ""; - infobox += ""; - infobox += ""; - - } - - }); - - infobox += "
" + infos[index][0] + "" + infos[index][1] + "
"; - infobox += "
"; - infobox += "
"; - - return infobox; - - } - -}; \ No newline at end of file diff --git a/assets/js/contextMenu.js b/assets/js/contextMenu.js deleted file mode 100644 index 2800539..0000000 --- a/assets/js/contextMenu.js +++ /dev/null @@ -1,354 +0,0 @@ -/** - * @name ContextMenu Module - * @description This module is used for the context menu. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -contextMenu = { - - fns: null, - - show: function(items, mouse_x, mouse_y, orientation) { - - contextMenu.close(); - - $("body") - .css("overflow", "hidden") - .append(build.contextMenu(items)); - - // Do not leave the screen - if ((mouse_x+$(".contextmenu").outerWidth(true))>$("html").width()) orientation = "left"; - if ((mouse_y+$(".contextmenu").outerHeight(true))>$("html").height()) mouse_y -= (mouse_y+$(".contextmenu").outerHeight(true)-$("html").height()); - - if (mouse_x>$(document).width()) mouse_x = $(document).width(); - if (mouse_x<0) mouse_x = 0; - if (mouse_y>$(document).height()) mouse_y = $(document).height(); - if (mouse_y<0) mouse_y = 0; - - if (orientation==="left") mouse_x -= $(".contextmenu").outerWidth(true); - - if (mouse_x===null|| - mouse_x===undefined|| - isNaN(mouse_x)|| - mouse_y===null|| - mouse_y===undefined|| - isNaN(mouse_y)) { - mouse_x = "10px"; - mouse_y = "10px"; - } - - $(".contextmenu").css({ - "top": mouse_y, - "left": mouse_x, - "opacity": 0.98 - }); - - }, - - add: function(e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - upload.notify(); - - contextMenu.fns = [ - function() { $("#upload_files").click() }, - function() { upload.start.url() }, - function() { upload.start.dropbox() }, - function() { upload.start.server() }, - function() { album.add() } - ]; - - items = [ - [" Upload Photo", 0], - ["separator", -1], - [" Import from Link", 1], - [" Import from Dropbox", 2], - [" Import from Server", 3], - ["separator", -1], - [" New Album", 4] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "left"); - - }, - - settings: function(e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - contextMenu.fns = [ - function() { settings.setLogin() }, - function() { settings.setSorting() }, - function() { settings.setDropboxKey() }, - function() { window.open(lychee.website); }, - function() { window.open("plugins/check/"); }, - function() { window.open("plugins/displaylog/"); }, - function() { lychee.logout() } - ]; - - items = [ - [" Change Login", 0], - [" Change Sorting", 1], - [" Set Dropbox", 2], - ["separator", -1], - [" About Lychee", 3], - [" Diagnostics", 4], - [" Show Log", 5], - ["separator", -1], - [" Sign Out", 6] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - }, - - album: function(albumID, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - if (albumID==="0"||albumID==="f"||albumID==="s"||albumID==="r") return false; - - contextMenu.fns = [ - function() { album.setTitle([albumID]) }, - function() { album.delete([albumID]) } - ]; - - items = [ - [" Rename", 0], - [" Delete", 1] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - $(".album[data-id='" + albumID + "']").addClass("active"); - - }, - - albumMulti: function(albumIDs, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - multiselect.stopResize(); - - contextMenu.fns = [ - function() { album.setTitle(albumIDs) }, - function() { album.delete(albumIDs) }, - ]; - - items = [ - [" Rename All", 0], - [" Delete All", 1] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - }, - - photo: function(photoID, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - contextMenu.fns = [ - function() { photo.setStar([photoID]) }, - function() { photo.editTags([photoID]) }, - function() { photo.setTitle([photoID]) }, - function() { photo.duplicate([photoID]) }, - function() { contextMenu.move([photoID], e, "right") }, - function() { photo.delete([photoID]) } - ]; - - items = [ - [" Star", 0], - [" Tags", 1], - ["separator", -1], - [" Rename", 2], - [" Duplicate", 3], - [" Move", 4], - [" Delete", 5] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - $(".photo[data-id='" + photoID + "']").addClass("active"); - - }, - - photoMulti: function(photoIDs, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - multiselect.stopResize(); - - contextMenu.fns = [ - function() { photo.setStar(photoIDs) }, - function() { photo.editTags(photoIDs) }, - function() { photo.setTitle(photoIDs) }, - function() { photo.duplicate(photoIDs) }, - function() { contextMenu.move(photoIDs, e, "right") }, - function() { photo.delete(photoIDs) } - ]; - - items = [ - [" Star All", 0], - [" Tag All", 1], - ["separator", -1], - [" Rename All", 2], - [" Duplicate All", 3], - [" Move All", 4], - [" Delete All", 5] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - }, - - photoMore: function(photoID, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items; - - contextMenu.fns = [ - function() { window.open(photo.getDirectLink()) }, - function() { photo.getArchive(photoID) } - ]; - - items = [[" Full Photo", 0]]; - if ((album.json&&album.json.downloadable&&album.json.downloadable==="1"&&lychee.publicMode)||!lychee.publicMode) items.push([" Download", 1]); - - contextMenu.show(items, mouse_x, mouse_y, "right"); - - }, - - move: function(photoIDs, e, orientation) { - - var mouse_x = e.pageX, - mouse_y = e.pageY - $(document).scrollTop(), - items = []; - - contextMenu.close(true); - - if (album.getID()!=="0") { - items = [ - ["Unsorted", 0, "photo.setAlbum([" + photoIDs + "], 0)"], - ["separator", -1] - ]; - } - - lychee.api("getAlbums", function(data) { - - if (data.num===0) { - items = [["New Album", 0, "album.add()"]]; - } else { - $.each(data.content, function(index) { - if (this.id!=album.getID()) items.push([this.title, 0, "photo.setAlbum([" + photoIDs + "], " + this.id + ")"]); - }); - } - - if (!visible.photo()) contextMenu.show(items, mouse_x, mouse_y, "right"); - else contextMenu.show(items, mouse_x, mouse_y, "left"); - - }); - - }, - - sharePhoto: function(photoID, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY, - items, - link = ""; - - mouse_y -= $(document).scrollTop(); - - contextMenu.fns = [ - function() { photo.setPublic(photoID) }, - function() { photo.share(photoID, 0) }, - function() { photo.share(photoID, 1) }, - function() { photo.share(photoID, 2) }, - function() { photo.share(photoID, 3) }, - function() { window.open(photo.getDirectLink()) } - ]; - - link = photo.getViewLink(photoID); - if (photo.json.public==="2") link = location.href; - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - ["separator", -1], - [" Twitter", 1], - [" Facebook", 2], - [" Mail", 3], - [" Dropbox", 4], - [" Direct Link", 5] - ]; - - contextMenu.show(items, mouse_x, mouse_y, "left"); - $(".contextmenu input").focus().select(); - - }, - - shareAlbum: function(albumID, e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY, - items; - - mouse_y -= $(document).scrollTop(); - - contextMenu.fns = [ - function() { album.setPublic(albumID) }, - function() { album.share(0) }, - function() { album.share(1) }, - function() { album.share(2) }, - function() { password.remove(albumID) } - ]; - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - ["separator", -1], - [" Twitter", 1], - [" Facebook", 2], - [" Mail", 3], - ]; - - contextMenu.show(items, mouse_x, mouse_y, "left"); - $(".contextmenu input").focus().select(); - - }, - - close: function(leaveSelection) { - - if (!visible.contextMenu()) return false; - - contextMenu.fns = []; - - $(".contextmenu_bg, .contextmenu").remove(); - $("body").css("overflow", "auto"); - - if (leaveSelection!==true) { - $(".photo.active, .album.active").removeClass("active"); - if (visible.multiselect()) multiselect.close(); - } - - } - -}; \ No newline at end of file diff --git a/assets/js/init.js b/assets/js/init.js deleted file mode 100755 index 7b1acc0..0000000 --- a/assets/js/init.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @name Init Module - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -$(document).ready(function(){ - - /* Event Name */ - var event_name = (mobileBrowser()) ? "touchend" : "click"; - - /* Disable ContextMenu */ - $(document).bind("contextmenu", function(e) { e.preventDefault() }); - - /* Tooltips */ - if (!mobileBrowser()) $(".tools").tipsy({gravity: 'n', fade: false, delayIn: 0, opacity: 1}); - - /* Multiselect */ - $("#content").on("mousedown", multiselect.show); - $(document).on("mouseup", multiselect.getSelection); - - /* Header */ - $("#hostedwith").on(event_name, function() { window.open(lychee.website) }); - $("#button_signin").on(event_name, lychee.loginDialog); - $("#button_settings").on("click", contextMenu.settings); - $("#button_share").on(event_name, function(e) { - if (photo.json.public==1||photo.json.public==2) contextMenu.sharePhoto(photo.getID(), e); - else photo.setPublic(photo.getID(), e); - }); - $("#button_share_album").on(event_name, function(e) { - if (album.json.public==1) contextMenu.shareAlbum(album.getID(), e); - else album.setPublic(album.getID(), e); - }); - $("#button_more").on(event_name, function(e) { contextMenu.photoMore(photo.getID(), e) }); - $("#button_trash_album").on(event_name, function() { album.delete([album.getID()]) }); - $("#button_move").on(event_name, function(e) { contextMenu.move([photo.getID()], e) }); - $("#button_trash").on(event_name, function() { photo.delete([photo.getID()]) }); - $("#button_info_album").on(event_name, function() { view.infobox.show() }); - $("#button_info").on(event_name, function() { view.infobox.show() }); - $("#button_archive").on(event_name, function() { album.getArchive(album.getID()) }); - $("#button_star").on(event_name, function() { photo.setStar([photo.getID()]) }); - - /* Search */ - $("#search").on("keyup click", function() { search.find($(this).val()) }); - - /* Clear Search */ - $("#clearSearch").on(event_name, function () { - $("#search").focus(); - search.reset(); - }); - - /* Back Buttons */ - $("#button_back_home").on(event_name, function() { lychee.goto("") }); - $("#button_back").on(event_name, function() { lychee.goto(album.getID()) }); - - /* Image View */ - lychee.imageview - .on(event_name, ".arrow_wrapper.previous", photo.previous) - .on(event_name, ".arrow_wrapper.next", photo.next); - - /* Infobox */ - $("#infobox") - .on(event_name, ".header a", function() { view.infobox.hide() }) - .on(event_name, "#edit_title_album", function() { album.setTitle([album.getID()]) }) - .on(event_name, "#edit_description_album", function() { album.setDescription(album.getID()) }) - .on(event_name, "#edit_title", function() { photo.setTitle([photo.getID()]) }) - .on(event_name, "#edit_description", function() { photo.setDescription(photo.getID()) }) - .on(event_name, "#edit_tags", function() { photo.editTags([photo.getID()]) }) - .on(event_name, "#tags .tag span", function() { photo.deleteTag(photo.getID(), $(this).data('index')) }); - - /* Keyboard */ - Mousetrap - .bind('left', function() { if (visible.photo()) $("#imageview a#previous").click() }) - .bind('right', function() { if (visible.photo()) $("#imageview a#next").click() }) - .bind(['u', 'ctrl+u'], function() { $("#upload_files").click() }) - .bind(['s', 'ctrl+s', 'f', 'ctrl+f'], function(e) { - if (visible.photo()) { - $("#button_star").click(); - } else if (visible.albums()) { - e.preventDefault(); - $("#search").focus(); - } - }) - .bind(['r', 'ctrl+r'], function(e) { - e.preventDefault(); - if (visible.album()) album.setTitle(album.getID()); - else if (visible.photo()) photo.setTitle([photo.getID()]); - }) - .bind(['d', 'ctrl+d'], function(e) { - e.preventDefault(); - if (visible.photo()) photo.setDescription(photo.getID()); - else if (visible.album()) album.setDescription(album.getID()); - }) - .bind(['t', 'ctrl+t'], function(e) { - if (visible.photo()) { - e.preventDefault(); - photo.editTags([photo.getID()]); - } - }) - .bind(['i', 'ctrl+i'], function() { - if (visible.infobox()) view.infobox.hide(); - else if (visible.multiselect()) return false; - else if (visible.infoboxbutton()) view.infobox.show(); - }) - .bind(['command+backspace', 'ctrl+backspace'], function() { - if (visible.photo()&&!visible.message()) photo.delete([photo.getID()]); - else if (visible.album()&&!visible.message()) album.delete([album.getID()]); - }) - .bind(['command+a', 'ctrl+a'], function() { - if (visible.album()&&!visible.message()) multiselect.selectAll(); - else if (visible.albums()&&!visible.message()) multiselect.selectAll(); - }); - - Mousetrap.bindGlobal('enter', function() { - if ($(".message .button.active").length) $(".message .button.active").addClass("pressed").click() - }); - - Mousetrap.bindGlobal(['esc', 'command+up'], function(e) { - e.preventDefault(); - if (visible.message()&&$(".message .close").length>0) modal.close(); - else if (visible.contextMenu()) contextMenu.close(); - else if (visible.infobox()) view.infobox.hide(); - else if (visible.photo()) lychee.goto(album.getID()); - else if (visible.album()) lychee.goto(""); - else if (visible.albums()&&$("#search").val().length!==0) search.reset(); - }); - - - if (mobileBrowser()) { - - $(document) - - /* Fullscreen on mobile */ - .on('touchend', '#image', function(e) { - if (swipe.obj===null||(swipe.offset>=-5&&swipe.offset<=5)) { - if (visible.controls()) view.header.hide(e, 0); - else view.header.show(); - } - }) - - /* Swipe on mobile */ - .swipe().on('swipeStart', function() { if (visible.photo()) swipe.start($("#image")) }) - .swipe().on('swipeMove', function(e) { if (visible.photo()) swipe.move(e.swipe) }) - .swipe().on('swipeEnd', function(e) { if (visible.photo()) swipe.stop(e.swipe, photo.previous, photo.next) }); - - } - - /* Document */ - $(document) - - /* Login */ - .on("keyup", "#password", function() { if ($(this).val().length>0) $(this).removeClass("error") }) - - /* Header */ - .on(event_name, "#title.editable", function() { - if (visible.photo()) photo.setTitle([photo.getID()]); - else album.setTitle([album.getID()]); - }) - - /* Navigation */ - .on("click", ".album", function() { lychee.goto($(this).attr("data-id")) }) - .on("click", ".photo", function() { lychee.goto(album.getID() + "/" + $(this).attr("data-id")) }) - - /* Modal */ - .on(event_name, ".message .close", modal.close) - .on(event_name, ".message .button:first", function() { if (modal.fns!==null) modal.fns[0](); if (!visible.signin()) modal.close() }) - .on(event_name, ".message .button:last", function() { if (modal.fns!==null) modal.fns[1](); if (!visible.signin()) modal.close() }) - - /* Add Dialog */ - .on(event_name, ".button_add", function(e) { contextMenu.add(e) }) - - /* Context Menu */ - .on("contextmenu", ".photo", function(e) { contextMenu.photo(photo.getID(), e) }) - .on("contextmenu", ".album", function(e) { contextMenu.album(album.getID(), e) }) - .on(event_name, ".contextmenu_bg", contextMenu.close) - .on("contextmenu", ".contextmenu_bg", contextMenu.close) - - /* Infobox */ - .on(event_name, "#infobox_overlay", view.infobox.hide) - - /* Upload */ - .on("change", "#upload_files", function() { modal.close(); upload.start.local(this.files) }) - .on(event_name, ".upload_message a.close", upload.close) - .on("dragover", function(e) { e.preventDefault(); }, false) - .on("drop", function(e) { - - e.stopPropagation(); - e.preventDefault(); - - // Close open overlays or views which are correlating with the upload - if (visible.photo()) lychee.goto(album.getID()); - if (visible.contextMenu()) contextMenu.close(); - - // Detect if dropped item is a file or a link - if (e.originalEvent.dataTransfer.files.length>0) upload.start.local(e.originalEvent.dataTransfer.files); - else if (e.originalEvent.dataTransfer.getData('Text').length>3) upload.start.url(e.originalEvent.dataTransfer.getData('Text')); - - return true; - - }); - - /* Init */ - lychee.init(); - -}); \ No newline at end of file diff --git a/assets/js/loadingBar.js b/assets/js/loadingBar.js deleted file mode 100755 index 5c8e71c..0000000 --- a/assets/js/loadingBar.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @name LoadingBar Module - * @description This module is used to show and hide the loading bar. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -loadingBar = { - - status: null, - - show: function(status, errorText) { - - if (status==='error') { - - // Set status - loadingBar.status = 'error'; - - // Parse text - if (errorText) errorText = errorText.replace('
', ''); - if (!errorText) errorText = 'Whoops, it looks like something went wrong. Please reload the site and try again!'; - - // Move header down - if (visible.controls()) lychee.header.addClass('error'); - - // Modify loading - lychee.loadingBar - .removeClass('loading uploading error') - .addClass(status) - .html('

Error: ' + errorText + '

') - .show() - .css('height', '40px'); - - // Set timeout - clearTimeout(lychee.loadingBar.data('timeout')); - lychee.loadingBar.data('timeout', setTimeout(function() { loadingBar.hide(true) }, 3000)); - - return true; - - } - - if (loadingBar.status===null) { - - // Set status - loadingBar.status = 'loading'; - - // Set timeout - clearTimeout(lychee.loadingBar.data('timeout')); - lychee.loadingBar.data('timeout', setTimeout(function() { - - // Move header down - if (visible.controls()) lychee.header.addClass('loading'); - - // Modify loading - lychee.loadingBar - .removeClass('loading uploading error') - .addClass('loading') - .show(); - - }, 1000)); - - return true; - - } - - }, - - hide: function(force) { - - if ((loadingBar.status!=='error'&&loadingBar.status!==null)||force) { - - // Remove status - loadingBar.status = null; - - // Move header up - if (visible.controls()) lychee.header.removeClass('error loading'); - - // Modify loading - lychee.loadingBar - .html('') - .css('height', '3px'); - - // Set timeout - clearTimeout(lychee.loadingBar.data('timeout')); - setTimeout(function() { lychee.loadingBar.hide() }, 300); - - } - - } - -}; \ No newline at end of file diff --git a/assets/js/lychee.js b/assets/js/lychee.js deleted file mode 100644 index 445aa1c..0000000 --- a/assets/js/lychee.js +++ /dev/null @@ -1,377 +0,0 @@ -/** - * @name Lychee Module - * @description This module provides the basic functions of Lychee. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -var lychee = { - - title: "", - version: "2.6.3", - version_code: "020603", - - api_path: "php/api.php", - update_path: "http://lychee.electerious.com/version/index.php", - updateURL: "https://github.com/electerious/Lychee", - website: "http://lychee.electerious.com", - - publicMode: false, - viewMode: false, - debugMode: false, - - username: "", - checkForUpdates: false, - sorting: "", - location: "", - - dropbox: false, - dropboxKey: '', - - loadingBar: $("#loading"), - header: $("header"), - content: $("#content"), - imageview: $("#imageview"), - infobox: $("#infobox"), - - init: function() { - - var params; - - params = "init&version=" + lychee.version_code; - lychee.api(params, function(data) { - - if (data.loggedIn!==true) { - lychee.setMode("public"); - } else { - lychee.username = data.config.username || ''; - lychee.sorting = data.config.sorting || ''; - lychee.dropboxKey = data.config.dropboxKey || ''; - lychee.location = data.config.location || ''; - } - - // No configuration - if (data==="Warning: No configuration!") { - lychee.header.hide(); - lychee.content.hide(); - $("body").append(build.no_content("cog")); - settings.createConfig(); - return true; - } - - // No login - if (data.config.login===false) { - settings.createLogin(); - } - - lychee.checkForUpdates = data.config.checkForUpdates; - $(window).bind("popstate", lychee.load); - lychee.load(); - - }); - - }, - - api: function(params, callback, loading) { - - if (loading===undefined) loadingBar.show(); - - $.ajax({ - type: "POST", - url: lychee.api_path, - data: "function=" + params, - dataType: "text", - success: function(data) { - - setTimeout(function() { loadingBar.hide() }, 100); - - if (typeof data==="string"&&data.substring(0, 7)==="Error: ") { - lychee.error(data.substring(7, data.length), params, data); - upload.close(true); - return false; - } - - if (data==="1") data = true; - else if (data==="") data = false; - - if (typeof data==="string"&&data.substring(0, 1)==="{"&&data.substring(data.length-1, data.length)==="}") data = $.parseJSON(data); - - if (lychee.debugMode) console.log(data); - - callback(data); - - }, - error: function(jqXHR, textStatus, errorThrown) { - - lychee.error("Server error or API not found.", params, errorThrown); - upload.close(true); - - } - }); - - }, - - login: function() { - - var user = $("input#username").val(), - password = md5($("input#password").val()), - params; - - params = "login&user=" + user + "&password=" + password; - lychee.api(params, function(data) { - - if (data===true) { - - // Use 'try' to catch a thrown error when Safari is in private mode - try { localStorage.setItem("lychee_username", user); } - catch (err) {} - - window.location.reload(); - - } else { - - // Show error and reactive button - $("#password").val("").addClass("error").focus(); - $(".message .button.active").removeClass("pressed"); - - } - - }); - - }, - - loginDialog: function() { - - var local_username; - - $("body").append(build.signInModal()); - $("#username").focus(); - if (localStorage) { - local_username = localStorage.getItem("lychee_username"); - if (local_username!==null) { - if (local_username.length>0) $("#username").val(local_username); - $("#password").focus(); - } - } - if (lychee.checkForUpdates==="1") lychee.getUpdate(); - - }, - - logout: function() { - - lychee.api("logout", function() { - window.location.reload(); - }); - - }, - - goto: function(url) { - - if (url===undefined) url = "#"; - else url = "#" + url; - - history.pushState(null, null, url); - lychee.load(); - - }, - - load: function() { - - var albumID = "", - photoID = "", - hash = document.location.hash.replace("#", "").split("/"); - - $(".no_content").remove(); - contextMenu.close(); - multiselect.close(); - - if (hash[0]!==undefined) albumID = hash[0]; - if (hash[1]!==undefined) photoID = hash[1]; - - if (albumID&&photoID) { - - // Trash data - photo.json = null; - - // Show Photo - if (lychee.content.html()===""||($("#search").length&&$("#search").val().length!==0)) { - lychee.content.hide(); - album.load(albumID, true); - } - photo.load(photoID, albumID); - - } else if (albumID) { - - // Trash data - photo.json = null; - - // Show Album - if (visible.photo()) view.photo.hide(); - if (album.json&&albumID==album.json.id) view.album.title(); - else album.load(albumID); - - } else { - - // Trash data - album.json = null; - photo.json = null; - search.code = ""; - - // Show Albums - if (visible.album()) view.album.hide(); - if (visible.photo()) view.photo.hide(); - albums.load(); - - } - - }, - - getUpdate: function() { - - $.ajax({ - url: lychee.update_path, - success: function(data) { if (parseInt(data)>parseInt(lychee.version_code)) $("#version span").show(); } - }); - - }, - - setTitle: function(title, editable) { - - if (lychee.title==="") lychee.title = document.title; - - if (title==="Albums") document.title = lychee.title; - else document.title = lychee.title + " - " + title; - - if (editable) $("#title").addClass("editable"); - else $("#title").removeClass("editable"); - - $("#title").html(title); - - }, - - setMode: function(mode) { - - $("#button_settings, #button_settings, #button_search, #search, #button_trash_album, #button_share_album, .button_add, .button_divider").remove(); - $("#button_trash, #button_move, #button_share, #button_star").remove(); - - $(document) - .on("mouseenter", "#title.editable", function() { $(this).removeClass("editable") }) - .off("click", "#title.editable") - .off("touchend", "#title.editable") - .off("contextmenu", ".photo") - .off("contextmenu", ".album") - .off("drop"); - - Mousetrap - .unbind(['u', 'ctrl+u']) - .unbind(['s', 'ctrl+s']) - .unbind(['r', 'ctrl+r']) - .unbind(['d', 'ctrl+d']) - .unbind(['t', 'ctrl+t']) - .unbind(['command+backspace', 'ctrl+backspace']); - - if (mode==="public") { - - $("header #button_signin, header #hostedwith").show(); - lychee.publicMode = true; - - } else if (mode==="view") { - - Mousetrap.unbind('esc'); - $("#button_back, a#next, a#previous").remove(); - $(".no_content").remove(); - - lychee.publicMode = true; - lychee.viewMode = true; - - } - - }, - - animate: function(obj, animation) { - - var animations = [ - ["fadeIn", "fadeOut"], - ["contentZoomIn", "contentZoomOut"] - ]; - - if (!obj.jQuery) obj = $(obj); - - for (var i = 0; i < animations.length; i++) { - for (var x = 0; x < animations[i].length; x++) { - if (animations[i][x]==animation) { - obj.removeClass(animations[i][0] + " " + animations[i][1]).addClass(animation); - return true; - } - } - } - - return false; - - }, - - escapeHTML: function(s) { - - return s.replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); - - }, - - loadDropbox: function(callback) { - - if (!lychee.dropbox&&lychee.dropboxKey) { - - loadingBar.show(); - - var g = document.createElement("script"), - s = document.getElementsByTagName("script")[0]; - - g.src = "https://www.dropbox.com/static/api/1/dropins.js"; - g.id = "dropboxjs"; - g.type = "text/javascript"; - g.async = "true"; - g.setAttribute("data-app-key", lychee.dropboxKey); - g.onload = g.onreadystatechange = function() { - var rs = this.readyState; - if (rs&&rs!=="complete"&&rs!=="loaded") return; - lychee.dropbox = true; - loadingBar.hide(); - callback(); - }; - s.parentNode.insertBefore(g, s); - - } else if (lychee.dropbox&&lychee.dropboxKey) { - - callback(); - - } else { - - settings.setDropboxKey(callback); - - } - - }, - - removeHTML: function(html) { - - var tmp = document.createElement("DIV"); - tmp.innerHTML = html; - return tmp.textContent || tmp.innerText; - - }, - - error: function(errorThrown, params, data) { - - console.error({ - description: errorThrown, - params: params, - response: data - }); - - loadingBar.show("error", errorThrown); - - } - -}; \ No newline at end of file diff --git a/assets/js/modal.js b/assets/js/modal.js deleted file mode 100644 index d6bb9d5..0000000 --- a/assets/js/modal.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @name Modal Module - * @description Build, show and hide a modal. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -modal = { - - fns: null, - - show: function(title, text, buttons, marginTop, closeButton) { - - if (!buttons) { - buttons = [ - ["", function() {}], - ["", function() {}] - ]; - } - - modal.fns = [buttons[0][1], buttons[1][1]]; - $("body").append(build.modal(title, text, buttons, marginTop, closeButton)); - $(".message input:first-child").focus().select(); - - }, - - close: function() { - - modal.fns = null; - $(".message_overlay").removeClass("fadeIn").css("opacity", 0); - setTimeout(function() { $(".message_overlay").remove() }, 300); - - } - -}; \ No newline at end of file diff --git a/assets/js/multiselect.js b/assets/js/multiselect.js deleted file mode 100644 index 69be00c..0000000 --- a/assets/js/multiselect.js +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @name Multiselect Module - * @description Select multiple albums or photos. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -multiselect = { - - position: { - - top: null, - right: null, - bottom: null, - left: null - - }, - - show: function(e) { - - if (mobileBrowser()) return false; - if (lychee.publicMode) return false; - if (visible.search()) return false; - if (visible.infobox()) return false; - if (!visible.albums()&&!visible.album) return false; - if ($('.album:hover, .photo:hover').length!==0) return false; - if (visible.multiselect()) $('#multiselect').remove(); - - multiselect.position.top = e.pageY; - multiselect.position.right = -1 * (e.pageX - $(document).width()); - multiselect.position.bottom = -1 * (multiselect.position.top - $(window).height()); - multiselect.position.left = e.pageX; - - $('body').append(build.multiselect(multiselect.position.top, multiselect.position.left)); - $(document).on('mousemove', multiselect.resize); - - }, - - selectAll: function() { - - var e, - newWidth, - newHeight; - - if (mobileBrowser()) return false; - if (lychee.publicMode) return false; - if (visible.search()) return false; - if (visible.infobox()) return false; - if (!visible.albums()&&!visible.album) return false; - if (visible.multiselect()) $('#multiselect').remove(); - - multiselect.position.top = 70; - multiselect.position.right = 40; - multiselect.position.bottom = 90; - multiselect.position.left = 20; - - $('body').append(build.multiselect(multiselect.position.top, multiselect.position.left)); - - newWidth = $(document).width() - multiselect.position.right + 2; - newHeight = $(document).height() - multiselect.position.bottom; - - $('#multiselect').css({ - width: newWidth, - height: newHeight - }); - - e = { - pageX: $(document).width() - (multiselect.position.right / 2), - pageY: $(document).height() - multiselect.position.bottom - }; - - multiselect.getSelection(e); - - }, - - resize: function(e) { - - var mouse_x = e.pageX, - mouse_y = e.pageY, - newHeight, - newWidth; - - if (multiselect.position.top===null|| - multiselect.position.right===null|| - multiselect.position.bottom===null|| - multiselect.position.left===null) return false; - - if (mouse_y>=multiselect.position.top) { - - // Do not leave the screen - newHeight = mouse_y - multiselect.position.top; - if ((multiselect.position.top+newHeight)>=$(document).height()) - newHeight -= (multiselect.position.top + newHeight) - $(document).height() + 2; - - $('#multiselect').css({ - top: multiselect.position.top, - bottom: 'inherit', - height: newHeight - }); - - } else { - - $('#multiselect').css({ - top: 'inherit', - bottom: multiselect.position.bottom, - height: multiselect.position.top - e.pageY - }); - - } - - if (mouse_x>=multiselect.position.left) { - - // Do not leave the screen - newWidth = mouse_x - multiselect.position.left; - if ((multiselect.position.left+newWidth)>=$(document).width()) - newWidth -= (multiselect.position.left + newWidth) - $(document).width() + 2; - - $('#multiselect').css({ - right: 'inherit', - left: multiselect.position.left, - width: newWidth - }); - - } else { - - $('#multiselect').css({ - right: multiselect.position.right, - left: 'inherit', - width: multiselect.position.left - e.pageX - }); - - } - - }, - - stopResize: function() { - - $(document).off('mousemove'); - - }, - - getSize: function() { - - if (!visible.multiselect()) return false; - - return { - top: $('#multiselect').offset().top, - left: $('#multiselect').offset().left, - width: parseInt($('#multiselect').css('width').replace('px', '')), - height: parseInt($('#multiselect').css('height').replace('px', '')) - }; - - }, - - getSelection: function(e) { - - var tolerance = 150, - id, - ids = [], - offset, - size = multiselect.getSize(); - - if (visible.contextMenu()) return false; - if (!visible.multiselect()) return false; - - $('.photo, .album').each(function() { - - offset = $(this).offset(); - - if (offset.top>=(size.top-tolerance)&& - offset.left>=(size.left-tolerance)&& - (offset.top+206)<=(size.top+size.height+tolerance)&& - (offset.left+206)<=(size.left+size.width+tolerance)) { - - id = $(this).data('id'); - - if (id!=='0'&&id!==0&&id!=='f'&&id!=='s'&&id!=='r'&&id!==null&&id!==undefined) { - - ids.push(id); - $(this).addClass('active'); - - } - - } - - }); - - if (ids.length!==0&&visible.album()) contextMenu.photoMulti(ids, e); - else if (ids.length!==0&&visible.albums()) contextMenu.albumMulti(ids, e); - else multiselect.close(); - - }, - - close: function() { - - multiselect.stopResize(); - - multiselect.position.top = null; - multiselect.position.right = null; - multiselect.position.bottom = null; - multiselect.position.left = null; - - lychee.animate('#multiselect', 'fadeOut'); - setTimeout(function() { - $('#multiselect').remove(); - }, 300); - - } - -}; \ No newline at end of file diff --git a/assets/js/password.js b/assets/js/password.js deleted file mode 100644 index 271843c..0000000 --- a/assets/js/password.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @name Password Module - * @description Controls the access to password-protected albums and photos. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -password = { - - value: "", - - get: function(albumID, callback) { - - var passwd = $(".message input.text").val(), - params; - - if (!lychee.publicMode) callback(); - else if (album.json&&album.json.password==false) callback(); - else if (albums.json&&albums.json.content[albumID].password==false) callback(); - else if (!albums.json&&!album.json) { - - // Continue without password - album.json = {password: true}; - callback(""); - - } else if (passwd==undefined) { - - // Request password - password.getDialog(albumID, callback); - - } else { - - // Check password - params = "checkAlbumAccess&albumID=" + albumID + "&password=" + md5(passwd); - lychee.api(params, function(data) { - - if (data===true) { - password.value = md5(passwd); - callback(); - } else { - lychee.goto(""); - loadingBar.show("error", "Access denied. Wrong password!"); - } - - }); - - } - - }, - - getDialog: function(albumID, callback) { - - var buttons; - - buttons = [ - ["Enter", function() { password.get(albumID, callback) }], - ["Cancel", lychee.goto] - ]; - modal.show(" Enter Password", "This album is protected by a password. Enter the password below to view the photos of this album: ", buttons, -110, false); - - } - -}; \ No newline at end of file diff --git a/assets/js/photo.js b/assets/js/photo.js deleted file mode 100644 index faa9183..0000000 --- a/assets/js/photo.js +++ /dev/null @@ -1,590 +0,0 @@ -/** - * @name Photo Module - * @description Takes care of every action a photo can handle and execute. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -photo = { - - json: null, - cache: null, - - getID: function() { - - var id; - - if (photo.json) id = photo.json.id; - else id = $(".photo:hover, .photo.active").attr("data-id"); - - if (id) return id; - else return false; - - }, - - load: function(photoID, albumID) { - - var params, - checkPasswd; - - params = "getPhoto&photoID=" + photoID + "&albumID=" + albumID + "&password=" + password.value; - lychee.api(params, function(data) { - - if (data==="Warning: Wrong password!") { - checkPasswd = function() { - if (password.value!=="") photo.load(photoID, albumID); - else setTimeout(checkPasswd, 250); - }; - checkPasswd(); - return false; - } - - photo.json = data; - if (!visible.photo()) view.photo.show(); - view.photo.init(); - - lychee.imageview.show(); - setTimeout(function() { - lychee.content.show(); - //photo.preloadNext(photoID, albumID); - }, 300); - - }); - - }, - - //preload the next photo for better response time - preloadNext: function(photoID) { - - var nextPhoto, - url; - - // Never preload on mobile devices with bare RAM and - // mostly mobile internet - if (mobileBrowser()) return false; - - if (album.json && - album.json.content && - album.json.content[photoID] && - album.json.content[photoID].nextPhoto!="") { - - nextPhoto = album.json.content[photoID].nextPhoto; - url = album.json.content[nextPhoto].url; - - photo.cache = new Image(); - photo.cache.src = url; - photo.cache.onload = function() { photo.cache = null }; - - } - - }, - - parse: function() { - - if (!photo.json.title) photo.json.title = "Untitled"; - - }, - - previous: function(animate) { - - var delay = 0; - - if (photo.getID()!==false&& - album.json&& - album.json.content[photo.getID()]&& - album.json.content[photo.getID()].previousPhoto!=="") { - - if (animate===true) { - - delay = 200; - - $("#image").css({ - WebkitTransform: 'translateX(100%)', - MozTransform: 'translateX(100%)', - transform: 'translateX(100%)', - opacity: 0 - }); - - } - - setTimeout(function() { - if (photo.getID()===false) return false; - lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].previousPhoto) - }, delay); - - } - - }, - - next: function(animate) { - - var delay = 0; - - if (photo.getID()!==false&& - album.json&& - album.json.content[photo.getID()]&& - album.json.content[photo.getID()].nextPhoto!=="") { - - if (animate===true) { - - delay = 200; - - $("#image").css({ - WebkitTransform: 'translateX(-100%)', - MozTransform: 'translateX(-100%)', - transform: 'translateX(-100%)', - opacity: 0 - }); - - } - - setTimeout(function() { - if (photo.getID()===false) return false; - lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].nextPhoto); - }, delay); - - } - - }, - - duplicate: function(photoIDs) { - - var params; - - if (!photoIDs) return false; - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - albums.refresh(); - - params = "duplicatePhoto&photoIDs=" + photoIDs; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - else album.load(album.getID(), false); - - }); - - }, - - delete: function(photoIDs) { - - var params, - buttons, - photoTitle; - - if (!photoIDs) return false; - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - if (photoIDs.length===1) { - // Get title if only one photo is selected - if (visible.photo()) photoTitle = photo.json.title; - else photoTitle = album.json.content[photoIDs].title; - if (photoTitle==="") photoTitle = "Untitled"; - } - - buttons = [ - ["", function() { - - var nextPhoto, - previousPhoto; - - photoIDs.forEach(function(id, index, array) { - - // Change reference for the next and previous photo - if (album.json.content[id].nextPhoto!==""||album.json.content[id].previousPhoto!=="") { - - nextPhoto = album.json.content[id].nextPhoto; - previousPhoto = album.json.content[id].previousPhoto; - - album.json.content[previousPhoto].nextPhoto = nextPhoto; - album.json.content[nextPhoto].previousPhoto = previousPhoto; - - } - - album.json.content[id] = null; - view.album.content.delete(id); - - }); - - // Only when search is not active - if (!visible.albums()) lychee.goto(album.getID()); - - albums.refresh(); - - params = "deletePhoto&photoIDs=" + photoIDs; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["", function() {}] - ]; - - if (photoIDs.length===1) { - - buttons[0][0] = "Delete Photo"; - buttons[1][0] = "Keep Photo"; - - modal.show("Delete Photo", "Are you sure you want to delete the photo '" + photoTitle + "'?
This action can't be undone!", buttons); - - } else { - - buttons[0][0] = "Delete Photos"; - buttons[1][0] = "Keep Photos"; - - modal.show("Delete Photos", "Are you sure you want to delete all " + photoIDs.length + " selected photo?
This action can't be undone!", buttons); - - } - - }, - - setTitle: function(photoIDs) { - - var oldTitle = "", - newTitle, - params, - buttons; - - if (!photoIDs) return false; - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - if (photoIDs.length===1) { - // Get old title if only one photo is selected - if (photo.json) oldTitle = photo.json.title; - else if (album.json) oldTitle = album.json.content[photoIDs].title; - oldTitle = oldTitle.replace("'", "'"); - } - - buttons = [ - ["Set Title", function() { - - // Get input - newTitle = $(".message input.text").val(); - - // Remove html from input - newTitle = lychee.removeHTML(newTitle); - - if (visible.photo()) { - photo.json.title = (newTitle==="") ? "Untitled" : newTitle; - view.photo.title(); - } - - photoIDs.forEach(function(id, index, array) { - album.json.content[id].title = newTitle; - view.album.content.title(id); - }); - - params = "setPhotoTitle&photoIDs=" + photoIDs + "&title=" + escape(encodeURI(newTitle)); - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - if (photoIDs.length===1) modal.show("Set Title", "Enter a new title for this photo: ", buttons); - else modal.show("Set Titles", "Enter a title for all " + photoIDs.length + " selected photos: ", buttons); - - }, - - setAlbum: function(photoIDs, albumID) { - - var params, - nextPhoto, - previousPhoto; - - if (!photoIDs) return false; - if (visible.photo) lychee.goto(album.getID()); - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - photoIDs.forEach(function(id, index, array) { - - // Change reference for the next and previous photo - if (album.json.content[id].nextPhoto!==""||album.json.content[id].previousPhoto!=="") { - - nextPhoto = album.json.content[id].nextPhoto; - previousPhoto = album.json.content[id].previousPhoto; - - album.json.content[previousPhoto].nextPhoto = nextPhoto; - album.json.content[nextPhoto].previousPhoto = previousPhoto; - - } - - album.json.content[id] = null; - view.album.content.delete(id); - - }); - - albums.refresh(); - - params = "setPhotoAlbum&photoIDs=" + photoIDs + "&albumID=" + albumID; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }, - - setStar: function(photoIDs) { - - var params; - - if (!photoIDs) return false; - if (visible.photo()) { - photo.json.star = (photo.json.star==0) ? 1 : 0; - view.photo.star(); - } - - photoIDs.forEach(function(id, index, array) { - album.json.content[id].star = (album.json.content[id].star==0) ? 1 : 0; - view.album.content.star(id); - }); - - albums.refresh(); - - params = "setPhotoStar&photoIDs=" + photoIDs; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }, - - setPublic: function(photoID, e) { - - var params; - - if (photo.json.public==2) { - - modal.show("Public Album", "This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.", [["Show Album", function() { lychee.goto(photo.json.original_album) }], ["Close", function() {}]]); - return false; - - } - - if (visible.photo()) { - - photo.json.public = (photo.json.public==0) ? 1 : 0; - view.photo.public(); - if (photo.json.public==1) contextMenu.sharePhoto(photoID, e); - - } - - album.json.content[photoID].public = (album.json.content[photoID].public==0) ? 1 : 0; - view.album.content.public(photoID); - - albums.refresh(); - - params = "setPhotoPublic&photoID=" + photoID; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }, - - setDescription: function(photoID) { - - var oldDescription = photo.json.description.replace("'", "'"), - description, - params, - buttons; - - buttons = [ - ["Set Description", function() { - - // Get input - description = $(".message input.text").val(); - - // Remove html from input - description = lychee.removeHTML(description); - - if (visible.photo()) { - photo.json.description = description; - view.photo.description(); - } - - params = "setPhotoDescription&photoID=" + photoID + "&description=" + escape(encodeURI(description)); - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Set Description", "Enter a description for this photo: ", buttons); - - }, - - editTags: function(photoIDs) { - - var oldTags = "", - tags = "", - buttons; - - if (!photoIDs) return false; - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - // Get tags - if (visible.photo()) oldTags = photo.json.tags; - if (visible.album()&&photoIDs.length===1) oldTags = album.json.content[photoIDs].tags; - if (visible.album()&&photoIDs.length>1) { - var same = true; - photoIDs.forEach(function(id, index, array) { - if(album.json.content[id].tags===album.json.content[photoIDs[0]].tags&&same===true) same = true; - else same = false; - }); - if (same) oldTags = album.json.content[photoIDs[0]].tags; - } - - // Improve tags - oldTags = oldTags.replace(/,/g, ', '); - - buttons = [ - ["Set Tags", function() { - - tags = $(".message input.text").val(); - - photo.setTags(photoIDs, tags); - - }], - ["Cancel", function() {}] - ]; - - if (photoIDs.length===1) modal.show("Set Tags", "Enter your tags for this photo. You can add multiple tags by separating them with a comma: ", buttons); - else modal.show("Set Tags", "Enter your tags for all " + photoIDs.length + " selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ", buttons); - - }, - - setTags: function(photoIDs, tags) { - - var params; - - if (!photoIDs) return false; - if (photoIDs instanceof Array===false) photoIDs = [photoIDs]; - - // Parse tags - tags = tags.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g, ','); - tags = tags.replace(/,$|^,|(\ ){0,}$/g, ''); - - // Remove html from input - tags = lychee.removeHTML(tags); - - if (visible.photo()) { - photo.json.tags = tags; - view.photo.tags(); - } - - photoIDs.forEach(function(id, index, array) { - album.json.content[id].tags = tags; - }); - - params = "setPhotoTags&photoIDs=" + photoIDs + "&tags=" + tags; - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }, - - deleteTag: function(photoID, index) { - - var tags; - - // Remove - tags = photo.json.tags.split(','); - tags.splice(index, 1); - - // Save - photo.json.tags = tags.toString(); - photo.setTags([photoID], photo.json.tags); - - }, - - share: function(photoID, service) { - - var link = "", - url = photo.getViewLink(photoID), - filename = "unknown"; - - switch (service) { - case 0: - link = "https://twitter.com/share?url=" + encodeURI(url); - break; - case 1: - link = "http://www.facebook.com/sharer.php?u=" + encodeURI(url) + "&t=" + encodeURI(photo.json.title); - break; - case 2: - link = "mailto:?subject=" + encodeURI(photo.json.title) + "&body=" + encodeURI(url); - break; - case 3: - lychee.loadDropbox(function() { - filename = photo.json.title + "." + photo.getDirectLink().split('.').pop(); - Dropbox.save(photo.getDirectLink(), filename); - }); - break; - default: - link = ""; - break; - } - - if (link.length>5) location.href = link; - - }, - - isSmall: function() { - - var size = { - width: false, - height: false - }; - - if (photo.json.width<$(window).width()-60) size.width = true; - if (photo.json.height<$(window).height()-100) size.height = true; - - if (size.width&&size.height) return true; - else return false; - - }, - - getArchive: function(photoID) { - - var link, - url = "php/api.php?function=getPhotoArchive&photoID=" + photoID; - - if (location.href.indexOf("index.html")>0) link = location.href.replace(location.hash, "").replace("index.html", url); - else link = location.href.replace(location.hash, "") + url; - - if (lychee.publicMode) link += "&password=" + password.value; - - location.href = link; - - }, - - getDirectLink: function() { - - return $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig, ""); - - }, - - getViewLink: function(photoID) { - - var url = "view.php?p=" + photoID; - - if (location.href.indexOf("index.html")>0) return location.href.replace("index.html" + location.hash, url); - else return location.href.replace(location.hash, url); - - } - -}; \ No newline at end of file diff --git a/assets/js/search.js b/assets/js/search.js deleted file mode 100755 index 4e8d680..0000000 --- a/assets/js/search.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @name Search Module - * @description Searches through your photos and albums. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -search = { - - code: null, - - find: function(term) { - - var params, - albumsData = "", - photosData = "", - code; - - clearTimeout($(window).data("timeout")); - $(window).data("timeout", setTimeout(function() { - - if ($("#search").val().length!==0) { - - params = "search&term=" + term; - lychee.api(params, function(data) { - - if (data&&data.albums) { - albums.json = { content: data.albums }; - $.each(albums.json.content, function() { - albums.parse(this); - albumsData += build.album(this); - }); - } - - if (data&&data.photos) { - album.json = { content: data.photos }; - $.each(album.json.content, function() { - photosData += build.photo(this); - }); - } - - if (albumsData===""&&photosData==="") code = "error"; - else if (albumsData==="") code = build.divider("Photos")+photosData; - else if (photosData==="") code = build.divider("Albums")+albumsData; - else code = build.divider("Photos")+photosData+build.divider("Albums")+albumsData; - - if (search.code!==md5(code)) { - - $(".no_content").remove(); - - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut"); - lychee.animate(".divider", "fadeOut"); - - search.code = md5(code); - - setTimeout(function() { - - if (code==="error") $("body").append(build.no_content("search")); - else { - lychee.content.html(code); - lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn"); - $("img[data-type!='svg']").retina(); - } - - }, 300); - - } - - }); - - } else search.reset(); - - }, 250)); - - }, - - reset: function() { - - $("#search").val(""); - $(".no_content").remove(); - - if (search.code!=="") { - - // Trash data - albums.json = null; - album.json = null; - photo.json = null; - search.code = ""; - - lychee.animate(".divider", "fadeOut"); - albums.load(); - - } - - } - -}; \ No newline at end of file diff --git a/assets/js/settings.js b/assets/js/settings.js deleted file mode 100644 index c2fdec3..0000000 --- a/assets/js/settings.js +++ /dev/null @@ -1,292 +0,0 @@ -/** - * @name Settings Module - * @description Lets you change settings. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -var settings = { - - createConfig: function() { - - var dbName, - dbUser, - dbPassword, - dbHost, - dbTablePrefix, - buttons, - params; - - buttons = [ - ["Connect", function() { - - dbHost = $(".message input.text#dbHost").val(); - dbUser = $(".message input.text#dbUser").val(); - dbPassword = $(".message input.text#dbPassword").val(); - dbName = $(".message input.text#dbName").val(); - dbTablePrefix = $(".message input.text#dbTablePrefix").val(); - - if (dbHost.length<1) dbHost = "localhost"; - if (dbName.length<1) dbName = "lychee"; - - params = "dbCreateConfig&dbName=" + escape(dbName) + "&dbUser=" + escape(dbUser) + "&dbPassword=" + escape(dbPassword) + "&dbHost=" + escape(dbHost) + "&dbTablePrefix=" + escape(dbTablePrefix); - lychee.api(params, function(data) { - - if (data!==true) { - - // Configuration failed - setTimeout(function() { - - // Connection failed - if (data.indexOf("Warning: Connection failed!")!==-1) { - - buttons = [ - ["Retry", function() { setTimeout(settings.createConfig, 400) }], - ["", function() {}] - ]; - modal.show("Connection Failed", "Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.", buttons, null, false); - return false; - - } - - // Creation failed - if (data.indexOf("Warning: Creation failed!")!==-1) { - - buttons = [ - ["Retry", function() { setTimeout(settings.createConfig, 400) }], - ["", function() {}] - ]; - modal.show("Creation Failed", "Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.", buttons, null, false); - return false; - - } - - // Could not create file - if (data.indexOf("Warning: Could not create file!")!==-1) { - - buttons = [ - ["Retry", function() { setTimeout(settings.createConfig, 400) }], - ["", function() {}] - ]; - modal.show("Saving Failed", "Unable to save this configuration. Permission denied in 'data/'. Please set the read, write and execute rights for others in 'data/' and 'uploads/'. Take a look the readme for more information.", buttons, null, false); - return false; - - } - - // Something went wrong - buttons = [ - ["Retry", function() { setTimeout(settings.createConfig, 400) }], - ["", function() {}] - ]; - modal.show("Configuration Failed", "Something unexpected happened. Please try again and check your installation and server. Take a look the readme for more information.", buttons, null, false); - return false; - - }, 400); - - } else { - - // Configuration successful - window.location.reload(); - - } - - }); - - }], - ["", function() {}] - ]; - - modal.show("Configuration", "Enter your database connection details below:
Lychee will create its own database. If required, you can enter the name of an existing database instead:", buttons, -235, false); - - }, - - createLogin: function() { - - var username, - password, - params, - buttons; - - buttons = [ - ["Create Login", function() { - - username = $(".message input.text#username").val(); - password = $(".message input.text#password").val(); - - if (username.length<1||password.length<1) { - - setTimeout(function() { - - buttons = [ - ["Retry", function() { setTimeout(settings.createLogin, 400) }], - ["", function() {}] - ]; - modal.show("Wrong Input", "The username or password you entered is not long enough. Please try again with another username and password!", buttons, null, false); - return false; - - }, 400); - - } else { - - params = "setLogin&username=" + escape(username) + "&password=" + md5(password); - lychee.api(params, function(data) { - - if (data!==true) { - - setTimeout(function() { - - buttons = [ - ["Retry", function() { setTimeout(settings.createLogin, 400) }], - ["", function() {}] - ]; - modal.show("Creation Failed", "Unable to save login. Please try again with another username and password!", buttons, null, false); - return false; - - }, 400); - - } - - }); - - } - - }], - ["", function() {}] - ]; - - modal.show("Create Login", "Enter a username and password for your installation: ", buttons, -122, false); - - }, - - setLogin: function() { - - var old_password, - username, - password, - params, - buttons; - - buttons = [ - ["Change Login", function() { - - old_password = $(".message input.text#old_password").val(); - username = $(".message input.text#username").val(); - password = $(".message input.text#password").val(); - - if (old_password.length<1) { - loadingBar.show("error", "Your old password was entered incorrectly. Please try again!"); - return false; - } - - if (username.length<1) { - loadingBar.show("error", "Your new username was entered incorrectly. Please try again!"); - return false; - } - - if (password.length<1) { - loadingBar.show("error", "Your new password was entered incorrectly. Please try again!"); - return false; - } - - params = "setLogin&oldPassword=" + md5(old_password) + "&username=" + escape(username) + "&password=" + md5(password); - lychee.api(params, function(data) { - - if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Change Login", "Enter your current password:
Your username and password will be changed to the following: ", buttons, -171); - - }, - - setSorting: function() { - - var buttons, - sorting, - params; - - buttons = [ - ["Change Sorting", function() { - - sorting[0] = $("select#settings_type").val(); - sorting[1] = $("select#settings_order").val(); - - albums.refresh(); - - params = "setSorting&type=" + sorting[0] + "&order=" + sorting[1]; - lychee.api(params, function(data) { - - if (data===true) { - lychee.sorting = "ORDER BY " + sorting[0] + " " + sorting[1]; - lychee.load(); - } else lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - modal.show("Change Sorting", - "Sort photos by \ - \ - in an \ - \ - order.\ - ", buttons); - - if (lychee.sorting!=="") { - - sorting = lychee.sorting.replace("ORDER BY ", "").split(" "); - - $("select#settings_type").val(sorting[0]); - $("select#settings_order").val(sorting[1]); - - } - - }, - - setDropboxKey: function(callback) { - - var buttons, - params, - key; - - buttons = [ - ["Set Key", function() { - - key = $(".message input.text#key").val(); - - params = "setDropboxKey&key=" + key; - lychee.api(params, function(data) { - - if (data===true) { - lychee.dropboxKey = key; - if (callback) lychee.loadDropbox(callback); - } else lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Set Dropbox Key", "In order to import photos from your Dropbox, you need a valid drop-ins app key from their website. Generate yourself a personal key and enter it below: ", buttons); - - } - -}; \ No newline at end of file diff --git a/assets/js/swipe.js b/assets/js/swipe.js deleted file mode 100644 index 5110073..0000000 --- a/assets/js/swipe.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @name Swipe Module - * @description Swipes and moves an object. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -swipe = { - - obj: null, - tolerance: 150, - offset: 0, - - start: function(obj, tolerance) { - - if (obj) swipe.obj = obj; - if (tolerance) swipe.tolerance = tolerance; - - return true; - - }, - - move: function(e) { - - if (swipe.obj===null) return false; - - swipe.offset = -1 * e.x; - - swipe.obj.css({ - WebkitTransform: 'translateX(' + swipe.offset + 'px)', - MozTransform: 'translateX(' + swipe.offset + 'px)', - transform: 'translateX(' + swipe.offset + 'px)' - }); - - }, - - stop: function(e, left, right) { - - if (e.x<=-swipe.tolerance) left(true); - else if (e.x>=swipe.tolerance) right(true); - else if (swipe.obj!==null) { - swipe.obj.css({ - WebkitTransform: 'translateX(0px)', - MozTransform: 'translateX(0px)', - transform: 'translateX(0px)' - }); - } - - swipe.obj = null; - swipe.offset = 0; - - } - -}; \ No newline at end of file diff --git a/assets/js/upload.js b/assets/js/upload.js deleted file mode 100755 index 444851e..0000000 --- a/assets/js/upload.js +++ /dev/null @@ -1,402 +0,0 @@ -/** - * @name Album Module - * @description Takes care of every action an album can handle and execute. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -upload = { - - show: function(title, files, callback) { - - upload.close(true); - $("body").append(build.uploadModal(title, files)); - - if (callback!==null&&callback!==undefined) callback(); - - }, - - notify: function(title, text) { - - var popup; - - if (!text||text==="") text = "You can now manage your new photo(s)."; - - if (!window.webkitNotifications) return false; - - if (window.webkitNotifications.checkPermission()!==0) window.webkitNotifications.requestPermission(); - - if (window.webkitNotifications.checkPermission()===0&&title) { - popup = window.webkitNotifications.createNotification("", title, text); - popup.show(); - } - - }, - - start: { - - local: function(files) { - - var albumID = album.getID(), - error = false, - process = function(files, file) { - - var formData = new FormData(), - xhr = new XMLHttpRequest(), - pre_progress = 0, - progress, - finish = function() { - - window.onbeforeunload = null; - - $("#upload_files").val(""); - - if (error===false) { - - // Success - upload.close(); - upload.notify("Upload complete"); - - } else { - - // Error - $(".upload_message a.close").show(); - upload.notify("Upload complete", "Failed to upload one or more photos."); - - } - - albums.refresh(); - - if (album.getID()===false) lychee.goto("0"); - else album.load(albumID); - - }; - - // Check if file is supported - if (file.supported===false) { - - // Skip file - if (file.next!==null) process(files, file.next); - else { - - // Look for supported files - // If zero files are supported, hide the upload after a delay - - var hasSupportedFiles = false; - - for (var i = 0; i < files.length; i++) { - - if (files[i].supported===true) { - hasSupportedFiles = true; - break; - } - - } - - if (hasSupportedFiles===false) setTimeout(finish, 2000); - - } - - return false; - - } - - formData.append("function", "upload"); - formData.append("albumID", albumID); - formData.append("tags", ""); - formData.append(0, file); - - xhr.open("POST", lychee.api_path); - - xhr.onload = function() { - - var wait = false; - - file.ready = true; - - // Set status - if (xhr.status===200&&xhr.responseText==="1") { - - // Success - $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status") - .html("Finished") - .addClass("success"); - - } else { - - // Error - $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status") - .html("Error") - .addClass("error"); - $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") p.notice") - .html("Server returned an unknown response. Please take a look at the console of your browser for further details.") - .show(); - - // Set global error - error = true; - - // Throw error - lychee.error("Upload failed. Server returned the status code " + xhr.status + "!", xhr, xhr.responseText); - - } - - // Check if there are file which are not finished - for (var i = 0; i < files.length; i++) { - - if (files[i].ready===false) { - wait = true; - break; - } - - } - - // Finish upload when all files are finished - if (wait===false) finish(); - - }; - - xhr.upload.onprogress = function(e) { - - if (e.lengthComputable) { - - // Calculate progress - progress = (e.loaded / e.total * 100 | 0); - - // Set progress when progress has changed - if (progress>pre_progress) { - $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status").html(progress + "%"); - pre_progress = progress; - } - - if (progress>=100) { - - // Scroll to the uploading file - var scrollPos = 0; - if ((file.num+1)>4) scrollPos = (file.num + 1 - 4) * 40 - $(".upload_message .rows").scrollTop(scrollPos); - - // Set status to processing - $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status").html("Processing"); - - // Upload next file - if (file.next!==null) process(files, file.next); - - } - - } - - }; - - xhr.send(formData); - - }; - - if (files.length<=0) return false; - if (albumID===false||visible.albums()===true) albumID = 0; - - for (var i = 0; i < files.length; i++) { - - files[i].num = i; - files[i].ready = false; - files[i].supported = true; - - if (i < files.length-1) files[i].next = files[i+1]; - else files[i].next = null; - - // Check if file is supported - if (files[i].type!=="image/jpeg"&&files[i].type!=="image/jpg"&&files[i].type!=="image/png"&&files[i].type!=="image/gif") { - - files[i].ready = true; - files[i].supported = false; - - } - - } - - window.onbeforeunload = function() { return "Lychee is currently uploading!"; }; - - upload.show("Uploading", files); - - // Upload first file - process(files, files[0]); - - }, - - url: function() { - - var albumID = album.getID(), - params, - extension, - buttons, - link, - files = []; - - if (albumID===false) albumID = 0; - - buttons = [ - ["Import", function() { - - link = $(".message input.text").val(); - - if (link&&link.length>3) { - - extension = link.split('.').pop(); - if (extension!=="jpeg"&&extension!=="jpg"&&extension!=="png"&&extension!=="gif"&&extension!=="webp") { - loadingBar.show("error", "The file format of this link is not supported."); - return false; - } - - files[0] = { - name: link, - supported: true - } - - upload.show("Importing URL", files, function() { - $(".upload_message .rows .row .status").html("Importing"); - }); - - params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID; - lychee.api(params, function(data) { - - upload.close(); - upload.notify("Import complete"); - - albums.refresh(); - - if (album.getID()===false) lychee.goto("0"); - else album.load(albumID); - - if (data!==true) lychee.error(null, params, data); - - }); - - } else loadingBar.show("error", "Link to short or too long. Please try another one!"); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Import from Link", "Please enter the direct link to a photo to import it: ", buttons); - - }, - - server: function() { - - var albumID = album.getID(), - params, - buttons, - files = [], - path; - - if (albumID===false) albumID = 0; - - buttons = [ - ["Import", function() { - - path = $(".message input.text").val(); - - files[0] = { - name: path, - supported: true - }; - - upload.show("Importing from server", files, function() { - $(".upload_message .rows .row .status").html("Importing"); - }); - - params = "importServer&albumID=" + albumID + "&path=" + escape(encodeURI(path)); - lychee.api(params, function(data) { - - upload.close(); - upload.notify("Import complete"); - - albums.refresh(); - - if (data==="Notice: Import only contains albums!") { - if (visible.albums()) lychee.load(); - else lychee.goto(""); - } - else if (album.getID()===false) lychee.goto("0"); - else album.load(albumID); - - if (data==="Notice: Import only contains albums!") return true; - else if (data==="Warning: Folder empty!") lychee.error("Folder empty. No photos imported!", params, data); - else if (data!==true) lychee.error(null, params, data); - - }); - - }], - ["Cancel", function() {}] - ]; - - modal.show("Import from Server", "This action will import all photos, folders and sub-folders which are located in the following directory. The original files will be deleted after the import when possible. ", buttons); - - }, - - dropbox: function() { - - var albumID = album.getID(), - params, - links = ""; - - if (albumID===false) albumID = 0; - - lychee.loadDropbox(function() { - Dropbox.choose({ - linkType: "direct", - multiselect: true, - success: function(files) { - - for (var i = 0; i < files.length; i++) { - - links += files[i].link + ","; - - files[i] = { - name: files[i].link, - supported: true - }; - - } - - // Remove last comma - links = links.substr(0, links.length-1); - - upload.show("Importing from Dropbox", files, function() { - $(".upload_message .rows .row .status").html("Importing"); - }); - - params = "importUrl&url=" + escape(links) + "&albumID=" + albumID; - lychee.api(params, function(data) { - - upload.close(); - upload.notify("Import complete"); - - albums.refresh(); - - if (album.getID()===false) lychee.goto("0"); - else album.load(albumID); - - if (data!==true) lychee.error(null, params, data); - - }); - - } - }); - }); - - } - - }, - - close: function(force) { - - if (force===true) { - $(".upload_overlay").remove(); - } else { - $(".upload_overlay").removeClass("fadeIn").css("opacity", 0); - setTimeout(function() { $(".upload_overlay").remove() }, 300); - } - - } - -}; \ No newline at end of file diff --git a/assets/js/view.js b/assets/js/view.js deleted file mode 100644 index ccd2a97..0000000 --- a/assets/js/view.js +++ /dev/null @@ -1,497 +0,0 @@ -/** - * @name UI View - * @description Responsible to reflect data changes to the UI. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -view = { - - header: { - - show: function() { - - var newMargin = -1*($("#imageview #image").height()/2)+20; - - clearTimeout($(window).data("timeout")); - - lychee.imageview.removeClass("full"); - lychee.header.removeClass("hidden"); - lychee.loadingBar.css("opacity", 1); - - if ($("#imageview #image.small").length>0) $("#imageview #image").css('margin-top', newMargin); - else $("#imageview #image").removeClass('full'); - - }, - - hide: function(e, delay) { - - var newMargin = -1*($("#imageview #image").height()/2); - - if (delay===undefined) delay = 500; - - if (visible.photo()&&!visible.infobox()&&!visible.contextMenu()&&!visible.message()) { - - clearTimeout($(window).data("timeout")); - - $(window).data("timeout", setTimeout(function() { - - lychee.imageview.addClass("full"); - lychee.header.addClass("hidden"); - lychee.loadingBar.css("opacity", 0); - - if ($("#imageview #image.small").length>0) $("#imageview #image").css('margin-top', newMargin); - else $("#imageview #image").addClass('full'); - - }, delay)); - - } - - }, - - mode: function(mode) { - - var albumID = album.getID(); - - switch (mode) { - - case "albums": - - lychee.header.removeClass("view"); - $("#tools_album, #tools_photo").hide(); - $("#tools_albums").show(); - - break; - - case "album": - - lychee.header.removeClass("view"); - $("#tools_albums, #tools_photo").hide(); - $("#tools_album").show(); - - album.json.content === false ? $("#button_archive").hide() : $("#button_archive").show(); - if (lychee.publicMode&&album.json.downloadable==="0") $("#button_archive").hide(); - if (albumID==="s"||albumID==="f"||albumID==="r") { - $("#button_info_album, #button_trash_album, #button_share_album").hide(); - } else if (albumID==="0") { - $("#button_info_album, #button_share_album").hide(); - $("#button_trash_album").show(); - } else { - $("#button_info_album, #button_trash_album, #button_share_album").show(); - } - - break; - - case "photo": - - lychee.header.addClass("view"); - $("#tools_albums, #tools_album").hide(); - $("#tools_photo").show(); - - break; - - } - - } - - }, - - infobox: { - - show: function() { - - if (!visible.infobox()) $("body").append("
"); - lychee.infobox.addClass("active"); - - }, - - hide: function() { - - lychee.animate("#infobox_overlay", "fadeOut"); - setTimeout(function() { $("#infobox_overlay").remove() }, 300); - lychee.infobox.removeClass("active"); - - } - - }, - - albums: { - - init: function() { - - view.albums.title(); - view.albums.content.init(); - - }, - - title: function() { - - lychee.setTitle("Albums", false); - - }, - - content: { - - scrollPosition: 0, - - init: function() { - - var smartData = "", - albumsData = ""; - - /* Smart Albums */ - albums.parse(albums.json.unsortedAlbum); - albums.parse(albums.json.publicAlbum); - albums.parse(albums.json.starredAlbum); - albums.parse(albums.json.recentAlbum); - if (!lychee.publicMode) smartData = build.divider("Smart Albums") + build.album(albums.json.unsortedAlbum) + build.album(albums.json.starredAlbum) + build.album(albums.json.publicAlbum) + build.album(albums.json.recentAlbum); - - /* Albums */ - if (albums.json.content) { - - $.each(albums.json.content, function() { - albums.parse(this); - - //display albums in reverse order - albumsData = build.album(this) + albumsData; - }); - - if (!lychee.publicMode) albumsData = build.divider("Albums") + albumsData; - - } - - if (smartData===""&&albumsData==="") { - lychee.content.html(''); - $("body").append(build.no_content("share")); - } else { - lychee.content.html(smartData + albumsData); - } - - $("img[data-type!='nonretina']").retina(); - - /* Restore scroll position */ - if (view.albums.content.scrollPosition!==null) { - $("html, body").scrollTop(view.albums.content.scrollPosition); - } - - }, - - title: function(albumID) { - - var prefix = "", - longTitle = "", - title = albums.json.content[albumID].title; - - if (albums.json.content[albumID].password) prefix = " "; - if (title!==null&&title.length>18) { - longTitle = title; - title = title.substr(0, 18) + "..."; - } - - $(".album[data-id='" + albumID + "'] .overlay h1") - .html(prefix + title) - .attr("title", longTitle); - - }, - - delete: function(albumID) { - - $(".album[data-id='" + albumID + "']").css("opacity", 0).animate({ - width: 0, - marginLeft: 0 - }, 300, function() { - $(this).remove(); - if (albums.json.num<=0) lychee.animate(".divider:last-of-type", "fadeOut"); - }); - - } - - } - - }, - - album: { - - init: function() { - - album.parse(); - - view.album.infobox(); - view.album.title(); - view.album.public(); - view.album.content.init(); - - album.json.init = 1; - - }, - - hide: function() { - - view.infobox.hide(); - - }, - - title: function() { - - if ((visible.album()||!album.json.init)&&!visible.photo()) { - - switch (album.getID()) { - case "f": - lychee.setTitle("Starred", false); - break; - case "s": - lychee.setTitle("Public", false); - break; - case "r": - lychee.setTitle("Recent", false); - break; - case "0": - lychee.setTitle("Unsorted", false); - break; - default: - if (album.json.init) $("#infobox .attr_title").html(album.json.title + " " + build.editIcon("edit_title_album")); - lychee.setTitle(album.json.title, true); - break; - } - - } - - }, - - content: { - - init: function() { - - var photosData = ""; - - $.each(album.json.content, function() { - photosData += build.photo(this); - }); - lychee.content.html(photosData); - - $("img[data-type!='svg']").retina(); - - /* Save and reset scroll position */ - view.albums.content.scrollPosition = $(document).scrollTop(); - $("html, body").scrollTop(0); - - }, - - title: function(photoID) { - - var longTitle = "", - title = album.json.content[photoID].title; - - if (title!==null&&title.length>18) { - longTitle = title; - title = title.substr(0, 18) + "..."; - } - - $(".photo[data-id='" + photoID + "'] .overlay h1") - .html(title) - .attr("title", longTitle); - - }, - - star: function(photoID) { - - $(".photo[data-id='" + photoID + "'] .icon-star").remove(); - if (album.json.content[photoID].star==1) $(".photo[data-id='" + photoID + "']").append(""); - - }, - - public: function(photoID) { - - $(".photo[data-id='" + photoID + "'] .icon-share").remove(); - if (album.json.content[photoID].public==1) $(".photo[data-id='" + photoID + "']").append(""); - - }, - - delete: function(photoID) { - - $(".photo[data-id='" + photoID + "']").css("opacity", 0).animate({ - width: 0, - marginLeft: 0 - }, 300, function() { - $(this).remove(); - // Only when search is not active - if (!visible.albums()) { - album.json.num--; - view.album.num(); - view.album.title(); - } - }); - - } - - }, - - description: function() { - - $("#infobox .attr_description").html(album.json.description + " " + build.editIcon("edit_description_album")); - - }, - - num: function() { - - $("#infobox .attr_images").html(album.json.num); - - }, - - public: function() { - - if (album.json.public==1) { - $("#button_share_album a").addClass("active"); - $("#button_share_album").attr("title", "Share Album"); - $(".photo .icon-share").remove(); - if (album.json.init) $("#infobox .attr_visibility").html("Public"); - } else { - $("#button_share_album a").removeClass("active"); - $("#button_share_album").attr("title", "Make Public"); - if (album.json.init) $("#infobox .attr_visibility").html("Private"); - } - - }, - - password: function() { - - if (album.json.password==1) $("#infobox .attr_password").html("Yes"); - else $("#infobox .attr_password").html("No"); - - }, - - infobox: function() { - - if ((visible.album()||!album.json.init)&&!visible.photo()) lychee.infobox.html(build.infoboxAlbum(album.json)).show(); - - } - - }, - - photo: { - - init: function() { - - photo.parse(); - - view.photo.infobox(); - view.photo.title(); - view.photo.star(); - view.photo.public(); - view.photo.photo(); - - photo.json.init = 1; - - }, - - show: function() { - - // Change header - lychee.content.addClass("view"); - view.header.mode("photo"); - - // Make body not scrollable - $("body").css("overflow", "hidden"); - - // Fullscreen - $(document) - .bind("mouseenter", view.header.show) - .bind("mouseleave", view.header.hide); - - lychee.animate(lychee.imageview, "fadeIn"); - - }, - - hide: function() { - - view.header.show(); - if (visible.infobox) view.infobox.hide(); - - lychee.content.removeClass("view"); - view.header.mode("album"); - - // Make body scrollable - $("body").css("overflow", "auto"); - - // Disable Fullscreen - $(document) - .unbind("mouseenter") - .unbind("mouseleave"); - - // Hide Photo - lychee.animate(lychee.imageview, "fadeOut"); - setTimeout(function() { - lychee.imageview.hide(); - view.album.infobox(); - }, 300); - - }, - - title: function() { - - if (photo.json.init) $("#infobox .attr_title").html(photo.json.title + " " + build.editIcon("edit_title")); - lychee.setTitle(photo.json.title, true); - - }, - - description: function() { - - if (photo.json.init) $("#infobox .attr_description").html(photo.json.description + " " + build.editIcon("edit_description")); - - }, - - star: function() { - - $("#button_star a").removeClass("icon-star-empty icon-star"); - if (photo.json.star==1) { - // Starred - $("#button_star a").addClass("icon-star"); - $("#button_star").attr("title", "Unstar Photo"); - } else { - // Unstarred - $("#button_star a").addClass("icon-star-empty"); - $("#button_star").attr("title", "Star Photo"); - } - - }, - - public: function() { - - if (photo.json.public==1||photo.json.public==2) { - // Photo public - $("#button_share a").addClass("active"); - $("#button_share").attr("title", "Share Photo"); - if (photo.json.init) $("#infobox .attr_visibility").html("Public"); - } else { - // Photo private - $("#button_share a").removeClass("active"); - $("#button_share").attr("title", "Make Public"); - if (photo.json.init) $("#infobox .attr_visibility").html("Private"); - } - - }, - - tags: function() { - - $("#infobox #tags").html(build.tags(photo.json.tags)); - - }, - - photo: function() { - - lychee.imageview.html(build.imageview(photo.json, photo.isSmall(), visible.controls())); - - if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==="")||lychee.viewMode) $("a#next").hide(); - if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==="")||lychee.viewMode) $("a#previous").hide(); - - }, - - infobox: function() { - - lychee.infobox.html(build.infoboxPhoto(photo.json)).show(); - - } - - } - -}; \ No newline at end of file diff --git a/assets/js/view/main.js b/assets/js/view/main.js deleted file mode 100644 index c3b5588..0000000 --- a/assets/js/view/main.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @name Main - * @description Used to view single photos with view.php - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -var header = $("header"), - headerTitle = $("#title"), - imageview = $("#imageview"), - api_path = "php/api.php", - infobox = $("#infobox"); - -$(document).ready(function(){ - - /* Event Name */ - if (mobileBrowser()) event_name = "touchend"; - else event_name = "click"; - - /* Window */ - $(window).keydown(key); - - /* Infobox */ - $(document).on(event_name, "#infobox .header a", function() { hideInfobox() }); - $(document).on(event_name, "#infobox_overlay", function() { hideInfobox() }); - $("#button_info").on(event_name, function() { showInfobox() }); - - /* Direct Link */ - $("#button_direct").on(event_name, function() { - - link = $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig, ""); - window.open(link,"_newtab"); - - }); - - loadPhotoInfo(gup("p")); - -}); - -function key(e) { - - code = (e.keyCode ? e.keyCode : e.which); - if (code===27&&visibleInfobox()) { hideInfobox(); e.preventDefault(); } - -} - -function visibleInfobox() { - - if (parseInt(infobox.css("right").replace("px", ""))<0) return false; - else return true; - -} - -function isPhotoSmall(photo) { - - size = [ - ["width", false], - ["height", false] - ]; - - if (photo.width<$(window).width()-60) size["width"] = true; - if (photo.height<$(window).height()-100) size["height"] = true; - - if (size["width"]&&size["height"]) return true; - else return false; - -} - -function showInfobox() { - - $("body").append("
"); - infobox.addClass("active"); - -} - -function hideInfobox() { - - $("#infobox_overlay").removeClass("fadeIn").addClass("fadeOut"); - setTimeout(function() { $("#infobox_overlay").remove() }, 300); - infobox.removeClass("active"); - -} - -function loadPhotoInfo(photoID) { - - params = "function=getPhoto&photoID=" + photoID + "&albumID=0&password=''"; - $.ajax({type: "POST", url: api_path, data: params, dataType: "json", success: function(data) { - - if (!data.title) data.title = "Untitled"; - document.title = "Lychee - " + data.title; - headerTitle.html(data.title); - - imageview.attr("data-id", photoID); - if (isPhotoSmall(data)) imageview.html("
"); - else imageview.html("
"); - imageview.removeClass("fadeOut").addClass("fadeIn").show(); - - infobox.html(build.infoboxPhoto(data, true)).show(); - - }, error: ajaxError }); - -} - -function ajaxError(jqXHR, textStatus, errorThrown) { - - console.log(jqXHR); - console.log(textStatus); - console.log(errorThrown); - -} \ No newline at end of file diff --git a/assets/js/visible.js b/assets/js/visible.js deleted file mode 100755 index 87f971e..0000000 --- a/assets/js/visible.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @name Visible Module - * @description This module is used to check if elements are visible or not. - * @author Tobias Reich - * @copyright 2014 by Tobias Reich - */ - -visible = { - - albums: function() { - if ($('#tools_albums').css('display')==='block') return true; - else return false; - }, - - album: function() { - if ($('#tools_album').css('display')==='block') return true; - else return false; - }, - - photo: function() { - if ($('#imageview.fadeIn').length>0) return true; - else return false; - }, - - search: function() { - if (search.code!==null&&search.code!=='') return true; - else return false; - }, - - infobox: function() { - if ($('#infobox.active').length>0) return true; - else return false; - }, - - 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; - }, - - controls: function() { - if (lychee.loadingBar.css('opacity')<1) return false; - else return true; - }, - - message: function() { - if ($('.message').length>0) return true; - else return false; - }, - - signin: function() { - if ($('.message .sign_in').length>0) return true; - else return false; - }, - - contextMenu: function() { - if ($('.contextmenu').length>0) return true; - else return false; - }, - - multiselect: function() { - if ($('#multiselect').length>0) return true; - else return false; - } - -}; \ No newline at end of file diff --git a/assets/min/main.css b/assets/min/main.css deleted file mode 100755 index c69efce..0000000 --- a/assets/min/main.css +++ /dev/null @@ -1 +0,0 @@ -a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1.15);animation-timing-function:cubic-bezier(0.51,.92,.24,1.15)}.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1.15);animation-timing-function:cubic-bezier(0.51,.92,.24,1.15)}.contentZoomIn{-webkit-animation-name:zoomIn;animation-name:zoomIn;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1);animation-timing-function:cubic-bezier(0.51,.92,.24,1)}.contentZoomOut{-webkit-animation-name:zoomOut;animation-name:zoomOut;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1);animation-timing-function:cubic-bezier(0.51,.92,.24,1)}@-webkit-keyframes moveUp{0%{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}100%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes moveUp{0%{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}100%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes moveBackground{0%{background-position-x:0}100%{background-position-x:-100px}}@keyframes moveBackground{0%{background-position-x:0}100%{background-position-x:-100px}}@-webkit-keyframes zoomIn{0%{opacity:0;-webkit-transform:scale(0.8);transform:scale(0.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes zoomIn{0%{opacity:0;-webkit-transform:scale(0.8);transform:scale(0.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes zoomOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.8);transform:scale(0.8)}}@keyframes zoomOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.8);transform:scale(0.8)}}@-webkit-keyframes popIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes popIn{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.3}100%{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.3}100%{opacity:1}}#content::before{content:"";position:absolute;left:0;width:100%;height:20px;background:-webkit-linear-gradient(top,#262626,#222);background:linear-gradient(to bottom,#262626,#222);border-top:1px solid #333}#content.view::before{display:none}#content{position:absolute;padding:50px 0 33px;width:100%;min-height:calc(100% - 90px);-webkit-overflow-scrolling:touch}.photo{float:left;display:inline-block;width:206px;height:206px;margin:30px 0 0 30px;cursor:pointer}.photo img{position:absolute;width:200px;height:200px;background-color:#222;border-radius:2px;border:2px solid #ccc}.photo.active img,.photo:hover img{box-shadow:0 0 5px #005ecc}.photo:active{-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transform:scale(0.98);-ms-transform:scale(0.98);transform:scale(0.98)}.album{float:left;display:inline-block;width:204px;height:204px;margin:30px 0 0 30px;cursor:pointer}.album img:first-child,.album img:nth-child(2){-webkit-transform:rotate(0deg) translateY(0px) translateX(0px);-ms-transform:rotate(0deg) translateY(0px) translateX(0px);transform:rotate(0deg) translateY(0px) translateX(0px);opacity:0}.album:hover img:first-child{-webkit-transform:rotate(-2deg) translateY(10px) translateX(-12px);-ms-transform:rotate(-2deg) translateY(10px) translateX(-12px);transform:rotate(-2deg) translateY(10px) translateX(-12px);opacity:1}.album:hover img:nth-child(2){-webkit-transform:rotate(5deg) translateY(-8px) translateX(12px);-ms-transform:rotate(5deg) translateY(-8px) translateX(12px);transform:rotate(5deg) translateY(-8px) translateX(12px);opacity:1}.album img{position:absolute;width:200px;height:200px;background-color:#222;border-radius:2px;border:2px solid #ccc}.album.active img,.album:hover img{box-shadow:0 0 5px #005ecc}.album .overlay,.photo .overlay{position:absolute;width:200px;height:200px;margin:2px}.album .overlay{background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 40%,rgba(0,0,0,.85) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,0) 40%,rgba(0,0,0,.85) 100%)}.photo .overlay{background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 60%,rgba(0,0,0,.5) 80%,rgba(0,0,0,.9) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,0) 60%,rgba(0,0,0,.5) 80%,rgba(0,0,0,.9) 100%);opacity:0}.photo.active .overlay,.photo:hover .overlay{opacity:1}.album .overlay h1,.photo .overlay h1{min-height:19px;width:185px;margin:153px 0 3px 15px;color:#fff;font-size:16px;font-weight:700;overflow:hidden}.album .overlay a,.photo .overlay a{font-size:11px;color:#aaa}.album .overlay a{margin-left:15px}.photo .overlay a{margin:155px 0 5px 15px}.photo .overlay a span{margin:0 5px 0 0}.album .badge,.photo .badge{position:absolute;margin-top:-1px;margin-left:12px;padding:12px 7px 3px;box-shadow:0 0 3px rgba(0,0,0,.8);border-radius:0 0 3px 3px;border:1px solid #fff;border-top:none;color:#fff;font-size:24px;text-shadow:0 1px 0 rgba(0,0,0,.4);opacity:.9}.album .badge.icon-star,.photo .badge.icon-star{padding:12px 8px 3px}.album .badge.icon-share,.photo .badge.icon-share{padding:12px 6px 3px 8px}.album .badge.icon-time,.photo .badge.icon-time{padding:12px 8px 3px 9px}.album .badge::after,.photo .badge::after{content:"";position:absolute;margin-top:-12px;margin-left:-26px;width:38px;height:5px;background:-webkit-linear-gradient(top,#000 0,rgba(0,0,0,0) 100%);background:linear-gradient(to bottom,#000 0,rgba(0,0,0,0) 100%);opacity:.4}.album .badge.icon-star::after,.photo .badge.icon-star::after{margin-left:-29px}.album .badge.icon-share::after,.photo .badge.icon-share::after{margin-left:-31px}.album .badge.icon-time::after,.photo .badge.icon-time::after{margin-left:-29px}.album .badge.icon-reorder::after{margin-left:-30px}.album .badge:nth-child(2n),.photo .badge:nth-child(2n){margin-left:57px}.album .badge.red,.photo .badge.red{background:-webkit-linear-gradient(top,#d64b4b 0,#ab2c2c 100%);background:linear-gradient(to bottom,#d64b4b 0,#ab2c2c 100%)}.album .badge.blue,.photo .badge.blue{background:-webkit-linear-gradient(top,#347cd6 0,#2945ab 100%);background:linear-gradient(to bottom,#347cd6 0,#2945ab 100%)}.divider{float:left;width:100%;margin-top:50px;opacity:0;border-top:1px solid #2E2E2E;box-shadow:0 -1px 0 #151515}.divider:first-child{margin-top:0;border-top:none}.divider h1{float:left;margin:20px 0 0 30px;color:#fff;font-size:14px;font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,.8)}.no_content{position:absolute;top:50%;left:50%;height:160px;width:180px;margin-top:-60px;margin-left:-90px;padding-top:20px;color:#141414;text-shadow:0 1px 0 rgba(255,255,255,.05);text-align:center}.no_content .icon{font-size:80px}.no_content p{font-size:18px;font-weight:700}.contextmenu_bg{position:fixed;height:100%;width:100%;z-index:1000}.contextmenu{position:fixed;top:0;left:0;padding:5px 0 6px;background:-webkit-linear-gradient(top,#444 0,#2f2f2f 100%);background:linear-gradient(to bottom,#444 0,#2f2f2f 100%);border:1px solid rgba(0,0,0,.5);border-bottom:1px solid rgba(0,0,0,.7);border-radius:5px;box-shadow:0 3px 4px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.1);opacity:0;z-index:1001;-webkit-transition:none;transition:none}.contextmenu tr{font-size:14px;color:#eee;text-shadow:0 -1px 0 rgba(0,0,0,.2);cursor:pointer}.contextmenu tr:hover{background:-webkit-linear-gradient(top,#6a84f2,#4967F0);background:linear-gradient(to bottom,#6a84f2,#4967F0)}.contextmenu tr.no_hover:hover{cursor:inherit;background-color:inherit;background-image:none}.contextmenu tr.separator{float:left;height:1px;width:100%;background-color:#1f1f1f;border-bottom:1px solid #4c4c4c;margin:5px 0;cursor:inherit}.contextmenu tr.separator:hover{background-color:#222;background-image:none}.contextmenu tr td{padding:7px 30px 6px 12px;white-space:nowrap;-webkit-transition:none;transition:none}.contextmenu tr:hover td{color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.05);text-shadow:0 -1px 0 rgba(0,0,0,.2)}.contextmenu tr.no_hover:hover td{box-shadow:none}.contextmenu tr a{float:left;width:10px;margin-right:10px;text-align:center}.contextmenu #link{float:right;width:140px;margin:-1px -18px -2px -1px;padding:5px 7px 6px;background-color:#444;color:#fff;border:none;border:1px solid rgba(0,0,0,.5);box-shadow:0 1px 0 rgba(255,255,255,.08);outline:0;border-radius:5px}.contextmenu tr a#link_icon{padding-top:4px}@font-face{font-family:FontAwesome;src:url(../font/fontawesome-webfont.eot);src:url(../font/fontawesome-webfont.eot?#iefix) format('eot'),url(../font/fontawesome-webfont.woff) format('woff'),url(../font/fontawesome-webfont.ttf) format('truetype'),url(../font/fontawesome-webfont.svg#FontAwesome) format('svg');font-weight:400;font-style:normal}[class*=" icon-"]:before,[class^=icon-]:before{font-family:FontAwesome;font-weight:400;font-style:normal;display:inline-block;text-decoration:inherit}a [class*=" icon-"],a [class^=icon-]{display:inline-block;text-decoration:inherit}.icon-large:before{vertical-align:top;font-size:1.33333em}.btn [class*=" icon-"],.btn [class^=icon-]{line-height:.9em}li [class*=" icon-"],li [class^=icon-]{display:inline-block;width:1.25em;text-align:center}li .icon-large[class*=" icon-"],li .icon-large[class^=icon-]{width:1.875em}li[class*=" icon-"],li[class^=icon-]{margin-left:0;list-style-type:none}li[class*=" icon-"]:before,li[class^=icon-]:before{text-indent:-2em;text-align:center}li[class*=" icon-"].icon-large:before,li[class^=icon-].icon-large:before{text-indent:-1.33333em}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-user-md:before{content:"\f200"}header{position:fixed;height:49px;width:100%;background:-webkit-linear-gradient(top,#3E3E3E,#282828);background:linear-gradient(to bottom,#3E3E3E,#282828);border-bottom:1px solid #161616;z-index:1;-webkit-transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out}header.hidden{-webkit-transform:translateY(-60px);-ms-transform:translateY(-60px);transform:translateY(-60px)}header.loading{-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}header.error{-webkit-transform:translateY(40px);-ms-transform:translateY(40px);transform:translateY(40px)}header.view.error{background-color:rgba(10,10,10,.99)}header.view{background:0 0;border-bottom:none}header.view #title,header.view .button,header.view .tools{text-shadow:none!important}header #title{position:absolute;margin:0 30%;width:40%;padding:15px 0;color:#fff;font-size:16px;font-weight:700;text-align:center;text-shadow:0 -1px 0 #222}header #title.editable{cursor:pointer}header .button{color:#888;font-family:FontAwesome;font-size:21px;font-weight:700;text-decoration:none!important;cursor:pointer;text-shadow:0 -1px 0 #222}header .button.left{float:left;position:absolute;padding:16px 10px 8px 18px}header .button.right{float:right;position:relative;padding:16px 19px 13px 11px}header .button:hover{color:#fff}header #button_signin,header #tools_album,header #tools_albums,header #tools_photo{display:none}header .button_divider{float:right;position:relative;width:14px;height:50px}header #search{float:right;width:80px;margin:12px 12px 0 0;padding:5px 12px 6px;background-color:#383838;color:#fff;border:none;border:1px solid #131313;box-shadow:0 1px 0 rgba(255,255,255,.1);outline:0;border-radius:50px;opacity:.6;-webkit-transition:opacity .3s ease-out,-webkit-transform .3s ease-out,box-shadow .3s,width .2s ease-out;transition:opacity .3s ease-out,transform .3s ease-out,box-shadow .3s,width .2s ease-out}header #search:focus{width:140px}header #search:focus~#clearSearch{opacity:1}header #clearSearch{position:absolute;top:15px;right:81px;padding:0;font-size:20px;opacity:0;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}header #clearSearch:hover{opacity:1}header .tools:first-of-type{margin-right:6px}header .tools{float:right;padding:14px 8px;color:#888;font-size:21px;text-shadow:0 -1px 0 #222;cursor:pointer}header .tools:hover a{color:#fff}header .tools .icon-star{color:#f0ef77}header .tools .icon-share.active{color:#ff9737}header #hostedwith{float:right;padding:5px 10px;margin:13px 9px;color:#888;font-size:13px;text-shadow:0 -1px 0 #222;display:none;cursor:pointer}header #hostedwith:hover{background-color:rgba(0,0,0,.2);border-radius:100px}#imageview{position:fixed;display:none;width:100%;min-height:100%;background-color:rgba(10,10,10,.98);-webkit-transition:background-color .3s;transition:background-color .3s}#imageview.view{background-color:inherit}#imageview.full{background-color:#000}#imageview #image{position:absolute;top:60px;right:30px;bottom:30px;left:30px;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;-webkit-transition:top .3s,right .3s,bottom .3s,left .3s,margin-top .3s,opacity .2s,-webkit-transform .3s cubic-bezier(0.51,.92,.24,1.15);transition:top .3s,right .3s,bottom .3s,left .3s,margin-top .3s,opacity .2s,transform .3s cubic-bezier(0.51,.92,.24,1.15);-webkit-animation-name:zoomIn;animation-name:zoomIn;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1.15);animation-timing-function:cubic-bezier(0.51,.92,.24,1.15)}#imageview #image.small{top:50%;right:auto;bottom:auto;left:50%}#imageview #image.full{top:0;right:0;bottom:0;left:0}#imageview .arrow_wrapper{position:fixed;width:20%;height:calc(100% - 60px);top:60px;z-index:1}#imageview .arrow_wrapper.previous{left:0}#imageview .arrow_wrapper.next{right:0}#imageview .arrow_wrapper a{position:fixed;top:50%;margin-top:-10px;color:#fff;font-size:50px;text-shadow:0 1px 2px #000;cursor:pointer;opacity:0;z-index:2;-webkit-transition:opacity .2s;transition:opacity .2s}#imageview .arrow_wrapper:hover a{opacity:.2}#imageview .arrow_wrapper a#previous{left:20px}#imageview .arrow_wrapper a#next{right:20px}#infobox_overlay{z-index:3;position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.8)}#infobox{z-index:4;position:fixed;right:0;width:350px;height:100%;background-color:rgba(20,20,20,.98);box-shadow:-1px 0 2px rgba(0,0,0,.8);display:none;-webkit-transform:translateX(370px);-ms-transform:translateX(370px);transform:translateX(370px);-webkit-transition:-webkit-transform .3s cubic-bezier(0.51,.92,.24,1.15);transition:transform .3s cubic-bezier(0.51,.92,.24,1.15)}#infobox.active{-webkit-transform:translateX(50px);-ms-transform:translateX(50px);transform:translateX(50px)}#infobox .wrapper{float:left;height:100%;width:300px;overflow:scroll;-webkit-overflow-scrolling:touch}#infobox .edit{display:inline;margin-left:3px;width:20px;height:5px;cursor:pointer}#infobox .bumper{float:left;width:100%;height:50px}#infobox .header{float:left;height:49px;width:100%;background-image:-webkit-linear-gradient(top,#2A2A2A,#131313);background-image:linear-gradient(to bottom,#2A2A2A,#131313);border-bottom:1px solid #000}#infobox .header h1{position:absolute;margin:15px 30% 15px calc(30% - 25px);width:40%;color:#fff;font-size:16px;font-weight:700;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.8)}#infobox .header a{float:right;padding:15px 65px 15px 15px;color:#fff;font-size:20px;font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,.8);opacity:.5;cursor:pointer}#infobox .header a:hover{opacity:1}#infobox .separator{float:left;width:100%;border-top:1px solid rgba(255,255,255,.04);box-shadow:0 -1px 0 #000}#infobox .separator h1{margin:20px 0 5px 20px;color:#fff;font-size:14px;font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,.8)}#infobox table{float:left;margin:10px 0 15px 20px}#infobox table tr td{padding:5px 0;color:#fff;font-size:14px;line-height:19px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}#infobox table tr td:first-child{width:110px}#infobox table tr td:last-child{padding-right:10px}#infobox #tags{width:calc(100% - 40px);margin:16px 20px 12px;color:#fff;display:inline-block}#infobox #tags .empty{font-size:14px;margin-bottom:8px}#infobox #tags .edit{display:inline-block}#infobox #tags .empty .edit{display:inline}#infobox .tag{float:left;padding:4px 7px;margin:0 6px 8px 0;background-color:rgba(0,0,0,.5);border:2px solid rgba(255,255,255,.3);border-radius:100px;font-size:12px;-webkit-transition:border .3s;transition:border .3s}#infobox .tag:hover{border:2px solid #aaa}#infobox .tag span{float:right;width:0;padding:0;margin:0 0 -2px;color:red;font-size:11px;cursor:pointer;overflow:hidden;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:width .3s,margin .3s,-webkit-transform .3s;transition:width .3s,margin .3s,transform .3s}#infobox .tag:hover span{width:10px;margin:0 0 -2px 6px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#loading{position:fixed;width:100%;height:3px;background-size:100px 3px;background-repeat:repeat-x;border-bottom:1px solid rgba(0,0,0,.3);display:none;-webkit-animation-name:moveBackground;animation-name:moveBackground;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}#loading.loading{background-image:-webkit-linear-gradient(left,#153674 0,#153674 47%,#2651AE 53%,#2651AE 100%);background-image:linear-gradient(to right,#153674 0,#153674 47%,#2651AE 53%,#2651AE 100%);z-index:2}#loading.error{background-color:#2f0d0e;background-image:-webkit-linear-gradient(left,#451317 0,#451317 47%,#AA3039 53%,#AA3039 100%);background-image:linear-gradient(to right,#451317 0,#451317 47%,#AA3039 53%,#AA3039 100%);z-index:1}#loading h1{margin:13px 13px 0;color:#ddd;font-size:14px;font-weight:700;text-shadow:0 1px 0 #000;text-transform:capitalize}#loading h1 span{margin-left:10px;font-weight:400;text-transform:none}.message_overlay{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.85);z-index:1000}.message{position:absolute;display:inline-block;width:500px;margin-left:-250px;margin-top:-95px;background-color:#444;background-image:-webkit-linear-gradient(top,#4b4b4b,#2d2d2d);background-image:linear-gradient(to bottom,#4b4b4b,#2d2d2d);border-radius:5px;box-shadow:0 0 5px #000,inset 0 1px 0 rgba(255,255,255,.08);-webkit-animation-name:moveUp;animation-name:moveUp;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1.15);animation-timing-function:cubic-bezier(0.51,.92,.24,1.15)}.message h1{float:left;width:100%;padding:12px 0;color:#fff;font-size:16px;font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,.3);text-align:center}.message .close{position:absolute;top:0;right:0;padding:12px 14px 6px 7px;color:#aaa;font-size:20px;text-shadow:0 -1px 0 rgba(0,0,0,.3);cursor:pointer}.message .close:hover{color:#fff}.message p{float:left;width:90%;margin-top:1px;padding:12px 5% 15px;color:#eee;font-size:14px;text-shadow:0 -1px 0 rgba(0,0,0,.3);line-height:20px}.message p b{font-weight:700;color:#fff}.message p a{color:#eee;text-decoration:none;border-bottom:1px dashed #888}.message .button{float:right;margin:15px 15px 15px 0;padding:7px 10px 8px;color:#ccc;font-size:14px;font-weight:700;text-align:center;text-shadow:0 -1px 0 #222;border-radius:5px;border:1px solid rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 1px 0 rgba(255,255,255,.05);cursor:pointer}.message .button:first-of-type{margin:15px 5% 18px 0!important}.message .button.active{color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 1px 0 rgba(255,255,255,.1),0 0 4px #005ecc}.message .button:hover{background-image:-webkit-linear-gradient(top,#3c3c3c,#393939);background-image:linear-gradient(to bottom,#3c3c3c,#393939)}.message .button.pressed,.message .button:active{background-color:#393939;background-image:-webkit-linear-gradient(top,#393939,#3c3c3c);background-image:linear-gradient(to bottom,#393939,#3c3c3c)}.sign_in{float:left;width:100%;margin-top:1px;padding:5px 0;color:#eee;font-size:14px;text-shadow:0 -1px 0 #222;line-height:20px}.sign_in input{float:left;width:88%;padding:7px 1% 9px;margin:0 5%;background-color:transparent;color:#fff;text-shadow:0 -1px 0 #222;border:none;border-bottom:1px solid #222;box-shadow:0 1px 0 rgba(255,255,255,.1);border-radius:0;outline:0}.sign_in input:first-of-type{margin-bottom:10px}.sign_in input.error:focus{box-shadow:0 1px 0 rgba(204,0,7,.6)}.message #version{display:inline-block;margin-top:23px;margin-left:5%;color:#888;text-shadow:0 -1px 0 #111}.message #version span{display:none}.message #version span a{color:#888}.message input.text{float:left;width:calc(100% - 10px);padding:17px 5px 9px;margin-top:10px;background-color:transparent;color:#fff;text-shadow:0 -1px 0 #222;border:none;box-shadow:0 1px 0 rgba(255,255,255,.1);border-bottom:1px solid #222;border-radius:0;outline:0}.message input.less{margin-bottom:-10px}.message input.more{margin-bottom:30px}.message .copylink{margin-bottom:20px}.message .choice{float:left;margin:12px 5%;width:90%;color:#fff}.message .choice input{float:left}.message .choice h2{float:left;margin:1px 0 0 8px;color:#fff;font-size:14px;font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,.3)}.message .choice p{margin-top:2px;padding:0 5% 0 25px;color:#aaa;font-size:13px}.message .choice p input{width:100%;padding:10px 1px 9px;margin-top:10px}body,html{min-height:100%}body{background-color:#222;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:12px;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased}body.view{background-color:#0f0f0f}.center{position:absolute;left:50%;top:50%}*{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:color .3s,opacity .3s ease-out,-webkit-transform .3s ease-out,box-shadow .3s;transition:color .3s,opacity .3s ease-out,transform .3s ease-out,box-shadow .3s}input{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}#multiselect{position:absolute;background-color:rgba(0,94,204,.3);border:1px solid #005ecc;border-radius:3px;z-index:3}.tipsy{padding:4px;font-size:12px;position:absolute;z-index:100000;-webkit-animation-name:fadeIn;animation-name:fadeIn;-webkit-animation-duration:.3s;animation-duration:.3s}.tipsy-inner{padding:8px 10px 7px;color:#fff;max-width:200px;text-align:center;background:rgba(0,0,0,.8);border-radius:25px}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed rgba(0,0,0,.8)}.tipsy-arrow-n{border-bottom-color:rgba(0,0,0,.8)}.tipsy-arrow-s{border-top-color:rgba(0,0,0,.8)}.tipsy-arrow-e{border-left-color:rgba(0,0,0,.8)}.tipsy-arrow-w{border-right-color:rgba(0,0,0,.8)}.tipsy-n .tipsy-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}#upload{display:none}.upload_overlay{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.85);z-index:1000}.upload_message{position:absolute;display:inline-block;width:450px;margin-left:-225px;margin-top:-170px;background-image:-webkit-linear-gradient(top,#4b4b4b,#2d2d2d);background-image:linear-gradient(to bottom,#4b4b4b,#2d2d2d);border-radius:5px;box-shadow:0 0 5px #000,inset 0 1px 0 rgba(255,255,255,.08),inset 1px 0 0 rgba(255,255,255,.03),inset -1px 0 0 rgba(255,255,255,.03);-webkit-animation-name:moveUp;animation-name:moveUp;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.51,.92,.24,1.15);animation-timing-function:cubic-bezier(0.51,.92,.24,1.15)}.upload_message h1{float:left;width:100%;padding:12px 0;color:#fff;font-size:16px;font-weight:700;text-shadow:0 -1px 0 #222;text-align:center}.upload_message .close{display:none;position:absolute;top:0;right:0;padding:11px 14px 6px 7px;color:#aaa;font-size:20px;text-shadow:0 -1px 0 #222;cursor:pointer}.upload_message .close:hover{color:#fff}.upload_message .rows{float:left;margin:3px 8px 8px;width:calc(100% - 16px);height:300px;background-color:rgba(0,0,0,.5);overflow:hidden;overflow-y:scroll;border-radius:3px;box-shadow:inset 0 0 3px rgba(0,0,0,.8)}.upload_message .rows .row{float:left;display:inline-block;padding:8px 0;width:100%;background-color:rgba(255,255,255,.02)}.upload_message .rows .row:nth-child(2n){background-color:rgba(255,255,255,0)}.upload_message .rows .row a.name{float:left;padding:5px 10px;width:calc(70% - 20px);color:#fff;font-size:14px;white-space:nowrap;overflow:hidden}.upload_message .rows .row a.status{float:left;padding:5px 10px;width:calc(30% - 20px);color:rgba(255,255,255,.5);font-size:14px;text-align:right;-webkit-animation-name:pulse;animation-name:pulse;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.upload_message .rows .row a.status.error,.upload_message .rows .row a.status.success{-webkit-animation:none;animation:none}.upload_message .rows .row a.status.error{color:#d51818}.upload_message .rows .row a.status.success{color:#2ad500}.upload_message .rows .row p.notice{display:none;float:left;padding:2px 10px 5px;width:calc(100% - 20px);color:rgba(255,255,255,.5);font-size:12px;overflow:hidden;line-height:16px}@media only screen and (max-width:900px){#title{margin:0 20%!important;width:40%!important}#title.view{margin:0 20%!important;width:60%!important}#title span{display:none!important}}@media only screen and (max-width:640px){#title{display:none!important}#title.view{display:block!important;width:70%!important;margin:0 20% 0 10%!important}#button_archive,#button_move{display:none!important}.center{top:0!important;left:0!important}.album,.photo{margin:40px 0 0 50px!important}#imageview .arrow_wrapper{display:none!important}.message{position:fixed!important;width:100%!important;height:100%!important;margin:1px 0 0!important;border-radius:0!important;-webkit-animation:moveUp .3s!important;animation:moveUp .3s!important}.upload_message{margin-top:0!important;margin-left:0!important;width:100%!important}} \ No newline at end of file diff --git a/assets/min/main.js b/assets/min/main.js deleted file mode 100644 index 241d086..0000000 --- a/assets/min/main.js +++ /dev/null @@ -1,6 +0,0 @@ -function mobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(J.isFunction(t))return J.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return J.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return J.filter(t,e,n);t=J.filter(t,e)}return J.grep(e,function(e){return z.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t=ft[e]={};return J.each(e.match(ht)||[],function(e,n){t[n]=!0}),t}function r(){Q.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1),J.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+Math.random()}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(wt,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:yt.test(n)?J.parseJSON(n):n}catch(i){}vt.set(e,t,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return Q.activeElement}catch(e){}}function p(e,t){return J.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Lt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,o=e.length;o>n;n++)bt.set(e[n],"globalEval",!t||bt.get(t[n],"globalEval"))}function g(e,t){var n,o,i,a,r,s,l,u;if(1===t.nodeType){if(bt.hasData(e)&&(a=bt.access(e),r=bt.set(t,a),u=a.events)){delete r.handle,r.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}vt.hasData(e)&&(s=vt.access(e),l=J.extend({},s),vt.set(t,l))}}function b(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}function v(e,t){var n=t.nodeName.toLowerCase();"input"===n&&kt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(t,n){var o,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");return i.detach(),a}function w(e){var t=Q,n=Rt[e];return n||(n=y(e,t),"none"!==n&&n||(qt=(qt||J("