diff --git a/.htaccess b/.htaccess index b2cfacd..4eaa634 100644 --- a/.htaccess +++ b/.htaccess @@ -2,9 +2,9 @@ IndexIgnore * # Uncomment these lines to change PHP parameters if you are using the PHP Apache module # -# php_value max_execution_time 300 -# php_value post_max_size 100M -# php_value upload_max_size 100M -# php_value upload_max_filesize 5M +# php_value max_execution_time 200 +# php_value post_max_size 200M +# php_value upload_max_size 200M +# php_value upload_max_filesize 20M # php_value max_file_uploads 100 # diff --git a/.user.ini b/.user.ini index f6bf2b8..e2273cf 100644 --- a/.user.ini +++ b/.user.ini @@ -1,8 +1,8 @@ ; Uncomment these lines to change PHP parameters if you are using PHP with CGI or FastCGI. Only works with PHP starting from 5.3.0. ; Note that with FastCGI, you might also want to set FcgidBusyTimeout, FcgidIOTimeout and FcgidMaxRequestLen in your Apache config -;max_execution_time = 60 -;post_max_size = 100M -;upload_max_size = 100M -;upload_max_filesize = 5M -;max_file_uploads = 100 +;max_execution_time = 200 +;post_max_size = 200M +;upload_max_size = 200M +;upload_max_filesize = 20M +;max_file_uploads = 200 diff --git a/assets/css/min/main.css b/assets/css/min/main.css new file mode 100644 index 0000000..37ef7f7 --- /dev/null +++ b/assets/css/min/main.css @@ -0,0 +1 @@ +.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;animation-name:fadeIn}.fadeIn,.fadeOut{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:forwards;-moz-animation-duration:.3s;-moz-animation-fill-mode:forwards;animation-duration:.3s;animation-fill-mode:forwards}.fadeOut{-webkit-animation-name:fadeOut;-moz-animation-name:fadeOut;animation-name:fadeOut}.contentZoomIn{-webkit-animation-name:zoomIn;-moz-animation-name:zoomIn;animation-name:zoomIn}.contentZoomIn,.contentZoomOut{-webkit-animation-duration:.2s;-webkit-animation-fill-mode:forwards;-moz-animation-duration:.2s;-moz-animation-fill-mode:forwards;animation-duration:.2s;animation-fill-mode:forwards}.contentZoomOut{-webkit-animation-name:zoomOut;-moz-animation-name:zoomOut;animation-name:zoomOut}@-webkit-keyframes moveUp{0%{-webkit-transform:translateY(30px);opacity:0}100%{-webkit-transform:translateY(0);opacity:1}}@-moz-keyframes moveUp{0%{opacity:0}100%{opacity:1}}@keyframes moveUp{0%{transform:translateY(30px);opacity:0}100%{transform:translateY(0);opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-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}}@-moz-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}}@-moz-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(.8)}100%{opacity:1;-webkit-transform:scale(1)}}@-moz-keyframes zoomIn{0%{opacity:0}100%{opacity:1}}@keyframes zoomIn{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@-webkit-keyframes zoomOut{0%{opacity:1;-webkit-transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.8)}}@-moz-keyframes zoomOut{0%{opacity:1}100%{opacity:0}}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@-webkit-keyframes popIn{0%{opacity:0;-webkit-transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1)}}@-moz-keyframes popIn{0%{opacity:0;-moz-transform:scale(0)}100%{opacity:1;-moz-transform:scale(1)}}@keyframes popIn{0%{opacity:0;transform:scale(0)}100%{opacity:1;transform:scale(1)}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.3}100%{opacity:1}}@-moz-keyframes pulse{0%{opacity:1}50%{opacity:.8}100%{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.8}100%{opacity:1}}#content::before{content:"";position:absolute;left:0;width:100%;height:20px;background-image:-webkit-linear-gradient(top,#262626,#222);background-image:-moz-linear-gradient(top,#262626,#222);background-image:-ms-linear-gradient(top,#262626,#222);background-image:linear-gradient(top,#262626,#222);border-top:1px solid #333}#content.view::before{display:none}#content{position:absolute;padding:50px 0 33px;width:100%;-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:hover img,.photo.active img{box-shadow:0 0 5px #005ecc}.photo:active{-webkit-transition-duration:.1s;-webkit-transform:scale(.98);-moz-transition-duration:.1s;-moz-transform:scale(.98);transition-duration:.1s;transform:scale(.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(0)translateY(0)translateX(0);-moz-transform:rotate(0)translateY(0)translateX(0);transform:rotate(0)translateY(0)translateX(0);opacity:0}.album:hover img:first-child{-webkit-transform:rotate(-2deg)translateY(10px)translateX(-12px);-moz-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);-moz-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:hover img,.album.active img{box-shadow:0 0 5px #005ecc}.album .overlay,.photo .overlay{position:absolute;width:200px;height:200px;margin:2px}.album .overlay{background:-moz-linear-gradient(top,rgba(0,0,0,0)0%,rgba(0,0,0,0)20%,rgba(0,0,0,.9)100%);background:-webkit-linear-gradient(top,rgba(0,0,0,0)0%,rgba(0,0,0,0)20%,rgba(0,0,0,.9)100%);background:-ms-linear-gradient(top,rgba(0,0,0,0)0%,rgba(0,0,0,0)20%,rgba(0,0,0,.9)100%);background:linear-gradient(top,rgba(0,0,0,0)0%,rgba(0,0,0,0)20%,rgba(0,0,0,.9)100%)}.photo .overlay{background:rgba(0,0,0,.6);opacity:0}.photo:hover .overlay,.photo.active .overlay{opacity:1}.album .overlay h1,.photo .overlay h1{min-height:19px;width:190px;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}.album .badge,.photo .badge{position:absolute;margin-top:-1px;margin-left:12px;padding:12px 7px 3px;box-shadow:0 0 3px #000;border-radius:0 0 3px 3px;border:1px solid #fff;border-top:none;color:#fff;font-size:24px;text-shadow:0 1px 0 #000;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::after,.photo .badge::after{content:"";position:absolute;margin-top:-12px;margin-left:-26px;width:38px;height:5px;background:-moz-linear-gradient(top,rgba(0,0,0,1)0%,rgba(0,0,0,0)100%);background:-webkit-linear-gradient(top,rgba(0,0,0,1)0%,rgba(0,0,0,0)100%);background:-ms-linear-gradient(top,rgba(0,0,0,1)0%,rgba(0,0,0,0)100%);background:linear-gradient(top,rgba(0,0,0,1)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-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:#d64b4b;background:-webkit-linear-gradient(top,#d64b4b,#ab2c2c);background:-moz-linear-gradient(top,#d64b4b,#ab2c2c);background:-ms-linear-gradient(top,#d64b4b,#ab2c2c)}.album .badge.blue,.photo .badge.blue{background:#d64b4b;background:-webkit-linear-gradient(top,#347cd6,#2945ab);background:-moz-linear-gradient(top,#347cd6,#2945ab);background:-ms-linear-gradient(top,#347cd6,#2945ab)}.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 #000}.no_content{position:absolute;top:50%;left:50%;height:160px;width:180px;margin-top:-80px;margin-left:-90px;padding-top:20px;color:rgba(20,20,20,1);text-shadow:0 1px 0 rgba(255,255,255,.05);text-align:center}.no_content .icon{font-size:120px}.no_content p{font-size:18px}.contextmenu_bg{position:fixed;height:100%;width:100%;z-index:1000}.contextmenu{position:fixed;top:110%;left:110%;padding:5px 0 6px;background-color:#393939;background-image:-webkit-linear-gradient(top,#444,#2d2d2d);background-image:-moz-linear-gradient(top,#393939,#2d2d2d);background-image:-ms-linear-gradient(top,#393939,#2d2d2d);background-image:linear-gradient(top,#393939,#2d2d2d);border:1px solid rgba(0,0,0,.7);border-bottom:1px solid rgba(0,0,0,.9);border-radius:5px;box-shadow:0 4px 5px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.15),inset 1px 0 0 rgba(255,255,255,.05),inset -1px 0 0 rgba(255,255,255,.05);opacity:.98;z-index:1001}.contextmenu tr{font-size:14px;color:#eee;text-shadow:0 -1px 0 rgba(0,0,0,.6);cursor:pointer}.contextmenu tr:hover{background-color:#6a84f2;background-image:-webkit-linear-gradient(top,#6a84f2,#3959ef);background-image:-moz-linear-gradient(top,#6a84f2,#3959ef);background-image:-ms-linear-gradient(top,#6a84f2,#3959ef);background-image:linear-gradient(top,#6a84f2,#3959ef)}.contextmenu tr.no_hover:hover{cursor:inherit;background-color:inherit;background-image:none}.contextmenu tr.separator{float:left;height:1px;width:100%;background-color:#1c1c1c;border-bottom:1px solid #4a4a4a;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;-moz-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,.4)}.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:0 -17px -1px 0;padding:4px 6px 5px;background-color:#444;color:#fff;border:1px solid #111;box-shadow:0 1px 0 rgba(255,255,255,.1);outline:none;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.3333333333333333em}.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.3333333333333333em}.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-image:-webkit-linear-gradient(top,#3E3E3E,#282828);background-image:-moz-linear-gradient(top,#3E3E3E,#282828);background-image:-ms-linear-gradient(top,#3E3E3E,#282828);background-image:linear-gradient(top,#3E3E3E,#282828);border-bottom:1px solid #161616;z-index:1;-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;transition:transform .3s ease-out}header.hidden{-webkit-transform:translateY(-60px);-moz-transform:translateY(-60px);transform:translateY(-60px)}header.loading{-webkit-transform:translateY(2px);-moz-transform:translateY(2px);transform:translateY(2px)}header.error{-webkit-transform:translateY(40px);-moz-transform:translateY(40px);transform:translateY(40px)}header.view.error{background-color:rgba(10,10,10,.99)}header.view{background-image:none;border-bottom:none}header.view .button,header.view #title,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 #tools_albums,header #tools_album,header #tools_photo,header #button_signin{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:1px solid #131313;box-shadow:0 1px 0 rgba(255,255,255,.1);outline:none;border-radius:50px;opacity:.6;-webkit-transition:opacity .3s ease-out,-webkit-transform .3s ease-out,box-shadow .3s,width .2s ease-out;-moz-transition:opacity .3s ease-out,-moz-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 .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,.99);-webkit-transition:background-color .3s}#imageview.view{background-color:inherit}#imageview.full{background-color:#040404}#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,bottom .3s,margin-top .3s;-webkit-animation-name:zoomIn;-webkit-animation-duration:.3s;-moz-animation-name:zoomIn;-moz-animation-duration:.3s;animation-name:zoomIn;animation-duration:.3s}#imageview #image.small{top:50%;right:auto;bottom:auto;left:50%}#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;-moz-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,.85)}#infobox{z-index:4;position:fixed;right:0;width:300px;height:100%;background-color:rgba(20,20,20,.98);box-shadow:-1px 0 2px rgba(0,0,0,.8);display:none;-webkit-transform:translateX(320px);-moz-transform:translateX(320px);transform:translateX(320px);-webkit-user-select:text;-moz-user-select:text;user-select:text;-webkit-transition:-webkit-transform .5s cubic-bezier(.225,.5,.165,1);-moz-transition:-moz-transform .5s cubic-bezier(.225,.5,.165,1);transition:transform .5s cubic-bezier(.225,.5,.165,1)}#infobox.active{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0)}#infobox .wrapper{float:left;height:100%;overflow:scroll}#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-color:#1d1d1d;background-image:-webkit-linear-gradient(top,#2A2A2A,#131313);background-image:-moz-linear-gradient(top,#2A2A2A,#131313);background-image:-ms-linear-gradient(top,#2A2A2A,#131313);background-image:linear-gradient(top,#2A2A2A,#131313);border-bottom:1px solid #000}#infobox .header h1{position:absolute;margin:15px 30%;width:40%;font-size:16px;text-align:center}#infobox .header h1,#infobox .header a{color:#fff;font-weight:700;text-shadow:0 -1px 0 #000}#infobox .header a{float:right;padding:15px;font-size:20px;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 #000}#infobox table{float:left;margin:10px 0 15px 20px}#infobox table tr td{padding:5px 0;color:#fff;font-size:14px;line-height:19px}#infobox table tr td:first-child{width:110px}#infobox table tr td:last-child{padding-right:10px}#infobox #tags{margin:20px 20px 15px;color:#fff;display:inline-block}#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;-moz-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:12px;cursor:pointer;overflow:hidden;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:width .3s,margin .3s,-webkit-transform .3s;-moz-transition:width .3s,margin .3s;transition:width .3s,margin .3s,transform .3s}#infobox .tag:hover span{width:10px;margin:0 0 -2px 6px;-webkit-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;-webkit-animation-duration:.3s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear;-moz-animation-name:moveBackground;-moz-animation-duration:.3s;-moz-animation-iteration-count:infinite;-moz-animation-timing-function:linear;animation-name:moveBackground;animation-duration:.3s;animation-iteration-count:infinite;animation-timing-function:linear}#loading.loading{background-image:-webkit-linear-gradient(left,#153674 0%,#153674 47%,#2651AE 53%,#2651AE 100%);background-image:-moz-linear-gradient(left,#153674 0%,#153674 47%,#2651AE 53%,#2651AE 100%);background-image:linear-gradient(left 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:-moz-linear-gradient(left,#451317 0%,#451317 47%,#AA3039 53%,#AA3039 100%);background-image:linear-gradient(left right,#451317 0%,#451317 47%,#AA3039 53%,#AA3039 100%);z-index:1}#loading h1{margin:13px;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}@media only screen and (max-width:900px){#title{width:40%!important}#title,#title.view{margin:0 20%!important}#title.view{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_move,#button_archive{display:none!important}.center{top:0!important;left:0!important}.album,.photo{margin:40px 0 0 50px!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;-moz-animation:moveUp .3s!important;animation:moveUp .3s!important}}.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:-moz-linear-gradient(top,#4b4b4b ,#2d2d2d);background-image:-ms-linear-gradient(top,#4b4b4b ,#2d2d2d);background-image:linear-gradient(top,#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;-webkit-animation-duration:.3s;-webkit-animation-timing-function:ease-out;-moz-animation-name:moveUp;-moz-animation-duration:.3s;-moz-animation-timing-function:ease-out;animation-name:moveUp;animation-duration:.3s;animation-timing-function:ease-out}.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}.message .close{position:absolute;top:0;right:0;padding:12px 14px 6px 7px;color:#aaa;font-size:20px;text-shadow:0 -1px 0 #222;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 #222;line-height:20px}.message p b{font-weight:700}.message p a{color:#eee;text-decoration:none;border-bottom:1px dashed #888}.message .button{float:right;margin:15px 15px 15px 0;padding:6px 10px 8px;background-color:#4e4e4e;background-image:-webkit-linear-gradient(top,#3c3c3c ,#2d2d2d);background-image:-moz-linear-gradient(top,#3c3c3c ,#2d2d2d);background-image:-ms-linear-gradient(top,#3c3c3c ,#2d2d2d);background-image:linear-gradient(top,#3c3c3c ,#2d2d2d);color:#ccc;font-size:14px;font-weight:700;text-align:center;text-shadow:0 -1px 0 #222;border-radius:5px;border:1px solid #191919;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);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,.1),0 1px 0 rgba(255,255,255,.1),0 0 4px #005ecc}.message .button:hover{background-color:#565757;background-image:-webkit-linear-gradient(top,#505050 ,#393939);background-image:-moz-linear-gradient(top,#505050 ,#393939);background-image:-ms-linear-gradient(top,#505050 ,#393939);background-image:linear-gradient(top,#505050 ,#393939)}.message .button:active,.message .button.pressed{background-color:#393939;background-image:-webkit-linear-gradient(top,#393939 ,#464646);background-image:-moz-linear-gradient(top,#393939 ,#464646);background-image:-ms-linear-gradient(top,#393939 ,#464646);background-image:linear-gradient(top,#393939 ,#464646)}.sign_in{width:100%;margin-top:1px;padding:5px 0;color:#eee;font-size:14px;line-height:20px}.sign_in,.sign_in input{float:left;text-shadow:0 -1px 0 #222}.sign_in input{width:88%;padding:7px 1% 9px;margin:0 5%;background-color:transparent;color:#fff;border:none;border-bottom:1px solid #222;box-shadow:0 1px 0 rgba(255,255,255,.1);border-radius:0;outline:none}.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:none}.message input.less{margin-bottom:-10px}.message input.more{margin-bottom:30px}.message .copylink{margin-bottom:20px}html,body{min-height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}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-transition:color .3s,opacity .3s ease-out,-webkit-transform .3s ease-out,box-shadow .3s;-moz-transition:opacity .3s ease-out,-moz-transform .3s ease-out,box-shadow .3s;transition:color .3s,opacity .3s ease-out,transform .3s ease-out,box-shadow .3s}.tipsy{padding:4px;font-size:12px;position:absolute;z-index:100000;-webkit-animation-name:fadeIn;-webkit-animation-duration:.3s;-moz-animation-name:fadeIn;-moz-animation-duration:.3s;animation-name:fadeIn;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{left:50%;margin-left:-5px}.tipsy-n .tipsy-arrow,.tipsy-nw .tipsy-arrow{top:0;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{left:10px}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none}.tipsy-ne .tipsy-arrow,.tipsy-s .tipsy-arrow{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}.tipsy-sw .tipsy-arrow{left:10px}.tipsy-sw .tipsy-arrow,.tipsy-se .tipsy-arrow{bottom:0;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{right:10px}.tipsy-e .tipsy-arrow{right:0;border-left-style:solid;border-right:none}.tipsy-e .tipsy-arrow,.tipsy-w .tipsy-arrow{top:50%;margin-top:-5px;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;border-right-style:solid;border-left:none}#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:200px;margin-left:-100px;margin-top:-85px;background-color:#444;background-image:-webkit-linear-gradient(top,#4b4b4b ,#2d2d2d);background-image:-moz-linear-gradient(top,#4b4b4b ,#2d2d2d);background-image:-ms-linear-gradient(top,#4b4b4b ,#2d2d2d);background-image:linear-gradient(top,#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;-webkit-animation-duration:.3s;-webkit-animation-timing-function:ease-out;-moz-animation-name:moveUp;-moz-animation-duration:.3s;-moz-animation-timing-function:ease-out;animation-name:moveUp;animation-duration:.3s;animation-timing-function:ease-out}.upload_message a{margin:35px 0 5px;font-size:70px;text-shadow:0 1px 2px rgba(0,0,0,.5);-webkit-animation-name:pulse;-webkit-animation-duration:2s;-webkit-animation-timing-function:ease-in-out;-webkit-animation-iteration-count:infinite;-moz-animation-name:pulse;-moz-animation-duration:2s;-moz-animation-timing-function:ease-in-out;-moz-animation-iteration-count:infinite;animation-name:pulse;animation-duration:2s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.upload_message a,.upload_message p{float:left;width:100%;color:#fff;text-align:center}.upload_message p{margin:10px 0 35px;font-size:14px;text-shadow:0 -1px 0 rgba(0,0,0,.5)}.upload_message .progressbar{float:left;width:170px;height:25px;margin:15px;background-size:50px 25px;background-repeat:repeat-x;background-image:-webkit-linear-gradient(left,#191919 0%,#191919 47%,#1D1D1D 53%,#1D1D1D 100%);background-image:-moz-linear-gradient(left,#191919 0%,#191919 47%,#1D1D1D 53%,#1D1D1D 100%);background-image:linear-gradient(left right,#191919 0%,#191919 47%,#1D1D1D 53%,#1D1D1D 100%);border:1px solid #090909;box-shadow:0 1px 0 rgba(255,255,255,.06),inset 0 0 2px #222;border-radius:50px;-webkit-animation-name:moveBackground;-webkit-animation-duration:1s;-webkit-animation-timing-function:linear;-webkit-animation-iteration-count:infinite;-moz-animation-name:moveBackground;-moz-animation-duration:1s;-moz-animation-timing-function:linear;-moz-animation-iteration-count:infinite;animation-name:moveBackground;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite}.upload_message .progressbar div{float:left;width:0%;height:100%;box-shadow:0 1px 0 #000,1px 0 2px #000;background-color:#f5f2f7;background-image:-webkit-linear-gradient(top,#f5f2f7,#c7c6c8);background-image:-moz-linear-gradient(top,#f5f2f7,#c7c6c8);background-image:-ms-linear-gradient(top,#f5f2f7,#c7c6c8);background-image:linear-gradient(top,#f5f2f7,#c7c6c8);border-radius:50px;-webkit-transition:width .2s,opacity .5;-moz-transition:width .2s,opacity .5;transition:width .2s,opacity .5} \ No newline at end of file diff --git a/assets/css/min/reset.css b/assets/css/min/reset.css new file mode 100644 index 0000000..36081f8 --- /dev/null +++ b/assets/css/min/reset.css @@ -0,0 +1,11 @@ +/** + * @name reset.css + */ + +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { margin:0; padding:0; border:0; font-size:100%; 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:before,blockquote:after,q:before,q:after { content:''; content:none; } +table { border-collapse:collapse; border-spacing:0; } \ No newline at end of file diff --git a/assets/css/modules/animations.css b/assets/css/modules/animations.css new file mode 100755 index 0000000..47e1e48 --- /dev/null +++ b/assets/css/modules/animations.css @@ -0,0 +1,311 @@ +/** + * @name animations.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +/* Animation Setter ------------------------------------------------*/ +.fadeIn { + -webkit-animation-name: fadeIn; + -webkit-animation-duration: .3s; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: fadeIn; + -moz-animation-duration: .3s; + -moz-animation-fill-mode: forwards; + animation-name: fadeIn; + animation-duration: .3s; + animation-fill-mode: forwards; } + +.fadeOut { + -webkit-animation-name: fadeOut; + -webkit-animation-duration: .3s; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: fadeOut; + -moz-animation-duration: .3s; + -moz-animation-fill-mode: forwards; + animation-name: fadeOut; + animation-duration: .3s; + animation-fill-mode: forwards; } + +.contentZoomIn { + -webkit-animation-name: zoomIn; + -webkit-animation-duration: .2s; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: zoomIn; + -moz-animation-duration: .2s; + -moz-animation-fill-mode: forwards; + animation-name: zoomIn; + animation-duration: .2s; + animation-fill-mode: forwards; } + +.contentZoomOut { + -webkit-animation-name: zoomOut; + -webkit-animation-duration: .2s; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: zoomOut; + -moz-animation-duration: .2s; + -moz-animation-fill-mode: forwards; + animation-name: zoomOut; + animation-duration: .2s; + animation-fill-mode: forwards; } + +/* moveUp ------------------------------------------------*/ +@-webkit-keyframes moveUp { + 0% { + -webkit-transform: translateY(30px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + opacity: 1; + } +} +@-moz-keyframes moveUp { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes moveUp { + 0% { + transform: translateY(30px); + opacity: 0; + } + 100% { + transform: translateY(0); + opacity: 1; + } +} + +/* fadeIn ------------------------------------------------*/ +@-webkit-keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@-moz-keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +/* fadeOut ------------------------------------------------*/ +@-webkit-keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} +@-moz-keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} +@keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +/* moveBackground ------------------------------------------------*/ +@-webkit-keyframes moveBackground { + 0% { + background-position-x: 0px; + } + 100% { + background-position-x: -100px; + } +} +@-moz-keyframes moveBackground { + 0% { + background-position-x: 0px; + } + 100% { + background-position-x: -100px; + } +} +@keyframes moveBackground { + 0% { + background-position-x: 0px; + } + 100% { + background-position-x: -100px; + } +} + +/* zoomIn ------------------------------------------------*/ +@-webkit-keyframes zoomIn { + 0% { + opacity: 0; + -webkit-transform: scale(.8); + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + } +} +@-moz-keyframes zoomIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes zoomIn { + 0% { + opacity: 0; + transform: scale(.8); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +/* zoomOut ------------------------------------------------*/ +@-webkit-keyframes zoomOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.8); + } +} +@-moz-keyframes zoomOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} +@keyframes zoomOut { + 0% { + opacity: 1; + transform: scale(1); + } + 100% { + opacity: 0; + transform: scale(.8); + } +} + +/* popIn ------------------------------------------------*/ +@-webkit-keyframes popIn { + 0% { + opacity: 0; + -webkit-transform: scale(0); + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + } +} +@-moz-keyframes popIn { + 0% { + opacity: 0; + -moz-transform: scale(0); + } + 100% { + opacity: 1; + -moz-transform: scale(1); + } +} +@keyframes popIn { + 0% { + opacity: 0; + transform: scale(0); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +/* pulse ------------------------------------------------*/ +@-webkit-keyframes pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.3; + } + 100% { + opacity: 1; + } +} +@-moz-keyframes pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.8; + } + 100% { + opacity: 1; + } +} +@keyframes pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.8; + } + 100% { + opacity: 1; + } +} + +/* rotate ------------------------------------------------ +@-webkit-keyframes rotate { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} +@-moz-keyframes rotate { + 0% { + -moz-transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(360deg); + } +} +@keyframes rotate { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} */ \ No newline at end of file diff --git a/assets/css/modules/content.css b/assets/css/modules/content.css new file mode 100644 index 0000000..e886839 --- /dev/null +++ b/assets/css/modules/content.css @@ -0,0 +1,256 @@ +/** + * @name content.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +#content::before { + content: ""; + position: absolute; + left: 0px; + width: 100%; + height: 20px; + background-image: -webkit-linear-gradient(top, #262626, #222); + background-image: -moz-linear-gradient(top, #262626, #222); + background-image: -ms-linear-gradient(top, #262626, #222); + background-image: linear-gradient(top, #262626, #222); + border-top: 1px solid #333; +} + + /* Modes ------------------------------------------------*/ + #content.view::before { + display: none; + } + +#content { + position: absolute; + padding: 50px 0px 33px 0px; + width: 100%; + -webkit-overflow-scrolling: touch; +} + + /* Photo ------------------------------------------------*/ + .photo { + float: left; + display: inline-block; + width: 206px; + height: 206px; + margin: 30px 0px 0px 30px; + cursor: pointer; + } + .photo img { + position: absolute; + width: 200px; + height: 200px; + background-color: #222; + border-radius: 2px; + border: 2px solid #ccc; + } + .photo:hover img, + .photo.active img { + box-shadow: 0px 0px 5px #005ecc; + } + .photo:active { + -webkit-transition-duration: .1s; + -webkit-transform: scale(.98); + -moz-transition-duration: .1s; + -moz-transform: scale(.98); + transition-duration: .1s; + transform: scale(.98); + } + + /* Album ------------------------------------------------*/ + .album { + float: left; + display: inline-block; + width: 204px; + height: 204px; + margin: 30px 0px 0px 30px; + cursor: pointer; + } + .album img:first-child, + .album img:nth-child(2) { + -webkit-transform: rotate(0deg) translateY(0px) translateX(0px); + -moz-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); + -moz-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); + -moz-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:hover img, + .album.active img { + box-shadow: 0px 0px 5px #005ecc; + } + + /* Album/Photo Overlay ------------------------------------------------*/ + .album .overlay, + .photo .overlay { + position: absolute; + width: 200px; + height: 200px; + margin: 2px; + } + .album .overlay { + background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0.9) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* Chrome10+,Safari5.1+ */ + background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* IE10+ */ + background: linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* W3C */ + } + .photo .overlay { + background: rgba(0, 0, 0, .6); + opacity: 0; + } + .photo:hover .overlay, + .photo.active .overlay { + opacity: 1; + } + .album .overlay h1, + .photo .overlay h1 { + min-height: 19px; + width: 190px; + margin: 153px 0px 3px 15px; + color: #fff; + font-size: 16px; + font-weight: bold; + overflow: hidden; + } + .album .overlay a, + .photo .overlay a { + font-size: 11px; + color: #aaa; + } + .album .overlay a { + margin-left: 15px; + } + .photo .overlay a { + margin: 155px 0px 5px 15px; + } + + /* Badges ------------------------------------------------*/ + .album .badge, + .photo .badge { + position: absolute; + margin-top: -1px; + margin-left: 12px; + padding: 12px 7px 3px 7px; + box-shadow: 0px 0px 3px #000; + border-radius: 0px 0px 3px 3px; + border: 1px solid #fff; + border-top: none; + color: #fff; + font-size: 24px; + text-shadow: 0px 1px 0px #000; + opacity: .9; + } + .album .badge.icon-star, + .photo .badge.icon-star { + padding: 12px 8px 3px 8px; + } + .album .badge.icon-share, + .photo .badge.icon-share { + padding: 12px 6px 3px 8px; + } + .album .badge::after, + .photo .badge::after { + content: ""; + position: absolute; + margin-top: -12px; + margin-left: -26px; + width: 38px; + height: 5px; + background: -moz-linear-gradient(top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */ + background: -ms-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* IE10+ */ + background: linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* W3C */ + 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-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: #d64b4b; + background: -webkit-linear-gradient(top, #d64b4b, #ab2c2c); + background: -moz-linear-gradient(top, #d64b4b, #ab2c2c); + background: -ms-linear-gradient(top, #d64b4b, #ab2c2c); + } + .album .badge.blue, + .photo .badge.blue { + background: #d64b4b; + background: -webkit-linear-gradient(top, #347cd6, #2945ab); + background: -moz-linear-gradient(top, #347cd6, #2945ab); + background: -ms-linear-gradient(top, #347cd6, #2945ab); + } + + /* Divider ------------------------------------------------*/ + .divider { + float: left; + width: 100%; + margin-top: 50px; + opacity: 0; + border-top: 1px solid #2E2E2E; + box-shadow: 0px -1px 0px #151515; + } + .divider:first-child { + margin-top: 0px; + border-top: none; + } + .divider h1 { + float: left; + margin: 20px 0px 0px 30px; + color: #fff; + font-size: 14px; + font-weight: bold; + text-shadow: 0px -1px 0px #000; + } + + /* No Content ------------------------------------------------*/ + .no_content { + position: absolute; + top: 50%; + left: 50%; + height: 160px; + width: 180px; + margin-top: -80px; + margin-left: -90px; + padding-top: 20px; + color: rgba(20, 20, 20, 1); + text-shadow: 0px 1px 0px rgba(255, 255, 255, .05); + text-align: center; + } + .no_content .icon { + font-size: 120px; + } + .no_content p { + font-size: 18px; + } \ No newline at end of file diff --git a/assets/css/modules/contextmenu.css b/assets/css/modules/contextmenu.css new file mode 100644 index 0000000..fa6d60e --- /dev/null +++ b/assets/css/modules/contextmenu.css @@ -0,0 +1,101 @@ +/** + * @name contextmenu.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +.contextmenu_bg { + position: fixed; + height: 100%; + width: 100%; + z-index: 1000; +} +.contextmenu { + position: fixed; + top: 110%; + left: 110%; + padding: 5px 0px 6px 0px; + background-color: #393939; + background-image: -webkit-linear-gradient(top, #444, #2d2d2d); + background-image: -moz-linear-gradient(top, #393939, #2d2d2d); + background-image: -ms-linear-gradient(top, #393939, #2d2d2d); + background-image: linear-gradient(top, #393939, #2d2d2d); + border: 1px solid rgba(0,0,0,0.7); + border-bottom: 1px solid rgba(0,0,0,.9); + border-radius: 5px; + box-shadow: 0px 4px 5px rgba(0,0,0,0.3), inset 0px 1px 0px rgba(255,255,255,0.15), inset 1px 0px 0px rgba(255,255,255,0.05), inset -1px 0px 0px rgba(255,255,255,0.05); + opacity: .98; + z-index: 1001; +} + + /* Items ------------------------------------------------*/ + .contextmenu tr { + font-size: 14px; + color: #eee; + text-shadow: 0px -1px 0px rgba(0,0,0,.6); + cursor: pointer; + } + .contextmenu tr:hover { + background-color: #6a84f2; + background-image: -webkit-linear-gradient(top, #6a84f2, #3959ef); + background-image: -moz-linear-gradient(top, #6a84f2, #3959ef); + background-image: -ms-linear-gradient(top, #6a84f2, #3959ef); + background-image: linear-gradient(top, #6a84f2, #3959ef); + } + .contextmenu tr.no_hover:hover { + cursor: inherit; + background-color: inherit; + background-image: none; + } + .contextmenu tr.separator { + float: left; + height: 1px; + width: 100%; + background-color: #1c1c1c; + border-bottom: 1px solid #4a4a4a; + margin: 5px 0px; + 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; + -moz-transition: none; + transition: none; + } + .contextmenu tr:hover td { + color: #fff; + box-shadow: inset 0px 1px 0px rgba(255,255,255,.05); + text-shadow: 0px -1px 0px rgba(0,0,0,.4); + } + .contextmenu tr.no_hover:hover td { + box-shadow: none; + } + .contextmenu tr a { + float: left; + width: 10px; + margin-right: 10px; + text-align: center; + } + + /* Direct Link Input ------------------------------------------------*/ + .contextmenu #link { + float: right; + width: 140px; + margin: 0px -17px -1px 0px; + padding: 4px 6px 5px 6px; + background-color: #444; + color: #fff; + border: none; + border: 1px solid #111; + box-shadow: 0px 1px 0px rgba(255,255,255,.1); + outline: none; + border-radius: 5px; + } + .contextmenu tr a#link_icon { + padding-top: 4px; + } \ No newline at end of file diff --git a/css/font-awesome.css b/assets/css/modules/font.css similarity index 97% rename from css/font-awesome.css rename to assets/css/modules/font.css index f1b1458..3517a48 100755 --- a/css/font-awesome.css +++ b/assets/css/modules/font.css @@ -23,8 +23,8 @@ */ @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'); + 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: normal; font-style: normal; } @@ -300,4 +300,4 @@ li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before { .icon-umbrella:before { content: "\f0e9"; } .icon-paste:before { content: "\f0ea"; } -.icon-user-md:before { content: "\f200"; } +.icon-user-md:before { content: "\f200"; } \ No newline at end of file diff --git a/assets/css/modules/header.css b/assets/css/modules/header.css new file mode 100644 index 0000000..2e6ee7c --- /dev/null +++ b/assets/css/modules/header.css @@ -0,0 +1,165 @@ +/** + * @name _header.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +header { + position: fixed; + height: 49px; + width: 100%; + background-image: -webkit-linear-gradient(top, #3E3E3E, #282828); + background-image: -moz-linear-gradient(top, #3E3E3E, #282828); + background-image: -ms-linear-gradient(top, #3E3E3E, #282828); + background-image: linear-gradient(top, #3E3E3E, #282828); + border-bottom: 1px solid #161616; + z-index: 1; + + -webkit-transition: -webkit-transform .3s ease-out; + -moz-transition: -moz-transform .3s ease-out; + transition: transform .3s ease-out; +} + + /* Modes ------------------------------------------------*/ + header.hidden { + -webkit-transform: translateY(-60px); + -moz-transform: translateY(-60px); + transform: translateY(-60px); + } + header.loading { + -webkit-transform: translateY(2px); + -moz-transform: translateY(2px); + transform: translateY(2px); + } + header.error { + -webkit-transform: translateY(40px); + -moz-transform: translateY(40px); + transform: translateY(40px); + } + header.view.error { + background-color: rgba(10,10,10,.99); + } + header.view { + background-image: none; + border-bottom: none; + } + header.view .button, + header.view #title, + header.view .tools { + text-shadow: none !important; + } + + /* Title ------------------------------------------------*/ + header #title { + position: absolute; + margin: 0px 30%; + width: 40%; + padding: 15px 0px; + color: #fff; + font-size: 16px; + font-weight: bold; + text-align: center; + text-shadow: 0px -1px 0px #222; + } + header #title.editable { + cursor: pointer; + } + + /* Button ------------------------------------------------*/ + header .button { + color: #888; + font-family: 'FontAwesome'; + font-size: 21px; + font-weight: bold; + text-decoration: none !important; + cursor: pointer; + text-shadow: 0px -1px 0px #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 #tools_albums, + header #tools_album, + header #tools_photo, + header #button_signin { + display: none; + } + + /* Button Divider ------------------------------------------------*/ + header .button_divider { + float: right; + position: relative; + width: 14px; + height: 50px; + } + + /* Search ------------------------------------------------*/ + header #search { + float: right; + width: 80px; + margin: 12px 12px 0px 0px; + padding: 5px 12px 6px 12px; + background-color: #383838; + color: #fff; + border: none; + border: 1px solid #131313; + box-shadow: 0px 1px 0px rgba(255,255,255,.1); + outline: none; + border-radius: 50px; + opacity: .6; + + -webkit-transition: opacity .3s ease-out, -webkit-transform .3s ease-out, box-shadow .3s, width .2s ease-out; + -moz-transition: opacity .3s ease-out, -moz-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; + } + + /* Tools ------------------------------------------------*/ + header .tools:first-of-type { + margin-right: 6px; + } + header .tools { + float: right; + padding: 14px 8px; + color: #888; + font-size: 21px; + text-shadow: 0px -1px 0px #222; + cursor: pointer; + } + header .tools:hover a { + color: #fff; + } + header .tools .icon-star { + color: #f0ef77; + } + header .tools .icon-share.active { + color: #ff9737; + } + + /* Hosted with Lychee ------------------------------------------------*/ + header #hostedwith { + float: right; + padding: 5px 10px; + margin: 13px 9px; + color: #888; + font-size: 13px; + text-shadow: 0px -1px 0px #222; + display: none; + cursor: pointer; + } + header #hostedwith:hover { + background-color: rgba(0, 0, 0, .2); + border-radius: 100px; + } \ No newline at end of file diff --git a/assets/css/modules/imageview.css b/assets/css/modules/imageview.css new file mode 100644 index 0000000..db910a2 --- /dev/null +++ b/assets/css/modules/imageview.css @@ -0,0 +1,88 @@ +/** + * @name imageview.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +#imageview { + position: fixed; + display: none; + width: 100%; + min-height: 100%; + background-color: rgba(10,10,10,.99); + + -webkit-transition: background-color .3s; +} + + /* Modes ------------------------------------------------*/ + #imageview.view { + background-color: inherit; + } + #imageview.full { + background-color: #040404; + } + + /* ImageView ------------------------------------------------*/ + #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, bottom .3s, margin-top .3s; + + -webkit-animation-name: zoomIn; + -webkit-animation-duration: .3s; + -moz-animation-name: zoomIn; + -moz-animation-duration: .3s; + animation-name: zoomIn; + animation-duration: .3s; + } + #imageview #image.small { + top: 50%; + right: auto; + bottom: auto; + left: 50%; + } + + /* Previous/Next Buttons ------------------------------------------------*/ + #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: 0px 1px 2px #000; + cursor: pointer; + opacity: 0; + z-index: 2; + -webkit-transition: opacity .2s; + -moz-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; + } \ No newline at end of file diff --git a/assets/css/modules/infobox.css b/assets/css/modules/infobox.css new file mode 100644 index 0000000..8584387 --- /dev/null +++ b/assets/css/modules/infobox.css @@ -0,0 +1,173 @@ +/** + * @name infobox.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +#infobox_overlay { + z-index: 3; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + background-color: rgba(0,0,0,.85); +} +#infobox { + z-index: 4; + position: fixed; + right: 0px; + width: 300px; + height: 100%; + background-color: rgba(20,20,20,0.98); + box-shadow: -1px 0px 2px rgba(0,0,0,.8); + display: none; + + -webkit-transform: translateX(320px); + -moz-transform: translateX(320px); + transform: translateX(320px); + + -webkit-user-select: text; + -moz-user-select: text; + user-select: text; + + -webkit-transition: -webkit-transform .5s cubic-bezier(.225,.5,.165,1); + -moz-transition: -moz-transform .5s cubic-bezier(.225,.5,.165,1); + transition: transform .5s cubic-bezier(.225,.5,.165,1); +} +#infobox.active { + -webkit-transform: translateX(0px); + -moz-transform: translateX(0px); + transform: translateX(0px); +} + + /* Misc ------------------------------------------------*/ + #infobox .wrapper { + float: left; + height: 100%; + overflow: scroll; + } + #infobox .edit { + display: inline; + margin-left: 3px; + width: 20px; + height: 5px; + cursor: pointer; + } + #infobox .bumper { + float: left; + width: 100%; + height: 50px; + } + + /* Header ------------------------------------------------*/ + #infobox .header { + float: left; + height: 49px; + width: 100%; + background-color: #1d1d1d; + background-image: -webkit-linear-gradient(top, #2A2A2A, #131313); + background-image: -moz-linear-gradient(top, #2A2A2A, #131313); + background-image: -ms-linear-gradient(top, #2A2A2A, #131313); + background-image: linear-gradient(top, #2A2A2A, #131313); + border-bottom: 1px solid #000; + } + #infobox .header h1 { + position: absolute; + margin: 15px 30%; + width: 40%; + color: #fff; + font-size: 16px; + font-weight: bold; + text-align: center; + text-shadow: 0px -1px 0px #000; + } + #infobox .header a { + float: right; + padding: 15px 15px; + color: #fff; + font-size: 20px; + font-weight: bold; + text-shadow: 0px -1px 0px #000; + opacity: .5; + cursor: pointer; + } + #infobox .header a:hover { + opacity: 1; + } + + /* Seperator ------------------------------------------------*/ + #infobox .separator { + float: left; + width: 100%; + border-top: 1px solid rgba(255,255,255,.04); + box-shadow: 0px -1px 0px #000; + } + #infobox .separator h1 { + margin: 20px 0px 5px 20px; + color: #fff; + font-size: 14px; + font-weight: bold; + text-shadow: 0px -1px 0px #000; + } + + /* Table ------------------------------------------------*/ + #infobox table { + float: left; + margin: 10px 0px 15px 20px; + } + #infobox table tr td { + padding: 5px 0px; + color: #fff; + font-size: 14px; + line-height: 19px; + } + #infobox table tr td:first-child { + width: 110px; + } + #infobox table tr td:last-child { + padding-right: 10px; + } + + /* Tags ------------------------------------------------*/ + #infobox #tags { + margin: 20px 20px 15px 20px; + color: #fff; + display: inline-block; + } + #infobox .tag { + float: left; + padding: 4px 7px; + margin: 0px 6px 8px 0px; + 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; + -moz-transition: border .3s; + transition: border .3s; + } + #infobox .tag:hover { + border: 2px solid #aaa; + } + #infobox .tag span { + float: right; + width: 0px; + padding: 0px; + margin: 0px 0px -2px 0px; + color: red; + font-size: 12px; + cursor: pointer; + overflow: hidden; + -webkit-transform: scale(0); + transform: scale(0); + -webkit-transition: width .3s, margin .3s, -webkit-transform .3s; + -moz-transition: width .3s, margin .3s; + transition: width .3s, margin .3s, transform .3s; + } + #infobox .tag:hover span { + width: 10px; + margin: 0px 0px -2px 6px; + -webkit-transform: scale(1); + transform: scale(1); + } \ No newline at end of file diff --git a/assets/css/modules/loading.css b/assets/css/modules/loading.css new file mode 100644 index 0000000..eb49536 --- /dev/null +++ b/assets/css/modules/loading.css @@ -0,0 +1,59 @@ +/** + * @name loading.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +#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; + + /* Animation */ + -webkit-animation-name: moveBackground; + -webkit-animation-duration: .3s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + -moz-animation-name: moveBackground; + -moz-animation-duration: .3s; + -moz-animation-iteration-count: infinite; + -moz-animation-timing-function: linear; + animation-name: moveBackground; + animation-duration: .3s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} + + /* Modes ------------------------------------------------*/ + #loading.loading { + background-image: -webkit-linear-gradient(left, #153674 0%, #153674 47%, #2651AE 53%, #2651AE 100%); + background-image: -moz-linear-gradient(left, #153674 0%, #153674 47%, #2651AE 53%, #2651AE 100%); + background-image: linear-gradient(left 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: -moz-linear-gradient(left, #451317 0%, #451317 47%, #AA3039 53%, #AA3039 100%); + background-image: linear-gradient(left right, #451317 0%, #451317 47%, #AA3039 53%, #AA3039 100%); + z-index: 1; + } + + /* Content ------------------------------------------------*/ + #loading h1 { + margin: 13px; + color: #ddd; + font-size: 14px; + font-weight: bold; + text-shadow: 0px 1px 0px #000; + text-transform: capitalize; + } + #loading h1 span { + margin-left: 10px; + font-weight: normal; + text-transform: none; + } \ No newline at end of file diff --git a/assets/css/modules/mediaquery.css b/assets/css/modules/mediaquery.css new file mode 100644 index 0000000..f9a193d --- /dev/null +++ b/assets/css/modules/mediaquery.css @@ -0,0 +1,61 @@ +/** + * @name mediaquery.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +@media only screen and (max-width: 900px) { + + #title { + margin: 0px 20% !important; + width: 40% !important; + } + #title.view { + margin: 0px 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: 0px 20% 0px 10% !important; + } + #button_move { + display: none !important; + } + #button_archive { + display: none !important; + } + + .center { + top: 0px !important; + left: 0px !important; + } + + .album, .photo { + margin: 40px 0px 0px 50px !important; + } + + .message { + position: fixed !important; + width: 100% !important; + height: 100% !important; + margin: 1px 0px 0px 0px !important; + border-radius: 0px !important; + + /* Animation */ + -webkit-animation: moveUp .3s !important; + -moz-animation: moveUp .3s !important; + animation: moveUp .3s !important; + } + +} \ No newline at end of file diff --git a/assets/css/modules/message.css b/assets/css/modules/message.css new file mode 100644 index 0000000..a28dbe5 --- /dev/null +++ b/assets/css/modules/message.css @@ -0,0 +1,198 @@ +/** + * @name message.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +.message_overlay { + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + 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, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: -moz-linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: -ms-linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + border-radius: 5px; + box-shadow: 0px 0px 5px #000, inset 0px 1px 0px rgba(255,255,255,.08), inset 1px 0px 0px rgba(255,255,255,.03), inset -1px 0px 0px rgba(255,255,255,.03); + + /* Animation */ + -webkit-animation-name: moveUp; + -webkit-animation-duration: .3s; + -webkit-animation-timing-function: ease-out; + -moz-animation-name: moveUp; + -moz-animation-duration: .3s; + -moz-animation-timing-function: ease-out; + animation-name: moveUp; + animation-duration: .3s; + animation-timing-function: ease-out; +} + + /* Header ------------------------------------------------*/ + .message h1 { + float: left; + width: 100%; + padding: 12px 0px; + color: #fff; + font-size: 16px; + font-weight: bold; + text-shadow: 0px -1px 0px #222; + text-align: center; + } + .message .close { + position: absolute; + top: 0px; + right: 0px; + padding: 12px 14px 6px 7px; + color: #aaa; + font-size: 20px; + text-shadow: 0px -1px 0px #222; + cursor: pointer; + } + .message .close:hover { + color: #fff; + } + + /* Text ------------------------------------------------*/ + .message p { + float: left; + width: 90%; + margin-top: 1px; + padding: 12px 5% 15px 5%; + color: #eee; + font-size: 14px; + text-shadow: 0px -1px 0px #222; + line-height: 20px; + } + .message p b { + font-weight: bold; + } + .message p a { + color: #eee; + text-decoration: none; + border-bottom: 1px dashed #888; + } + + /* Button ------------------------------------------------*/ + .message .button { + float: right; + margin: 15px 15px 15px 0px; + padding: 6px 10px 8px 10px; + background-color: #4e4e4e; + background-image: -webkit-linear-gradient(top, rgb(60, 60, 60), rgb(45, 45, 45)); + background-image: -moz-linear-gradient(top, rgb(60, 60, 60), rgb(45, 45, 45)); + background-image: -ms-linear-gradient(top, rgb(60, 60, 60), rgb(45, 45, 45)); + background-image: linear-gradient(top, rgb(60, 60, 60), rgb(45, 45, 45)); + color: #ccc; + font-size: 14px; + font-weight: bold; + text-align: center; + text-shadow: 0px -1px 0px #222; + border-radius: 5px; + border: 1px solid #191919; + box-shadow: inset 0px 1px 0px rgba(255,255,255,.1), 0px 1px 0px rgba(255,255,255,.1); + cursor: pointer; + } + .message .button:first-of-type { + margin: 15px 5% 18px 0px !important; + } + .message .button.active { + color: #fff; + box-shadow: inset 0px 1px 0px rgba(255,255,255,.1), 0px 1px 0px rgba(255,255,255,.1), 0px 0px 4px #005ecc; + } + .message .button:hover { + background-color: #565757; + background-image: -webkit-linear-gradient(top, rgb(80, 80, 80), rgb(57, 57, 57)); + background-image: -moz-linear-gradient(top, rgb(80, 80, 80), rgb(57, 57, 57)); + background-image: -ms-linear-gradient(top, rgb(80, 80, 80), rgb(57, 57, 57)); + background-image: linear-gradient(top, rgb(80, 80, 80), rgb(57, 57, 57)); + } + .message .button:active, + .message .button.pressed { + background-color: #393939; + background-image: -webkit-linear-gradient(top, rgb(57, 57, 57), rgb(70, 70, 70)); + background-image: -moz-linear-gradient(top, rgb(57, 57, 57), rgb(70, 70, 70)); + background-image: -ms-linear-gradient(top, rgb(57, 57, 57), rgb(70, 70, 70)); + background-image: linear-gradient(top, rgb(57, 57, 57), rgb(70, 70, 70)); + } + + /* Sign in ------------------------------------------------*/ + .sign_in { + float: left; + width: 100%; + margin-top: 1px; + padding: 5px 0px; + color: #eee; + font-size: 14px; + text-shadow: 0px -1px 0px #222; + line-height: 20px; + } + .sign_in input { + float: left; + width: 88%; + padding: 7px 1% 9px 1%; + margin: 0px 5%; + background-color: transparent; + color: #fff; + text-shadow: 0px -1px 0px #222; + border: none; + border-bottom: 1px solid #222; + box-shadow: 0px 1px 0px rgba(255,255,255,.1); + border-radius: 0px; + outline: none; + } + .sign_in input:first-of-type { + margin-bottom: 10px; + } + .sign_in input.error:focus { + box-shadow: 0px 1px 0px rgba(204, 0, 7, 0.6); + } + .message #version { + display: inline-block; + margin-top: 23px; + margin-left: 5%; + color: #888; + text-shadow: 0px -1px 0px #111; + } + .message #version span { + display: none; + } + .message #version span a { + color: #888; + } + + /* Input Misc ------------------------------------------------*/ + .message input.text { + float: left; + width: calc(100% - 10px); + padding: 17px 5px 9px 5px; + margin-top: 10px; + background-color: transparent; + color: #fff; + text-shadow: 0px -1px 0px #222; + border: none; + box-shadow: 0px 1px 0px rgba(255,255,255,.1); + border-bottom: 1px solid #222; + border-radius: 0px; + outline: none; + } + .message input.less { + margin-bottom: -10px; + } + .message input.more { + margin-bottom: 30px; + } + .message .copylink { + margin-bottom: 20px; + } \ No newline at end of file diff --git a/assets/css/modules/misc.css b/assets/css/modules/misc.css new file mode 100755 index 0000000..a44002f --- /dev/null +++ b/assets/css/modules/misc.css @@ -0,0 +1,35 @@ +/** + * @name misc.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +html, +body { + min-height: 100%; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +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-transition: color .3s, opacity .3s ease-out, -webkit-transform .3s ease-out, box-shadow .3s; + -moz-transition: opacity .3s ease-out, -moz-transform .3s ease-out, box-shadow .3s; + transition: color .3s, opacity .3s ease-out, transform .3s ease-out, box-shadow .3s; +} \ No newline at end of file diff --git a/assets/css/modules/tooltip.css b/assets/css/modules/tooltip.css new file mode 100644 index 0000000..8958666 --- /dev/null +++ b/assets/css/modules/tooltip.css @@ -0,0 +1,39 @@ +/** + * @name tooltip.css + */ + +.tipsy { + padding: 4px; + font-size: 12px; + position: absolute; + z-index: 100000; + + /* Animation */ + -webkit-animation-name: fadeIn; + -webkit-animation-duration: .3s; + -moz-animation-name: fadeIn; + -moz-animation-duration: .3s; + animation-name: fadeIn; + 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: 0px; 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; } \ No newline at end of file diff --git a/assets/css/modules/upload.css b/assets/css/modules/upload.css new file mode 100644 index 0000000..32d9b1b --- /dev/null +++ b/assets/css/modules/upload.css @@ -0,0 +1,123 @@ +/** + * @name upload.css + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +#upload { + display: none; +} +.upload_overlay { + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + background-color: rgba(0,0,0,.85); + z-index: 1000; +} +.upload_message { + position: absolute; + display: inline-block; + width: 200px; + margin-left: -100px; + margin-top: -85px; + background-color: #444; + background-image: -webkit-linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: -moz-linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: -ms-linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + background-image: linear-gradient(top, rgb(75, 75, 75), rgb(45, 45, 45)); + border-radius: 5px; + box-shadow: 0px 0px 5px #000, inset 0px 1px 0px rgba(255,255,255,.08), inset 1px 0px 0px rgba(255,255,255,.03), inset -1px 0px 0px rgba(255,255,255,.03); + + /* Animation */ + -webkit-animation-name: moveUp; + -webkit-animation-duration: .3s; + -webkit-animation-timing-function: ease-out; + -moz-animation-name: moveUp; + -moz-animation-duration: .3s; + -moz-animation-timing-function: ease-out; + animation-name: moveUp; + animation-duration: .3s; + animation-timing-function: ease-out; +} + + /* Icon ------------------------------------------------*/ + .upload_message a { + float: left; + width: 100%; + margin: 35px 0px 5px 0px; + color: #fff; + font-size: 70px; + text-shadow: 0px 1px 2px rgba(0,0,0,.5); + text-align: center; + + -webkit-animation-name: pulse; + -webkit-animation-duration: 2s; + -webkit-animation-timing-function: ease-in-out; + -webkit-animation-iteration-count: infinite; + -moz-animation-name: pulse; + -moz-animation-duration: 2s; + -moz-animation-timing-function: ease-in-out; + -moz-animation-iteration-count: infinite; + animation-name: pulse; + animation-duration: 2s; + animation-timing-function: ease-in-out; + animation-iteration-count: infinite; + } + + /* Text ------------------------------------------------*/ + .upload_message p { + float: left; + width: 100%; + margin: 10px 0px 35px 0px; + color: #fff; + font-size: 14px; + text-align: center; + text-shadow: 0px -1px 0px rgba(0,0,0,.5); + } + + /* Progress ------------------------------------------------*/ + .upload_message .progressbar { + float: left; + width: 170px; + height: 25px; + margin: 15px; + background-size: 50px 25px; + background-repeat: repeat-x; + background-image: -webkit-linear-gradient(left, #191919 0%, #191919 47%, #1D1D1D 53%, #1D1D1D 100%); + background-image: -moz-linear-gradient(left, #191919 0%, #191919 47%, #1D1D1D 53%, #1D1D1D 100%); + background-image: linear-gradient(left right, #191919 0%, #191919 47%, #1D1D1D 53%, #1D1D1D 100%); + border: 1px solid #090909; + box-shadow: 0 1px 0 rgba(255,255,255,.06), inset 0px 0px 2px #222; + border-radius: 50px; + + /* Animation */ + -webkit-animation-name: moveBackground; + -webkit-animation-duration: 1s; + -webkit-animation-timing-function: linear; + -webkit-animation-iteration-count: infinite; + -moz-animation-name: moveBackground; + -moz-animation-duration: 1s; + -moz-animation-timing-function: linear; + -moz-animation-iteration-count: infinite; + animation-name: moveBackground; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + } + .upload_message .progressbar div { + float: left; + width: 0%; + height: 100%; + box-shadow: 0 1px 0 #000, 1px 0px 2px #000; + background-color: #f5f2f7; + background-image: -webkit-linear-gradient(top, #f5f2f7, #c7c6c8); + background-image: -moz-linear-gradient(top, #f5f2f7, #c7c6c8); + background-image: -ms-linear-gradient(top, #f5f2f7, #c7c6c8); + background-image: linear-gradient(top, #f5f2f7, #c7c6c8); + border-radius: 50px; + -webkit-transition: width .2s, opacity .5; + -moz-transition: width .2s, opacity .5; + transition: width .2s, opacity .5; + } \ No newline at end of file diff --git a/css/font/fontawesome-webfont.eot b/assets/font/fontawesome-webfont.eot similarity index 100% rename from css/font/fontawesome-webfont.eot rename to assets/font/fontawesome-webfont.eot diff --git a/css/font/fontawesome-webfont.svg b/assets/font/fontawesome-webfont.svg similarity index 100% rename from css/font/fontawesome-webfont.svg rename to assets/font/fontawesome-webfont.svg diff --git a/css/font/fontawesome-webfont.ttf b/assets/font/fontawesome-webfont.ttf similarity index 100% rename from css/font/fontawesome-webfont.ttf rename to assets/font/fontawesome-webfont.ttf diff --git a/css/font/fontawesome-webfont.woff b/assets/font/fontawesome-webfont.woff similarity index 100% rename from css/font/fontawesome-webfont.woff rename to assets/font/fontawesome-webfont.woff diff --git a/assets/img/apple-touch-icon-ipad.png b/assets/img/apple-touch-icon-ipad.png new file mode 100644 index 0000000..4e552b3 Binary files /dev/null and b/assets/img/apple-touch-icon-ipad.png differ diff --git a/assets/img/apple-touch-icon-iphone.png b/assets/img/apple-touch-icon-iphone.png new file mode 100644 index 0000000..d0861b0 Binary files /dev/null and b/assets/img/apple-touch-icon-iphone.png differ diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico new file mode 100644 index 0000000..76fe01b Binary files /dev/null and b/assets/img/favicon.ico differ diff --git a/assets/img/no_images.svg b/assets/img/no_images.svg new file mode 100644 index 0000000..106c6e4 --- /dev/null +++ b/assets/img/no_images.svg @@ -0,0 +1 @@ +no_images \ No newline at end of file diff --git a/assets/img/password.svg b/assets/img/password.svg new file mode 100644 index 0000000..34bca5b --- /dev/null +++ b/assets/img/password.svg @@ -0,0 +1 @@ +password \ No newline at end of file diff --git a/js/frameworks.js b/assets/js/min/frameworks.js similarity index 100% rename from js/frameworks.js rename to assets/js/min/frameworks.js diff --git a/assets/js/min/main.js b/assets/js/min/main.js new file mode 100644 index 0000000..95fec77 --- /dev/null +++ b/assets/js/min/main.js @@ -0,0 +1,2 @@ +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");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, .photo","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!"){lychee.setMode("view");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, .photo","contentZoomIn");view.header.mode("album")}},waitTime)})})},parse:function(photo){if(photo&&photo.thumbUrl)photo.thumbUrl=lychee.upload_path_thumb+photo.thumbUrl;else if(!album.json.title)album.json.title="Untitled"},add:function(){var title,params,buttons;buttons=[["Create Album",function(){title=$(".message input.text").val();if(title==="")title="Untitled";if(title.length>0&&title.length<31){modal.close();params="addAlbum&title="+escape(encodeURI(title));lychee.api(params,function(data){if(data!==false)lychee.goto(data);else lychee.error(null,params,data)})}else loadingBar.show("error","Title too short or too long. Please try again!")}],["Cancel",function(){}]];modal.show("New Album","Please enter a title for this album: ",buttons)},"delete":function(albumID){var params,buttons,albumTitle;buttons=[["Delete Album and Photos",function(){params="deleteAlbum&albumID="+albumID+"&delAll=true";lychee.api(params,function(data){if(visible.albums()){albums.json.num--;view.albums.content.delete(albumID)}else lychee.goto("");if(data!==true)lychee.error(null,params,data)})}],["Keep Album",function(){}]];if(albumID==="0"){buttons[0][0]="Clear 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(album.json)albumTitle=album.json.title;else if(albums.json)albumTitle=albums.json.content[albumID].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)}},setTitle:function(albumID){var oldTitle="",newTitle,params,buttons;if(!albumID)return false;if(album.json)oldTitle=album.json.title;else if(albums.json)oldTitle=albums.json.content[albumID].title;buttons=[["Set Title",function(){newTitle=$(".message input.text").val();if(newTitle==="")newTitle="Untitled";if(albumID!==""&&albumID!=null&&albumID&&newTitle.length<31){if(visible.album()){album.json.title=newTitle;view.album.title(oldTitle)}else if(visible.albums()){albums.json.content[albumID].title=newTitle;view.albums.content.title(albumID)}params="setAlbumTitle&albumID="+albumID+"&title="+escape(encodeURI(newTitle));lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}else if(newTitle.length>0)loadingBar.show("error","New title too short or too long. Please try again!")}],["Cancel",function(){}]];modal.show("Set Title","Please enter a new title for this album: ",buttons)},setDescription:function(photoID){var oldDescription=album.json.description,description,params,buttons;buttons=[["Set Description",function(){description=$(".message input.text").val();if(description.length<800){if(visible.album()){album.json.description=description;view.album.description()}params="setAlbumDescription&albumID="+photoID+"&description="+escape(description);lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}else loadingBar.show("error","Description too long. Please try again!")}],["Cancel",function(){}]];modal.show("Set Description","Please enter a description for this album: ",buttons)},setPublic:function(albumID,e){var params;if($(".message input.text").length>0&&$(".message input.text").val().length>0){params="setAlbumPublic&albumID="+albumID+"&password="+hex_md5($(".message input.text").val());album.json.password=true}else{params="setAlbumPublic&albumID="+albumID;album.json.password=false}if(visible.album()){album.json.public=album.json.public==0?1:0;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("Hi! Check this out: "+url);break;default:link="";break}if(link.length>5)location.href=link},getArchive:function(albumID){var link;if(location.href.indexOf("index.html")>0)link=location.href.replace(location.hash,"").replace("index.html","php/api.php?function=getAlbumArchive&albumID="+albumID);else link=location.href.replace(location.hash,"")+"php/api.php?function=getAlbumArchive&albumID="+albumID;if(lychee.publicMode)link+="&password="+password.value;location.href=link}};albums={json:null,load:function(){var startTime,durationTime,waitTime;lychee.animate(".album, .photo","contentZoomOut");lychee.animate(".divider","fadeOut");startTime=(new Date).getTime();lychee.api("getAlbums",function(data){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};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;setTimeout(function(){view.header.mode("albums");view.albums.init();lychee.animate(".album, .photo","contentZoomIn")},waitTime)})},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=lychee.upload_path_thumb+album.thumb0;else album.thumb0="assets/img/no_images.svg";if(album.thumb1)album.thumb1=lychee.upload_path_thumb+album.thumb1;else album.thumb1="assets/img/no_images.svg";if(album.thumb2)album.thumb2=lychee.upload_path_thumb+album.thumb2;else album.thumb2="assets/img/no_images.svg"}}};build={divider:function(title){return"

"+title+"

"},editIcon:function(id){return"
"},album:function(albumJSON){if(!albumJSON)return"";var album="",title=albumJSON.title;if(title.length>18)title=albumJSON.title.substr(0,18)+"...";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&&albumJSON.star==1)album+="";if(!lychee.publicMode&&albumJSON.public==1)album+="";if(!lychee.publicMode&&albumJSON.unsorted==1)album+="";album+="
";return album},photo:function(photoJSON){if(!photoJSON)return"";var photo="",title=photoJSON.title;if(title.length>18)title=photoJSON.title.substr(0,18)+"...";photo+="
";photo+="thumb";photo+="
";photo+="

"+title+"

";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==="picture")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(icon,text){var modal="";modal+="
";modal+="
";modal+="";if(text!==undefined)modal+="

"+text+"

";else modal+="
";modal+="
";modal+="
";return modal},contextMenu:function(items,orientation){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},infoboxPhoto:function(photoJSON,forView){if(!photoJSON)return"";var infobox="",public,editTitleHTML,editDescriptionHTML,infos;infobox+="

About

";infobox+="
";switch(photoJSON.public){case"0":public="Private";break;case"1":public="Public";break;case"2":public="Public (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"],["Name",photoJSON.title+editTitleHTML],["Uploaded",photoJSON.sysdate],["Description",photoJSON.description+editDescriptionHTML],["","Image"],["Size",photoJSON.size],["Format",photoJSON.type],["Resolution",photoJSON.width+" x "+photoJSON.height]];if(photoJSON.takedate+photoJSON.make+photoJSON.model+photoJSON.shutter+photoJSON.aperture+photoJSON.focal+photoJSON.iso!=""){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"],["Visibility",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"":infobox+="";infobox+="

"+infos[index][1]+"

";infobox+="";break;case"Tags":infobox+="
";infobox+="

"+infos[index][0]+"

";infobox+="";infobox+="
"+infos[index][1]+"
";infobox+="";break;default: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,editTitleHTML,editDescriptionHTML,infos;infobox+="

About

";infobox+="
";switch(albumJSON.public){case"0":public="Private";break;case"1":public="Public";break;default:public="-";break}switch(albumJSON.password){case false:password="No";break;case true:password="Yes";break;default:password="-";break}editTitleHTML=forView===true||lychee.publicMode?"":" "+build.editIcon("edit_title_album");editDescriptionHTML=forView===true||lychee.publicMode?"":" "+build.editIcon("edit_description_album");infos=[["","Basics"],["Name",albumJSON.title+editTitleHTML],["Description",albumJSON.description+editDescriptionHTML],["","Album"],["Created",albumJSON.sysdate],["Images",albumJSON.num],["","Share"],["Visibility",public],["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}};contextMenu={fns:null,show:function(items,mouse_x,mouse_y,orientation){contextMenu.close();$("body").css("overflow","hidden").append(build.contextMenu(items,orientation));if(orientation==="left")mouse_x-=$(".contextmenu").outerWidth(true);if(!mouse_x||!mouse_y){mouse_x="10px";mouse_y="10px"}$(".contextmenu").css({top:mouse_y,left:mouse_x})},add:function(e){var mouse_x=e.pageX,mouse_y=e.pageY,items;mouse_y-=$(document).scrollTop();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,items;mouse_y-=$(document).scrollTop();contextMenu.fns=[function(){settings.setLogin()},function(){settings.setSorting()},function(){window.open(lychee.website,"_newtab")},function(){lychee.logout()}];items=[[" Change Login",0],[" Change Sorting",1],[" About Lychee",2],["separator",-1],[" Sign Out",3]];contextMenu.show(items,mouse_x,mouse_y,"right")},album:function(albumID,e){e.preventDefault();var mouse_x=e.pageX,mouse_y=e.pageY,items;if(albumID==="0"||albumID==="f"||albumID==="s")return false;mouse_y-=$(document).scrollTop();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")},photo:function(photoID,e){e.preventDefault();var mouse_x=e.pageX,mouse_y=e.pageY,items;mouse_y-=$(document).scrollTop();contextMenu.fns=[function(){photo.setStar(photoID)},function(){photo.setTitle(photoID)},function(){contextMenu.move(photoID,e,"right")},function(){photo.delete(photoID)}];items=[[" Star",0],["separator",-1],[" Rename",1],[" Move",2],[" Delete",3]];contextMenu.show(items,mouse_x,mouse_y,"right");$(".photo[data-id='"+photoID+"']").addClass("active")},move:function(photoID,e,orientation){var mouse_x=e.pageX,mouse_y=e.pageY,items=[];contextMenu.fns=[];mouse_y-=$(document).scrollTop();if(orientation===undefined)orientation="left";if(!mouse_x||!mouse_y){mouse_x="10px";mouse_y="10px"}if(album.getID()!=="0"){items=[["Unsorted",0,"photo.setAlbum(0, "+photoID+")"],["separator",-1]]}lychee.api("getAlbums",function(data){if(!data.albums){items=[["New Album",0,"album.add()"]]}else{$.each(data.content,function(index){if(this.id!=album.getID())items.push([this.title,0,"photo.setAlbum("+this.id+", "+photoID+")"])})}contextMenu.close();$(".photo[data-id='"+photoID+"']").addClass("active");$("body").css("overflow","hidden").append(build.contextMenu(items,orientation));if(!visible.photo())mouse_x+=$(".contextmenu").width();$(".contextmenu").css({top:mouse_y,left:mouse_x-$(".contextmenu").width()})})},sharePhoto:function(photoID,e){var mouse_x=e.pageX,mouse_y=e.pageY,items;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)}];items=[["",-1],["separator",-1],[" Make Private",0],["separator",-1],[" Twitter",1],[" Facebook",2],[" Mail",3],[" Dropbox",4]];contextMenu.show(items,mouse_x,mouse_y,"left");$(".contextmenu input").focus()},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(){password.set(albumID)},function(){album.share(0)},function(){album.share(1)},function(){album.share(2)},function(){password.remove(albumID)}];items=[["",-1],["separator",-1],[" Make Private",0],[" Set Password",1],["separator",-1],[" Twitter",2],[" Facebook",3],[" Mail",4]];if(album.json.password==true)items[3]=[" Remove Password",5];contextMenu.show(items,mouse_x,mouse_y,"left");$(".contextmenu input").focus()},close:function(){contextMenu.js=null;$(".contextmenu_bg, .contextmenu").remove();$(".photo.active, .album.active").removeClass("active");$("body").css("overflow","scroll")}};$(document).ready(function(){var event_name=mobileBrowser()?"touchend":"click";if(window.webkitNotifications)window.webkitNotifications.requestPermission();if(!mobileBrowser())$(".tools").tipsy({gravity:"n",fade:false,delayIn:0,opacity:1});$("#hostedwith").on(event_name,function(){window.open(lychee.website,"_newtab")});$("#button_signin").on(event_name,lychee.loginDialog);$("#button_settings").on(event_name,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 modal.show("Share Album","All photos inside this album will be public and visible for everyone. Existing public photos will have the same sharing permission as this album. Are your sure you want to share this album? ",[["Share Album",function(){album.setPublic(album.getID(),e)}],["Cancel",function(){}]])});$("#button_download").on(event_name,function(){window.open(photo.getDirectLink(),"_newtab")});$("#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").on("keyup click",function(){search.find($(this).val())});$("#button_back_home").on(event_name,function(){lychee.goto("")});$("#button_back").on(event_name,function(){lychee.goto(album.getID())});lychee.imageview.on(event_name,".arrow_wrapper.previous",function(){if(album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto!=="")lychee.goto(album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)}).on(event_name,".arrow_wrapper.next",function(){if(album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto!=="")lychee.goto(album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)});$("#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())});Mousetrap.bind("u",function(){$("#upload_files").click()}).bind("s",function(){if(visible.photo())$("#button_star").click()}).bind("f",function(){if(visible.photo())$("#button_download").click()}).bind("command+backspace",function(){if(visible.photo()&&!visible.message())photo.delete(photo.getID())}).bind("left",function(){if(visible.photo())$("#imageview a#previous").click()}).bind("right",function(){if(visible.photo())$("#imageview a#next").click()}).bind("i",function(){if(visible.infobox())view.infobox.hide();else if(!visible.albums())view.infobox.show()});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()});$(document).on("keyup","#password",function(){if($(this).val().length>0)$(this).removeClass("error")}).on(event_name,"#title.editable",function(){if(visible.photo())photo.setTitle(photo.getID());else album.setTitle(album.getID())}).on("click",".album",function(){lychee.goto($(this).attr("data-id"))}).on("click",".photo",function(){lychee.goto(album.getID()+"/"+$(this).attr("data-id"))}).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()}).on(event_name,".button_add",function(e){contextMenu.add(e)}).on("change","#upload_files",function(){modal.close();upload.start.local(this.files)}).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(event_name,"#infobox_overlay",view.infobox.hide).on("dragover",function(e){e.preventDefault()},false).on("drop",function(e){e.stopPropagation();e.preventDefault();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});lychee.init()});loadingBar={status:null,show:function(status,errorText){if(status==="error"){loadingBar.status="error";if(!errorText)errorText="Whoops, it looks like something went wrong. Please reload the site and try again!";lychee.loadingBar.removeClass("loading uploading error").addClass(status).html("

Error: "+errorText+"

").show().css("height","40px");if(visible.controls())lychee.header.addClass("error");clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.data("timeout",setTimeout(function(){loadingBar.hide(true)},3e3))}else if(loadingBar.status==null){loadingBar.status="loading";clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.data("timeout",setTimeout(function(){lychee.loadingBar.show().removeClass("loading uploading error").addClass("loading");if(visible.controls())lychee.header.addClass("loading")},1e3))}},hide:function(force_hide){if(loadingBar.status!=="error"&&loadingBar.status!=null||force_hide){loadingBar.status=null;clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.html("").css("height","3px");if(visible.controls())lychee.header.removeClass("error loading");setTimeout(function(){lychee.loadingBar.hide()},300)}}};var lychee={version:"2.0",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",upload_path_thumb:"uploads/thumb/",upload_path_big:"uploads/big/",publicMode:false,viewMode:false,debugMode:false,username:"",checkForUpdates:false,sorting:"",dropbox:false,loadingBar:$("#loading"),header:$("header"),content:$("#content"),imageview:$("#imageview"),infobox:$("#infobox"),init:function(){lychee.api("init",function(data){if(data.loggedIn!==true){lychee.setMode("public")}else{lychee.username=data.config.username;lychee.sorting=data.config.sorting}if(data==="Warning: No configuration!"){lychee.header.hide();lychee.content.hide();$("body").append(build.no_content("cog"));settings.createConfig();return true}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);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)}})},login:function(){var user=$("input#username").val(),password=hex_md5($("input#password").val()),params;params="login&user="+user+"&password="+password;lychee.api(params,function(data){if(data===true){localStorage.setItem("username",user);window.location.reload()}else{$("#password").val("").addClass("error");$(".message .button.active").removeClass("pressed")}})},loginDialog:function(){var local_username;$("body").append(build.signInModal());$("#username").focus();if(localStorage){local_username=localStorage.getItem("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(data){window.location.reload()})},"goto":function(url){if(url==undefined)url="";document.location.hash=url},load:function(){var albumID="",photoID="",hash=document.location.hash.replace("#","").split("/");contextMenu.close();if(hash[0]!==undefined)albumID=hash[0];if(hash[1]!==undefined)photoID=hash[1];if(albumID&&photoID){albums.json=null;photo.json=null;if(lychee.content.html()===""||$("#search").length&&$("#search").val().length!==0){lychee.content.hide();album.load(albumID,true)}photo.load(photoID,albumID)}else if(albumID){albums.json=null;photo.json=null;if(visible.photo())view.photo.hide();if(album.json&&albumID==album.json.id)view.album.title();else album.load(albumID)}else{albums.json=null;album.json=null;photo.json=null;search.code="";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(data!=lychee.version)$("#version span").show()}})},setTitle:function(title,editable){if(title==="Albums")document.title="Lychee";else document.title="Lychee - "+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("n").unbind("u").unbind("s").unbind("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();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",buttons)},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){album.json={password:true};callback("")}else if(passwd==undefined){password.getDialog(albumID,callback)}else{params="checkAlbumAccess&albumID="+albumID+"&password="+hex_md5(passwd);lychee.api(params,function(data){if(data===true){password.value=hex_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)},remove:function(albumID){var params;if(visible.album()){album.json.password=false;view.album.password()}params="setAlbumPassword&albumID="+albumID+"&password=";lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}};photo={json: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()},300)})},parse:function(){if(!photo.json.title)photo.json.title="Untitled";photo.json.url=lychee.upload_path_big+photo.json.url},"delete":function(photoID){var params,buttons,photoTitle;if(!photoID)return false;if(visible.photo())photoTitle=photo.json.title;else photoTitle=album.json.content[photoID].title;if(photoTitle=="")photoTitle="Untitled";buttons=[["Delete Photo",function(){if(album.json.content[photoID].nextPhoto!==""||album.json.content[photoID].previousPhoto!==""){nextPhoto=album.json.content[photoID].nextPhoto;previousPhoto=album.json.content[photoID].previousPhoto;album.json.content[previousPhoto].nextPhoto=nextPhoto;album.json.content[nextPhoto].previousPhoto=previousPhoto}album.json.content[photoID]=null;view.album.content.delete(photoID);if(!visible.albums())lychee.goto(album.getID());params="deletePhoto&photoID="+photoID;lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}],["Keep Photo",function(){}]];modal.show("Delete Photo","Are you sure you want to delete the photo '"+photoTitle+"'?
This action can't be undone!",buttons)},setTitle:function(photoID){var oldTitle="",newTitle,params,buttons;if(!photoID)return false;if(photo.json)oldTitle=photo.json.title;else if(album.json)oldTitle=album.json.content[photoID].title;buttons=[["Set Title",function(){newTitle=$(".message input.text").val();if(photoID!=null&&photoID&&newTitle.length<31){if(visible.photo()){photo.json.title=newTitle===""?"Untitled":newTitle;view.photo.title(oldTitle)}album.json.content[photoID].title=newTitle;view.album.content.title(photoID);params="setPhotoTitle&photoID="+photoID+"&title="+escape(encodeURI(newTitle));lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}else if(newTitle.length>0)loadingBar.show("error","New title to short or too long. Please try another one!")}],["Cancel",function(){}]];modal.show("Set Title","Please enter a new title for this photo: ",buttons)},setAlbum:function(albumID,photoID){var params;if(albumID>=0){if(visible.photo)lychee.goto(album.getID());album.json.content[photoID]=null;view.album.content.delete(photoID);params="setAlbum&photoID="+photoID+"&albumID="+albumID;lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}},setStar:function(photoID){var params;if(visible.photo()){photo.json.star=photo.json.star==0?1:0;view.photo.star()}album.json.content[photoID].star=album.json.content[photoID].star==0?1:0;view.album.content.star(photoID);params="setPhotoStar&photoID="+photoID;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);params="setPhotoPublic&photoID="+photoID+"&url="+photo.getViewLink(photoID);lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})},setDescription:function(photoID){var oldDescription=photo.json.description,description,params,buttons;buttons=[["Set Description",function(){description=$(".message input.text").val();if(description.length<800){if(visible.photo()){photo.json.description=description;view.photo.description()}params="setPhotoDescription&photoID="+photoID+"&description="+escape(description);lychee.api(params,function(data){if(data!==true)lychee.error(null,params,data)})}else loadingBar.show("error","Description too long. Please try again!")}],["Cancel",function(){}]];modal.show("Set Description","Please enter a description for this photo: ",buttons)},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},getDirectLink:function(){return $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/gi,"")},getViewLink:function(photoID){if(location.href.indexOf("index.html")>0)return location.href.replace("index.html"+location.hash,"view.php?p="+photoID);else return location.href.replace(location.hash,"view.php?p="+photoID)}};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(){album.parse(this);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!==hex_md5(code)){$(".no_content").remove();lychee.animate(".album, .photo","contentZoomOut");lychee.animate(".divider","fadeOut");search.code=hex_md5(code);setTimeout(function(){if(code==="error")$("body").append(build.no_content("search"));else{lychee.content.html(code);lychee.animate(".album, .photo","contentZoomIn")}},300)}})}else search.reset()},250))},reset:function(){$("#search").val("");$(".no_content").remove();if(search.code!==""){search.code="";lychee.animate(".divider","fadeOut");albums.load()}}};var settings={createConfig:function(){var dbName,dbUser,dbPassword,dbHost,buttons;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();if(dbHost.length<1)dbHost="localhost";if(dbName.length<1)dbName="lychee";params="createConfig&dbName="+escape(dbName)+"&dbUser="+escape(dbUser)+"&dbPassword="+escape(dbPassword)+"&dbHost="+escape(dbHost);lychee.api(params,function(data){if(data!==true){setTimeout(function(){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}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 'php/'. Please set the read, write and execute rights for others in 'php/' and 'uploads/'. Take a look the readme for more information.",buttons,null,false);return false}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{lychee.api("update",function(data){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,-215,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="+hex_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="+hex_md5(old_password)+"&username="+escape(username)+"&password="+hex_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;buttons=[["Change Sorting",function(){sorting[0]=$("select#settings_type").val();sorting[1]=$("select#settings_order").val();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 ","").replace(" ",";").split(";");$("select#settings_type").val(sorting[0]);$("select#settings_order").val(sorting[1])}}};upload={show:function(icon,text){if(icon===undefined)icon="upload";upload.close(true);$("body").append(build.uploadModal(icon,text))},setIcon:function(icon){$(".upload_message a").remove();$(".upload_message").prepend("")},setProgress:function(progress){$(".progressbar div").css("width",progress+"%")},setText:function(text){$(".progressbar").remove();$(".upload_message").append("

"+text+"

")},start:{local:function(files){var pre_progress=0,formData=new FormData,xhr=new XMLHttpRequest,albumID=album.getID(),popup,progress;if(files.length<=0)return false;if(albumID===false)albumID=0;formData.append("function","upload");formData.append("albumID",albumID);for(var i=0;ipre_progress){upload.setProgress(progress);pre_progress=progress}if(progress>=100){upload.setIcon("cog");upload.setText("Processing photos")}}};$("#upload_files").val("");xhr.send(formData)},url:function(){var albumID=album.getID(),params,extension,buttons;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"){loadingBar.show("error","The file format of this link is not supported.");return false}modal.close();upload.show("cog","Importing from URL");params="importUrl&url="+escape(encodeURI(link))+"&albumID="+albumID;lychee.api(params,function(data){upload.close();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;if(albumID===false)albumID=0;buttons=[["Import",function(){modal.close();upload.show("cog","Importing photos");params="importServer&albumID="+albumID;lychee.api(params,function(data){upload.close();if(album.getID()===false)lychee.goto("0");else album.load(albumID);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 which are located in 'uploads/import/' of your Lychee installation.",buttons)},dropbox:function(){var albumID=album.getID(),params;if(albumID===false)albumID=0;lychee.loadDropbox(function(){Dropbox.choose({linkType:"direct",multiselect:true,success:function(files){if(files.length>1){for(var i=0;i0){$("#imageview #image").css({marginTop:-1*($("#imageview #image").height()/2)+20})}else{$("#imageview #image").css({top:60,right:30,bottom:30,left:30})}}},hide:function(){if(visible.photo()&&!visible.infobox()){clearTimeout($(window).data("timeout"));$(window).data("timeout",setTimeout(function(){lychee.imageview.addClass("full");lychee.loadingBar.css("opacity",0);lychee.header.addClass("hidden");if($("#imageview #image.small").length>0){$("#imageview #image").css({marginTop:-1*($("#imageview #image").height()/2)})}else{$("#imageview #image").css({top:0,right:0,bottom:0,left:0})}},500))}},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();if(albumID==="s"||albumID==="f"){$("#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:{init:function(){var smartData="",albumsData="";albums.parse(albums.json.unsortedAlbum);albums.parse(albums.json.publicAlbum);albums.parse(albums.json.starredAlbum);if(!lychee.publicMode)smartData=build.divider("Smart Albums")+build.album(albums.json.unsortedAlbum)+build.album(albums.json.starredAlbum)+build.album(albums.json.publicAlbum);if(albums.json.content){if(!lychee.publicMode)albumsData=build.divider("Albums");$.each(albums.json.content,function(){albums.parse(this);albumsData+=build.album(this)})}if(smartData===""&&albumsData==="")$("body").append(build.no_content("picture"));else lychee.content.html(smartData+albumsData);$("img").retina()},title:function(albumID){var prefix="",title=albums.json.content[albumID].title;if(albums.json.content[albumID].password)prefix=" ";if(title.length>18)title=title.substr(0,18)+"...";$(".album[data-id='"+albumID+"'] .overlay h1").html(prefix+title)},"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(oldTitle){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"0":lychee.setTitle("Unsorted",false);break;default:if(album.json.init)$("#infobox .attr_name").html(album.json.title+" "+build.editIcon("edit_title_album"));lychee.setTitle(album.json.title,true);break}}},description:function(){$("#infobox .attr_description").html(album.json.description+" "+build.editIcon("edit_description_album"))},content:{init:function(){var photosData="";$.each(album.json.content,function(){album.parse(this);photosData+=build.photo(this)});lychee.content.html(photosData);$("img").retina()},title:function(photoID){var title=album.json.content[photoID].title;if(title.length>18)title=title.substr(0,18)+"...";$(".photo[data-id='"+photoID+"'] .overlay h1").html(title)},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();if(!visible.albums()){album.json.num--;view.album.num();view.album.title()}})}},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(){lychee.content.addClass("view");view.header.mode("photo");$("body").css("overflow","hidden");$(document).bind("mouseenter",view.header.show).bind("mouseleave",view.header.hide);lychee.animate(lychee.imageview,"fadeIn")},hide:function(){if(!visible.controls())view.header.show();if(visible.infobox)view.infobox.hide();lychee.content.removeClass("view");view.header.mode("album");$("body").css("overflow","scroll");$(document).unbind("mouseenter").unbind("mouseleave");lychee.animate(lychee.imageview,"fadeOut");setTimeout(function(){lychee.imageview.hide();view.album.infobox()},300)},title:function(oldTitle){if(photo.json.init)$("#infobox .attr_name").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){$("#button_star a").addClass("icon-star");$("#button_star").attr("title","Unstar Photo")}else{$("#button_star a").addClass("icon-star-empty");$("#button_star").attr("title","Star Photo")}},"public":function(){if(photo.json.public==1||photo.json.public==2){$("#button_share a").addClass("active");$("#button_share").attr("title","Share Photo");if(photo.json.init)$("#infobox .attr_visibility").html("Public")}else{$("#button_share a").removeClass("active");$("#button_share").attr("title","Make Public");if(photo.json.init)$("#infobox .attr_visibility").html("Private")}},photo:function(){lychee.imageview.html(build.imageview(photo.json,photo.isSmall(),visible.controls()));if(album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto===""||lychee.viewMode)$("a#next").hide();if(album.json&&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()}}};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},infobox:function(){if($("#infobox.active").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}}; \ No newline at end of file diff --git a/js/modules/album.js b/assets/js/modules/album.js similarity index 52% rename from js/modules/album.js rename to assets/js/modules/album.js index 85fd938..142b3b9 100644 --- a/js/modules/album.js +++ b/assets/js/modules/album.js @@ -1,11 +1,8 @@ /** - * @name album.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Album Module - * Takes care of every action an album can handle and execute. + * @name Album Module + * @description Takes care of every action an album can handle and execute. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ album = { @@ -33,8 +30,7 @@ album = { var startTime, params, durationTime, - waitTime, - photosData = ""; + waitTime; password.get(albumID, function() { @@ -47,14 +43,14 @@ album = { startTime = new Date().getTime(); params = "getAlbum&albumID=" + albumID + "&password=" + password.value; - lychee.api(params, "json", function(data) { + lychee.api(params, function(data) { - if (data=="HTTP/1.1 403 Album private!") { + if (data==="Warning: Album private!") { lychee.setMode("view"); return false; } - if (data=="HTTP/1.1 403 Wrong password!") { + if (data==="Warning: Wrong password!") { album.load(albumID, refresh); return false; } @@ -66,14 +62,14 @@ album = { if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0; setTimeout(function() { - + view.album.init(); - + if (!refresh) { lychee.animate(".album, .photo", "contentZoomIn"); view.header.mode("album"); } - + }, waitTime); }); @@ -91,22 +87,35 @@ album = { add: function() { - var title = prompt("Please enter a title for this album:", "Untitled"), - params; + var title, + params, + buttons; - if (title.length>0&&title.length<31) { + buttons = [ + ["Create Album", function() { - modal.close(); + title = $(".message input.text").val(); - params = "addAlbum&title=" + escape(encodeURI(title)); - lychee.api(params, "text", function(data) { + if (title==="") title = "Untitled"; - if (data) lychee.goto("a" + data); - else loadingBar.show("error"); + if (title.length>0&&title.length<31) { - }); + modal.close(); - } else if (title.length>0) loadingBar.show("error", "Error", "Title to short or too long. Please try another one!"); + params = "addAlbum&title=" + escape(encodeURI(title)); + lychee.api(params, function(data) { + + if (data!==false) lychee.goto(data); + else lychee.error(null, params, data); + + }); + + } else loadingBar.show("error", "Title too short or too long. Please try again!"); + + }], + ["Cancel", function() {}] + ]; + modal.show("New Album", "Please enter a title for this album: ", buttons); }, @@ -120,12 +129,14 @@ album = { ["Delete Album and Photos", function() { params = "deleteAlbum&albumID=" + albumID + "&delAll=true"; - lychee.api(params, "text", function(data) { + lychee.api(params, function(data) { - if (visible.albums()) view.albums.content.delete(albumID); - else lychee.goto(""); + if (visible.albums()) { + albums.json.num--; + view.albums.content.delete(albumID); + } else lychee.goto(""); - if (!data) loadingBar.show("error"); + if (data!==true) lychee.error(null, params, data); }); @@ -133,7 +144,7 @@ album = { ["Keep Album", function() {}] ]; - if (albumID==0) { + if (albumID==="0") { buttons[0][0] = "Clear Unsorted"; modal.show("Clear Unsorted", "Are you sure you want to delete all photos from 'Unsorted'?
This action can't be undone!", buttons) @@ -152,66 +163,113 @@ album = { var oldTitle = "", newTitle, - params; + params, + buttons; - if (!albumID) albumID = album.getID(); + if (!albumID) return false; if (album.json) oldTitle = album.json.title; else if (albums.json) oldTitle = albums.json.content[albumID].title; - newTitle = prompt("Please enter a new title for this album:", oldTitle); + buttons = [ + ["Set Title", function() { - if (albumID!=""&&albumID!=null&&albumID&&newTitle.length>0&&newTitle.length<31) { + newTitle = $(".message input.text").val(); - if (visible.album()) { + if (newTitle==="") newTitle = "Untitled"; - album.json.title = newTitle; - view.album.title(); + if (albumID!==""&&albumID!=null&&albumID&&newTitle.length<31) { - } else if (visible.albums()) { + if (visible.album()) { - albums.json.content[albumID].title = newTitle; - view.albums.content.title(albumID); + album.json.title = newTitle; + view.album.title(oldTitle); - } + } else if (visible.albums()) { - params = "setAlbumTitle&albumID=" + albumID + "&title=" + escape(encodeURI(newTitle)); - lychee.api(params, "text", function(data) { + albums.json.content[albumID].title = newTitle; + view.albums.content.title(albumID); - if (!data) loadingBar.show("error"); + } - }); + params = "setAlbumTitle&albumID=" + albumID + "&title=" + escape(encodeURI(newTitle)); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + } else if (newTitle.length>0) loadingBar.show("error", "New title too short or too long. Please try again!"); + + }], + ["Cancel", function() {}] + ]; + modal.show("Set Title", "Please enter a new title for this album: ", buttons); + + }, + + setDescription: function(photoID) { + + var oldDescription = album.json.description, + description, + params, + buttons; + + buttons = [ + ["Set Description", function() { + + description = $(".message input.text").val(); + + if (description.length<800) { + + if (visible.album()) { + album.json.description = description; + view.album.description(); + } + + params = "setAlbumDescription&albumID=" + photoID + "&description=" + escape(description); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); - } else if (newTitle.length>0) loadingBar.show("error", "Error", "New title to short or too long. Please try another one!"); + }); + + } else loadingBar.show("error", "Description too long. Please try again!"); + + }], + ["Cancel", function() {}] + ]; + modal.show("Set Description", "Please enter a description for this album: ", buttons); }, setPublic: function(albumID, e) { var params; - - if ($("input.password").length>0&&$("input.password").val().length>0) { - - params = "setAlbumPublic&albumID=" + albumID + "&password=" + hex_md5($("input.password").val()); + + if ($(".message input.text").length>0&&$(".message input.text").val().length>0) { + + params = "setAlbumPublic&albumID=" + albumID + "&password=" + hex_md5($(".message input.text").val()); album.json.password = true; - + } else { - + params = "setAlbumPublic&albumID=" + albumID; album.json.password = false; - + } if (visible.album()) { album.json.public = (album.json.public==0) ? 1 : 0; view.album.public(); + view.album.password(); if (album.json.public==1) contextMenu.shareAlbum(albumID, e); } - - lychee.api(params, "text", function(data) { - if (!data) loadingBar.show("error"); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); }); @@ -247,6 +305,9 @@ album = { if (location.href.indexOf("index.html")>0) link = location.href.replace(location.hash, "").replace("index.html", "php/api.php?function=getAlbumArchive&albumID=" + albumID); else link = location.href.replace(location.hash, "") + "php/api.php?function=getAlbumArchive&albumID=" + albumID; + + if (lychee.publicMode) link += "&password=" + password.value; + location.href = link; } diff --git a/js/modules/albums.js b/assets/js/modules/albums.js similarity index 71% rename from js/modules/albums.js rename to assets/js/modules/albums.js index 73179db..11f1652 100644 --- a/js/modules/albums.js +++ b/assets/js/modules/albums.js @@ -1,11 +1,8 @@ /** - * @name albums.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Albums Module - * Takes care of every action albums can handle and execute. + * @name Albums Module + * @description Takes care of every action albums can handle and execute. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ albums = { @@ -16,18 +13,14 @@ albums = { var startTime, durationTime, - unsortedAlbum, - starredAlbum, - publicAlbum, - smartData = "", - albumsData = ""; + waitTime; lychee.animate(".album, .photo", "contentZoomOut"); lychee.animate(".divider", "fadeOut"); startTime = new Date().getTime(); - lychee.api("getAlbums", "json", function(data) { + lychee.api("getAlbums", function(data) { /* Smart Albums */ data.unsortedAlbum = { @@ -81,13 +74,13 @@ albums = { parse: function(album) { if (album.password&&lychee.publicMode) { - album.thumb0 = "img/password.png"; - album.thumb1 = "img/password.png"; - album.thumb2 = "img/password.png"; + album.thumb0 = "assets/img/password.svg"; + album.thumb1 = "assets/img/password.svg"; + album.thumb2 = "assets/img/password.svg"; } else { - if (album.thumb0) album.thumb0 = lychee.upload_path_thumb + album.thumb0; else album.thumb0 = "img/no_images.png"; - if (album.thumb1) album.thumb1 = lychee.upload_path_thumb + album.thumb1; else album.thumb1 = "img/no_images.png"; - if (album.thumb2) album.thumb2 = lychee.upload_path_thumb + album.thumb2; else album.thumb2 = "img/no_images.png"; + if (album.thumb0) album.thumb0 = lychee.upload_path_thumb + album.thumb0; else album.thumb0 = "assets/img/no_images.svg"; + if (album.thumb1) album.thumb1 = lychee.upload_path_thumb + album.thumb1; else album.thumb1 = "assets/img/no_images.svg"; + if (album.thumb2) album.thumb2 = lychee.upload_path_thumb + album.thumb2; else album.thumb2 = "assets/img/no_images.svg"; } } diff --git a/assets/js/modules/build.js b/assets/js/modules/build.js new file mode 100755 index 0000000..860765a --- /dev/null +++ b/assets/js/modules/build.js @@ -0,0 +1,410 @@ +/** + * @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 "
"; + + }, + + album: function(albumJSON) { + + if (!albumJSON) return ""; + + var album = "", + title = albumJSON.title; + + if (title.length>18) title = albumJSON.title.substr(0, 18) + "..."; + + 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&&albumJSON.star==1) album += ""; + if(!lychee.publicMode&&albumJSON.public==1) album += ""; + if(!lychee.publicMode&&albumJSON.unsorted==1) album += ""; + + album += "
"; + + return album; + + }, + + photo: function(photoJSON) { + + if (!photoJSON) return ""; + + var photo = "", + title = photoJSON.title; + + if (title.length>18) title = photoJSON.title.substr(0, 18) + "..."; + + photo += "
"; + photo += "thumb"; + photo += "
"; + photo += "

" + title + "

"; + 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==="picture") 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(icon, text) { + + var modal = ""; + + modal += "
"; + modal += "
"; + modal += ""; + + if (text!==undefined) modal += "

" + text + "

"; + else modal += "
"; + + modal += "
"; + modal += "
"; + + return modal; + + }, + + contextMenu: function(items, orientation) { + + 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; + + }, + + infoboxPhoto: function(photoJSON, forView) { + + if (!photoJSON) return ""; + + var infobox = "", + public, + editTitleHTML, + editDescriptionHTML, + infos; + + infobox += "

About

"; + infobox += "
"; + + switch (photoJSON.public) { + case "0": + public = "Private"; + break; + case "1": + public = "Public"; + break; + case "2": + public = "Public (Album)"; + break; + default: + public = "-"; + break; + } + + editTitleHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_title"); + editDescriptionHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_description"); + + //["Tags", "AbstractColorsPhotoshopSomethingLycheeTags"] + infos = [ + ["", "Basics"], + ["Name", photoJSON.title + editTitleHTML], + ["Uploaded", photoJSON.sysdate], + ["Description", photoJSON.description + editDescriptionHTML], + ["", "Image"], + ["Size", photoJSON.size], + ["Format", photoJSON.type], + ["Resolution", photoJSON.width + " x " + photoJSON.height] + ]; + + if ((photoJSON.takedate+photoJSON.make+photoJSON.model+photoJSON.shutter+photoJSON.aperture+photoJSON.focal+photoJSON.iso)!="") { + + 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"], + ["Visibility", 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 + infobox += "
"; + infobox += "

" + infos[index][0] + "

"; + infobox += ""; + infobox += "
" + infos[index][1] + "
"; + infobox += ""; + 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, + editTitleHTML, + editDescriptionHTML, + infos; + + infobox += "

About

"; + infobox += "
"; + + switch (albumJSON.public) { + case "0": + public = "Private"; + break; + case "1": + public = "Public"; + break; + default: + public = "-"; + break; + } + + switch (albumJSON.password) { + case false: + password = "No"; + break; + case true: + password = "Yes"; + break; + default: + password = "-"; + break; + } + + editTitleHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_title_album"); + editDescriptionHTML = (forView===true||lychee.publicMode) ? "" : " " + build.editIcon("edit_description_album"); + + infos = [ + ["", "Basics"], + ["Name", albumJSON.title + editTitleHTML], + ["Description", albumJSON.description + editDescriptionHTML], + ["", "Album"], + ["Created", albumJSON.sysdate], + ["Images", albumJSON.num], + ["", "Share"], + ["Visibility", public], + ["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/js/modules/contextMenu.js b/assets/js/modules/contextMenu.js similarity index 50% rename from js/modules/contextMenu.js rename to assets/js/modules/contextMenu.js index e2f2c96..8f88c89 100644 --- a/js/modules/contextMenu.js +++ b/assets/js/modules/contextMenu.js @@ -1,26 +1,101 @@ /** - * @name contextMenu.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * ContextMenu Module - * This module is used for the context menu. + * @name ContextMenu Module + * @description This module is used for the context menu. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ contextMenu = { fns: null, - album: function(e) { + show: function(items, mouse_x, mouse_y, orientation) { + + contextMenu.close(); + + $("body") + .css("overflow", "hidden") + .append(build.contextMenu(items, orientation)); + + if (orientation==="left") mouse_x -= $(".contextmenu").outerWidth(true); + + if (!mouse_x||!mouse_y) { + mouse_x = "10px"; + mouse_y = "10px"; + } + + $(".contextmenu").css({ + "top": mouse_y, + "left": mouse_x + }); + + }, + + add: function(e) { + + var mouse_x = e.pageX, + mouse_y = e.pageY, + items; + + mouse_y -= $(document).scrollTop(); + + 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, + items; + + mouse_y -= $(document).scrollTop(); + + contextMenu.fns = [ + function() { settings.setLogin() }, + function() { settings.setSorting() }, + function() { window.open(lychee.website,"_newtab"); }, + function() { lychee.logout() } + ]; + + items = [ + [" Change Login", 0], + [" Change Sorting", 1], + [" About Lychee", 2], + ["separator", -1], + [" Sign Out", 3] + ]; + + contextMenu.show(items, mouse_x, mouse_y, "right"); + + }, + + album: function(albumID, e) { e.preventDefault(); var mouse_x = e.pageX, mouse_y = e.pageY, - albumID = album.getID(), items; - if (albumID=="0"||albumID=="f"||albumID=="s") return false; + if (albumID==="0"||albumID==="f"||albumID==="s") return false; mouse_y -= $(document).scrollTop(); @@ -34,24 +109,17 @@ contextMenu = { [" Delete", 1] ]; - contextMenu.close(); + contextMenu.show(items, mouse_x, mouse_y, "right"); + $(".album[data-id='" + albumID + "']").addClass("active"); - $("body") - .css("overflow", "hidden") - .append(build.contextMenu(items)); - $(".contextmenu").css({ - "top": mouse_y, - "left": mouse_x - }); }, - photo: function(e) { + photo: function(photoID, e) { e.preventDefault(); var mouse_x = e.pageX, mouse_y = e.pageY, - photoID = photo.getID(), items; mouse_y -= $(document).scrollTop(); @@ -59,7 +127,7 @@ contextMenu = { contextMenu.fns = [ function() { photo.setStar(photoID) }, function() { photo.setTitle(photoID) }, - function() { contextMenu.move(photoID, e) }, + function() { contextMenu.move(photoID, e, "right") }, function() { photo.delete(photoID) } ]; @@ -71,41 +139,36 @@ contextMenu = { [" Delete", 3] ]; - contextMenu.close(); + contextMenu.show(items, mouse_x, mouse_y, "right"); + $(".photo[data-id='" + photoID + "']").addClass("active"); - $("body") - .css("overflow", "hidden") - .append(build.contextMenu(items)); - $(".contextmenu").css({ - "top": mouse_y, - "left": mouse_x - }); }, - move: function(photoID, e) { + move: function(photoID, e, orientation) { var mouse_x = e.pageX, mouse_y = e.pageY, - items = [], - albumID; + items = []; contextMenu.fns = []; mouse_y -= $(document).scrollTop(); + if (orientation===undefined) orientation = "left"; + if (!mouse_x||!mouse_y) { mouse_x = "10px"; mouse_y = "10px"; } - if (album.getID()!=0) { + if (album.getID()!=="0") { items = [ ["Unsorted", 0, "photo.setAlbum(0, " + photoID + ")"], ["separator", -1] ]; } - lychee.api("getAlbums", "json", function(data) { + lychee.api("getAlbums", function(data) { if (!data.albums) { items = [["New Album", 0, "album.add()"]]; @@ -119,7 +182,7 @@ contextMenu = { $(".photo[data-id='" + photoID + "']").addClass("active"); $("body") .css("overflow", "hidden") - .append(build.contextMenu(items)); + .append(build.contextMenu(items, orientation)); if (!visible.photo()) mouse_x += $(".contextmenu").width(); $(".contextmenu").css({ "top": mouse_y, @@ -138,11 +201,6 @@ contextMenu = { mouse_y -= $(document).scrollTop(); - if (!mouse_x||!mouse_y) { - mouse_x = "10px"; - mouse_y = "10px"; - } - contextMenu.fns = [ function() { photo.setPublic(photoID) }, function() { photo.share(photoID, 0) }, @@ -151,40 +209,18 @@ contextMenu = { function() { photo.share(photoID, 3) } ]; - if (document.location.hostname!="localhost") { - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - ["separator", -1], - [" Twitter", 1], - [" Facebook", 2], - [" Mail", 3], - [" Dropbox", 4] - ]; - - } else { - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - ["separator", -1], - [" Mail", 3] - ]; - - } - - contextMenu.close(); - $("body") - .css("overflow", "hidden") - .append(build.contextMenu(items)); - $(".contextmenu").css({ - "top": mouse_y, - "left": mouse_x+20-$(".contextmenu").width() - }); + items = [ + ["", -1], + ["separator", -1], + [" Make Private", 0], + ["separator", -1], + [" Twitter", 1], + [" Facebook", 2], + [" Mail", 3], + [" Dropbox", 4] + ]; + contextMenu.show(items, mouse_x, mouse_y, "left"); $(".contextmenu input").focus(); }, @@ -197,11 +233,6 @@ contextMenu = { mouse_y -= $(document).scrollTop(); - if (!mouse_x||!mouse_y) { - mouse_x = "10px"; - mouse_y = "10px"; - } - contextMenu.fns = [ function() { album.setPublic(albumID) }, function() { password.set(albumID) }, @@ -211,43 +242,20 @@ contextMenu = { function() { password.remove(albumID) } ]; - if (document.location.hostname!="localhost") { - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - [" Set Password", 1], - ["separator", -1], - [" Twitter", 2], - [" Facebook", 3], - [" Mail", 4], - ]; - - } else { - - items = [ - ["", -1], - ["separator", -1], - [" Make Private", 0], - [" Set Password", 1], - ["separator", -1], - [" Mail", 4], - ]; - - } + items = [ + ["", -1], + ["separator", -1], + [" Make Private", 0], + [" Set Password", 1], + ["separator", -1], + [" Twitter", 2], + [" Facebook", 3], + [" Mail", 4], + ]; if (album.json.password==true) items[3] = [" Remove Password", 5]; - contextMenu.close(); - $("body") - .css("overflow", "hidden") - .append(build.contextMenu(items)); - $(".contextmenu").css({ - "top": mouse_y, - "left": mouse_x+20-$(".contextmenu").width() - }); - + contextMenu.show(items, mouse_x, mouse_y, "left"); $(".contextmenu input").focus(); }, diff --git a/assets/js/modules/init.js b/assets/js/modules/init.js new file mode 100755 index 0000000..9a11ef3 --- /dev/null +++ b/assets/js/modules/init.js @@ -0,0 +1,138 @@ +/** + * @name Init Module + * @author Tobias Reich + * @copyright 2014 by Tobias Reich + */ + +$(document).ready(function(){ + + /* Event Name */ + var event_name = (mobileBrowser()) ? "touchend" : "click"; + + /* Notifications */ + if (window.webkitNotifications) window.webkitNotifications.requestPermission(); + + /* Tooltips */ + if (!mobileBrowser()) $(".tools").tipsy({gravity: 'n', fade: false, delayIn: 0, opacity: 1}); + + /* Header */ + $("#hostedwith").on(event_name, function() { window.open(lychee.website,"_newtab") }); + $("#button_signin").on(event_name, lychee.loginDialog); + $("#button_settings").on(event_name, 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 modal.show("Share Album", "All photos inside this album will be public and visible for everyone. Existing public photos will have the same sharing permission as this album. Are your sure you want to share this album? ", [["Share Album", function() { album.setPublic(album.getID(), e) }], ["Cancel", function() {}]]); + }); + $("#button_download").on(event_name, function() { window.open(photo.getDirectLink(),"_newtab") }); + $("#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()) }); + + /* 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", function() { + if (album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto!=="") lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].previousPhoto) + }) + .on(event_name, ".arrow_wrapper.next", function() { + if (album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto!=="") lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].nextPhoto) + }); + + /* 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()) }); + + /* Keyboard */ + Mousetrap + .bind('u', function() { $("#upload_files").click() }) + .bind('s', function() { if (visible.photo()) $("#button_star").click() }) + .bind('f', function() { if (visible.photo()) $("#button_download").click() }) + .bind('command+backspace', function() { if (visible.photo()&&!visible.message()) photo.delete(photo.getID()) }) + .bind('left', function() { if (visible.photo()) $("#imageview a#previous").click() }) + .bind('right', function() { if (visible.photo()) $("#imageview a#next").click() }) + .bind('i', function() { + if (visible.infobox()) view.infobox.hide(); + else if (!visible.albums()) view.infobox.show(); + }); + + 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(); + }); + + /* 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) }) + + /* Upload */ + .on("change", "#upload_files", function() { modal.close(); upload.start.local(this.files) }) + + /* 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) + + /* Infobox */ + .on(event_name, "#infobox_overlay", view.infobox.hide) + + /* Upload */ + .on("dragover", function(e) { e.preventDefault(); }, false) + .on("drop", function(e) { + e.stopPropagation(); + e.preventDefault(); + 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/js/modules/loadingBar.js b/assets/js/modules/loadingBar.js similarity index 59% rename from js/modules/loadingBar.js rename to assets/js/modules/loadingBar.js index 60c5c80..bfba305 100755 --- a/js/modules/loadingBar.js +++ b/assets/js/modules/loadingBar.js @@ -1,33 +1,29 @@ /** - * @name loadingBar.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * LoadingBar Module - * This module is used to show and hide the loading bar. + * @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, errorTitle, errorText) { + show: function(status, errorText) { - if (status=="error") { + if (status==="error") { loadingBar.status = "error"; - if (!errorTitle) errorTitle = "Error"; if (!errorText) errorText = "Whoops, it looks like something went wrong. Please reload the site and try again!" lychee.loadingBar .removeClass("loading uploading error") .addClass(status) - .html("

" + errorTitle + ": " + errorText + "

") + .html("

Error: " + errorText + "

") .show() .css("height", "40px"); - if (visible.controls()) lychee.header.css("margin-Top", "40px"); + if (visible.controls()) lychee.header.addClass("error"); clearTimeout(lychee.loadingBar.data("timeout")); lychee.loadingBar.data("timeout", setTimeout(function() { loadingBar.hide(true) }, 3000)); @@ -42,7 +38,7 @@ loadingBar = { .show() .removeClass("loading uploading error") .addClass("loading"); - if (visible.controls()) lychee.header.css("margin-Top", "3px"); + if (visible.controls()) lychee.header.addClass("loading"); }, 1000)); } @@ -51,12 +47,12 @@ loadingBar = { hide: function(force_hide) { - if ((loadingBar.status!="error"&&loadingBar.status!=null)||force_hide) { + if ((loadingBar.status!=="error"&&loadingBar.status!=null)||force_hide) { loadingBar.status = null; clearTimeout(lychee.loadingBar.data("timeout")); lychee.loadingBar.html("").css("height", "3px"); - if (visible.controls()) lychee.header.css("marginTop", "0px"); + if (visible.controls()) lychee.header.removeClass("error loading"); setTimeout(function() { lychee.loadingBar.hide() }, 300); } diff --git a/js/modules/lychee.js b/assets/js/modules/lychee.js similarity index 55% rename from js/modules/lychee.js rename to assets/js/modules/lychee.js index caf3913..96bc064 100644 --- a/js/modules/lychee.js +++ b/assets/js/modules/lychee.js @@ -1,52 +1,72 @@ /** - * @name lychee.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Lychee Module - * This module provides the basic functions of Lychee. + * @name Lychee Module + * @description This module provides the basic functions of Lychee. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ var lychee = { - init: function() { + version: "2.0", - this.version = "1.3.2"; - this.api_path = "php/api.php"; - this.update_path = "http://lychee.electerious.com/version/index.php"; - this.updateURL = "https://github.com/electerious/Lychee"; + 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", - this.upload_path_thumb = "uploads/thumb/"; - this.upload_path_big = "uploads/big/"; + upload_path_thumb: "uploads/thumb/", + upload_path_big: "uploads/big/", - this.publicMode = false; - this.viewMode = false; + publicMode: false, + viewMode: false, + debugMode: false, - this.checkForUpdates = false; + username: "", + checkForUpdates: false, + sorting: "", - this.dropbox = false; + dropbox: false, - this.loadingBar = $("#loading"); - this.header = $("header"); - this.content = $("#content"); - this.imageview = $("#imageview"); - this.infobox = $("#infobox"); + loadingBar: $("#loading"), + header: $("header"), + content: $("#content"), + imageview: $("#imageview"), + infobox: $("#infobox"), - }, + init: function() { + + lychee.api("init", function(data) { + + if (data.loggedIn!==true) { + lychee.setMode("public"); + } else { + lychee.username = data.config.username; + lychee.sorting = data.config.sorting; + } + + // No configuration + if (data==="Warning: No configuration!") { + lychee.header.hide(); + lychee.content.hide(); + $("body").append(build.no_content("cog")); + settings.createConfig(); + return true; + } - run: function() { + // No login + if (data.config.login===false) { + settings.createLogin(); + } - lychee.api("init", "json", function(data) { lychee.checkForUpdates = data.config.checkForUpdates; - if (!data.loggedIn) lychee.setMode("public"); $(window).bind("popstate", lychee.load); lychee.load(); + }); }, - api: function(params, type, callback, loading) { + api: function(params, callback, loading) { if (loading==undefined) loadingBar.show(); @@ -54,13 +74,31 @@ var lychee = { type: "POST", url: lychee.api_path, data: "function=" + params, - dataType: type, - success: - function(data) { - setTimeout(function() { loadingBar.hide() }, 100); - callback(data); - }, - error: lychee.error + 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); + 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); + + } }); }, @@ -72,8 +110,8 @@ var lychee = { params; params = "login&user=" + user + "&password=" + password; - lychee.api(params, "text", function(data) { - if (data) { + lychee.api(params, function(data) { + if (data===true) { localStorage.setItem("username", user); window.location.reload(); } else { @@ -86,6 +124,8 @@ var lychee = { loginDialog: function() { + var local_username; + $("body").append(build.signInModal()); $("#username").focus(); if (localStorage) { @@ -95,13 +135,13 @@ var lychee = { $("#password").focus(); } } - if (lychee.checkForUpdates) lychee.getUpdate(); + if (lychee.checkForUpdates==="1") lychee.getUpdate(); }, logout: function() { - lychee.api("logout", "text", function(data) { + lychee.api("logout", function(data) { window.location.reload(); }); @@ -118,12 +158,12 @@ var lychee = { var albumID = "", photoID = "", - hash = document.location.hash.replace("#", ""); + hash = document.location.hash.replace("#", "").split("/"); contextMenu.close(); - if (hash.indexOf("a")!=-1) albumID = hash.split("p")[0].replace("a", ""); - if (hash.indexOf("p")!=-1) photoID = hash.split("p")[1]; + if (hash[0]!==undefined) albumID = hash[0]; + if (hash[1]!==undefined) photoID = hash[1]; if (albumID&&photoID) { @@ -132,11 +172,10 @@ var lychee = { photo.json = null; // Show Photo - if (lychee.content.html()==""||($("#search").length&&$("#search").val().length!=0)) { + if (lychee.content.html()===""||($("#search").length&&$("#search").val().length!==0)) { lychee.content.hide(); album.load(albumID, true); } - if (!visible.photo()) view.photo.show(); photo.load(photoID, albumID); } else if (albumID) { @@ -159,6 +198,7 @@ var lychee = { search.code = ""; // Show Albums + if (visible.album()) view.album.hide(); if (visible.photo()) view.photo.hide(); albums.load(); @@ -175,12 +215,11 @@ var lychee = { }, - setTitle: function(title, count, editable) { + setTitle: function(title, editable) { - if (title=="Albums") document.title = "Lychee"; + if (title==="Albums") document.title = "Lychee"; else document.title = "Lychee - " + title; - if (count) title += " - " + count + " photos"; if (editable) $("#title").addClass("editable"); else $("#title").removeClass("editable"); @@ -190,8 +229,8 @@ var lychee = { setMode: function(mode) { - $("#button_signout, #search, #button_trash_album, #button_share_album, #button_edit_album, .button_add, #button_archive, .button_divider").remove(); - $("#button_trash, #button_move, #button_edit, #button_share, #button_star").remove(); + $("#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") }) @@ -207,12 +246,12 @@ var lychee = { .unbind('s') .unbind('backspace'); - if (mode=="public") { + if (mode==="public") { - $("#button_signin").show(); + $("header #button_signin, header #hostedwith").show(); lychee.publicMode = true; - } else if (mode=="view") { + } else if (mode==="view") { Mousetrap.unbind('esc'); $("#button_back, a#next, a#previous").remove(); @@ -262,7 +301,7 @@ var lychee = { g.setAttribute("data-app-key", "iq7lioj9wu0ieqs"); g.onload = g.onreadystatechange = function() { var rs = this.readyState; - if (rs&&rs!="complete"&&rs!="loaded") return; + if (rs&&rs!=="complete"&&rs!=="loaded") return; lychee.dropbox = true; loadingBar.hide(); callback(); @@ -273,12 +312,12 @@ var lychee = { }, - error: function(jqXHR, textStatus, errorThrown) { + error: function(errorThrown, params, data) { - console.log(jqXHR); - console.log(textStatus); - console.log(errorThrown); - loadingBar.show("error", textStatus, errorThrown); + console.log("Error Description: " + errorThrown); + console.log("Error Params: " + params); + console.log("Server Response: " + data); + loadingBar.show("error", errorThrown); } diff --git a/assets/js/modules/modal.js b/assets/js/modules/modal.js new file mode 100644 index 0000000..bc2969e --- /dev/null +++ b/assets/js/modules/modal.js @@ -0,0 +1,35 @@ +/** + * @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) { + var 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(); + + }, + + 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/js/modules/password.js b/assets/js/modules/password.js similarity index 60% rename from js/modules/password.js rename to assets/js/modules/password.js index ed4ea0b..9253f2c 100644 --- a/js/modules/password.js +++ b/assets/js/modules/password.js @@ -1,11 +1,8 @@ /** - * @name password.js - * @author Philipp Maurer + * @name Password Module + * @description Controls the access to password-protected albums and photos. * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Password Module - * Controls the access to password-protected albums and photos. + * @copyright 2014 by Tobias Reich */ password = { @@ -20,25 +17,28 @@ password = { buttons = [ ["Set Password", function() { - if (visible.album()) album.json.password = true; + if (visible.album()) { + album.json.password = true; + view.album.password(); + } - params = "setAlbumPassword&albumID=" + albumID + "&password=" + hex_md5($("input.password").val()); - lychee.api(params, "text", function(data) { + params = "setAlbumPassword&albumID=" + albumID + "&password=" + hex_md5($(".message input.text").val()); + lychee.api(params, function(data) { - if (!data) loadingBar.show("error"); + if (data!==true) lychee.error(null, params, data); }); }], ["Cancel", function() {}] ]; - modal.show("Set Password", "Set a password to protect '" + album.json.title + "' from unauthorized viewers. Only people with this password can view this album. ", buttons); + modal.show("Set Password", "Set a password to protect '" + album.json.title + "' from unauthorized viewers. Only people with this password can view this album. ", buttons); }, get: function(albumID, callback) { - var passwd = $("input.password").val(), + var passwd = $(".message input.text").val(), params; if (!lychee.publicMode) callback(); @@ -59,14 +59,14 @@ password = { // Check password params = "checkAlbumAccess&albumID=" + albumID + "&password=" + hex_md5(passwd); - lychee.api(params, "text", function(data) { + lychee.api(params, function(data) { - if (data) { + if (data===true) { password.value = hex_md5(passwd); callback(); } else { lychee.goto(""); - loadingBar.show("error", "Error", "Access denied. Wrong password!"); + loadingBar.show("error", "Access denied. Wrong password!"); } }); @@ -83,7 +83,7 @@ password = { ["Enter", function() { password.get(albumID, callback) }], ["Cancel", lychee.goto] ]; - modal.show(" Enter Password", "This album is protected with a password. Enter the password below to view the photos of this album: ", buttons); + 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); }, @@ -91,12 +91,15 @@ password = { var params; - if (visible.album()) album.json.password = false; + if (visible.album()) { + album.json.password = false; + view.album.password(); + } params = "setAlbumPassword&albumID=" + albumID + "&password="; - lychee.api(params, "text", function(data) { + lychee.api(params, function(data) { - if (!data) loadingBar.show("error"); + if (data!==true) lychee.error(null, params, data); }); diff --git a/assets/js/modules/photo.js b/assets/js/modules/photo.js new file mode 100644 index 0000000..b944ef1 --- /dev/null +++ b/assets/js/modules/photo.js @@ -0,0 +1,315 @@ +/** + * @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, + + 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() }, 300); + + }); + + }, + + parse: function() { + + if (!photo.json.title) photo.json.title = "Untitled"; + photo.json.url = lychee.upload_path_big + photo.json.url; + + }, + + delete: function(photoID) { + + var params, + buttons, + photoTitle; + + if (!photoID) return false; + + if (visible.photo()) photoTitle = photo.json.title; + else photoTitle = album.json.content[photoID].title; + if (photoTitle=="") photoTitle = "Untitled"; + + buttons = [ + ["Delete Photo", function() { + + // Change reference for the next and previous photo + if (album.json.content[photoID].nextPhoto!==""||album.json.content[photoID].previousPhoto!=="") { + + nextPhoto = album.json.content[photoID].nextPhoto; + previousPhoto = album.json.content[photoID].previousPhoto; + + album.json.content[previousPhoto].nextPhoto = nextPhoto; + album.json.content[nextPhoto].previousPhoto = previousPhoto; + + } + + album.json.content[photoID] = null; + + view.album.content.delete(photoID); + + // Only when search is not active + if (!visible.albums()) lychee.goto(album.getID()); + + params = "deletePhoto&photoID=" + photoID; + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + }], + ["Keep Photo", function() {}] + ]; + modal.show("Delete Photo", "Are you sure you want to delete the photo '" + photoTitle + "'?
This action can't be undone!", buttons); + + }, + + setTitle: function(photoID) { + + var oldTitle = "", + newTitle, + params, + buttons; + + if (!photoID) return false; + if (photo.json) oldTitle = photo.json.title; + else if (album.json) oldTitle = album.json.content[photoID].title; + + buttons = [ + ["Set Title", function() { + + newTitle = $(".message input.text").val(); + + if (photoID!=null&&photoID&&newTitle.length<31) { + + if (visible.photo()) { + photo.json.title = (newTitle==="") ? "Untitled" : newTitle; + view.photo.title(oldTitle); + } + + album.json.content[photoID].title = newTitle; + view.album.content.title(photoID); + + params = "setPhotoTitle&photoID=" + photoID + "&title=" + escape(encodeURI(newTitle)); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + } else if (newTitle.length>0) loadingBar.show("error", "New title to short or too long. Please try another one!"); + + }], + ["Cancel", function() {}] + ]; + modal.show("Set Title", "Please enter a new title for this photo: ", buttons); + + }, + + setAlbum: function(albumID, photoID) { + + var params; + + if (albumID>=0) { + + if (visible.photo) lychee.goto(album.getID()); + album.json.content[photoID] = null; + view.album.content.delete(photoID); + + params = "setAlbum&photoID=" + photoID + "&albumID=" + albumID; + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + } + + }, + + setStar: function(photoID) { + + var params; + + if (visible.photo()) { + photo.json.star = (photo.json.star==0) ? 1 : 0; + view.photo.star(); + } + + album.json.content[photoID].star = (album.json.content[photoID].star==0) ? 1 : 0; + view.album.content.star(photoID); + + params = "setPhotoStar&photoID=" + photoID; + 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); + + params = "setPhotoPublic&photoID=" + photoID + "&url=" + photo.getViewLink(photoID); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + }, + + setDescription: function(photoID) { + + var oldDescription = photo.json.description, + description, + params, + buttons; + + buttons = [ + ["Set Description", function() { + + description = $(".message input.text").val(); + + if (description.length<800) { + + if (visible.photo()) { + photo.json.description = description; + view.photo.description(); + } + + params = "setPhotoDescription&photoID=" + photoID + "&description=" + escape(description); + lychee.api(params, function(data) { + + if (data!==true) lychee.error(null, params, data); + + }); + + } else loadingBar.show("error", "Description too long. Please try again!"); + + }], + ["Cancel", function() {}] + ]; + modal.show("Set Description", "Please enter a description for this photo: ", buttons); + + }, + + 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; + + }, + + getDirectLink: function() { + + return $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig, ""); + + }, + + getViewLink: function(photoID) { + + if (location.href.indexOf("index.html")>0) return location.href.replace("index.html" + location.hash, "view.php?p=" + photoID); + else return location.href.replace(location.hash, "view.php?p=" + photoID); + + } + +} \ No newline at end of file diff --git a/js/modules/search.js b/assets/js/modules/search.js similarity index 67% rename from js/modules/search.js rename to assets/js/modules/search.js index b07da4d..cae7b67 100755 --- a/js/modules/search.js +++ b/assets/js/modules/search.js @@ -1,11 +1,8 @@ /** - * @name search.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Search Module - * Searches through your photos and albums. + * @name Search Module + * @description Searches through your photos and albums. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ search = { @@ -22,10 +19,10 @@ search = { clearTimeout($(window).data("timeout")); $(window).data("timeout", setTimeout(function() { - if ($("#search").val().length!=0) { + if ($("#search").val().length!==0) { params = "search&term=" + term; - lychee.api(params, "json", function(data) { + lychee.api(params, function(data) { if (data&&data.albums) { albums.json = { content: data.albums }; @@ -43,12 +40,12 @@ search = { }); } - if (albumsData==""&&photosData=="") code = "error"; - else if (albumsData=="") code = build.divider("Photos")+photosData; - else if (photosData=="") code = build.divider("Albums")+albumsData; + 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!=hex_md5(code)) { + if (search.code!==hex_md5(code)) { $(".no_content").remove(); @@ -59,7 +56,7 @@ search = { setTimeout(function() { - if (code=="error") $("body").append(build.no_content("search")); + if (code==="error") $("body").append(build.no_content("search")); else { lychee.content.html(code); lychee.animate(".album, .photo", "contentZoomIn"); @@ -82,7 +79,7 @@ search = { $("#search").val(""); $(".no_content").remove(); - if (search.code!="") { + if (search.code!=="") { search.code = ""; lychee.animate(".divider", "fadeOut"); diff --git a/assets/js/modules/settings.js b/assets/js/modules/settings.js new file mode 100644 index 0000000..fec2be9 --- /dev/null +++ b/assets/js/modules/settings.js @@ -0,0 +1,238 @@ +/** + * @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, + buttons; + + 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(); + + if (dbHost.length<1) dbHost = "localhost"; + if (dbName.length<1) dbName = "lychee"; + + params = "createConfig&dbName=" + escape(dbName) + "&dbUser=" + escape(dbUser) + "&dbPassword=" + escape(dbPassword) + "&dbHost=" + escape(dbHost); + 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; + + } + + // 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 'php/'. Please set the read, write and execute rights for others in 'php/' 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 + lychee.api("update", function(data) { 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, -215, 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=" + hex_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=" + hex_md5(old_password) + "&username=" + escape(username) + "&password=" + hex_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; + + buttons = [ + ["Change Sorting", function() { + + sorting[0] = $("select#settings_type").val(); + sorting[1] = $("select#settings_order").val(); + + 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 ", "").replace(" ", ";").split(";"); + $("select#settings_type").val(sorting[0]); + $("select#settings_order").val(sorting[1]); + } + + } + +} \ No newline at end of file diff --git a/assets/js/modules/upload.js b/assets/js/modules/upload.js new file mode 100644 index 0000000..3289235 --- /dev/null +++ b/assets/js/modules/upload.js @@ -0,0 +1,253 @@ +/** + * @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(icon, text) { + + if (icon===undefined) icon = "upload"; + + upload.close(true); + $("body").append(build.uploadModal(icon, text)); + + }, + + setIcon: function(icon) { + + $(".upload_message a").remove(); + $(".upload_message").prepend(""); + + }, + + setProgress: function(progress) { + + $(".progressbar div").css("width", progress + "%"); + + }, + + setText: function(text) { + + $(".progressbar").remove(); + $(".upload_message").append("

" + text + "

"); + + }, + + start: { + + local: function(files) { + + var pre_progress = 0, + formData = new FormData(), + xhr = new XMLHttpRequest(), + albumID = album.getID(), + popup, + progress; + + if (files.length<=0) return false; + if (albumID===false) albumID = 0; + + formData.append("function", "upload"); + formData.append("albumID", albumID); + + for (var i = 0; i < files.length; i++) { + + if (files[i].type!=="image/jpeg"&&files[i].type!=="image/jpg"&&files[i].type!=="image/png"&&files[i].type!=="image/gif") { + loadingBar.show("error", "The file format of " + files[i].name + " is not supported."); + return false; + } else { + formData.append(i, files[i]); + } + + } + + upload.show(); + + window.onbeforeunload = function() { return "Lychee is currently uploading!"; }; + + xhr.open("POST", lychee.api_path); + + xhr.onload = function() { + + if (xhr.status===200) { + + upload.close(); + + // WebKit Notification + if (window.webkitNotifications&&BrowserDetect.browser==="Safari") { + popup = window.webkitNotifications.createNotification("", "Upload complete", "You can now manage your new photo."); + popup.show(); + } + + window.onbeforeunload = null; + + if (album.getID()===false) lychee.goto("0"); + else album.load(albumID); + + } + + }; + + xhr.upload.onprogress = function(e) { + + if (e.lengthComputable) { + + progress = (e.loaded / e.total * 100 | 0); + + if (progress>pre_progress) { + upload.setProgress(progress); + pre_progress = progress; + } + + if (progress>=100) { + upload.setIcon("cog"); + upload.setText("Processing photos"); + } + + } + + }; + + $("#upload_files").val(""); + + xhr.send(formData); + + }, + + url: function() { + + var albumID = album.getID(), + params, + extension, + buttons; + + 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") { + loadingBar.show("error", "The file format of this link is not supported."); + return false; + } + + modal.close(); + upload.show("cog", "Importing from URL"); + + params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID; + lychee.api(params, function(data) { + + upload.close(); + + 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; + + if (albumID===false) albumID = 0; + + buttons = [ + ["Import", function() { + + modal.close(); + upload.show("cog", "Importing photos"); + + params = "importServer&albumID=" + albumID; + lychee.api(params, function(data) { + + upload.close(); + + if (album.getID()===false) lychee.goto("0"); + else album.load(albumID); + + 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 which are located in 'uploads/import/' of your Lychee installation.", buttons); + + }, + + dropbox: function() { + + var albumID = album.getID(), + params; + + if (albumID===false) albumID = 0; + + lychee.loadDropbox(function() { + Dropbox.choose({ + linkType: "direct", + multiselect: true, + success: function(files) { + + if (files.length>1) { + + for (var i = 0; i < files.length; i++) files[i] = files[i].link; + + } else files = files[0].link; + + upload.show("cog", "Importing photos"); + + params = "importUrl&url=" + escape(files) + "&albumID=" + albumID; + lychee.api(params, function(data) { + + upload.close(); + + 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.setProgress(100); + $(".upload_overlay").removeClass("fadeIn").css("opacity", 0); + setTimeout(function() { $(".upload_overlay").remove() }, 300); + } + + } + +} \ No newline at end of file diff --git a/js/modules/view.js b/assets/js/modules/view.js similarity index 64% rename from js/modules/view.js rename to assets/js/modules/view.js index 6ecb6d8..8dc23ca 100644 --- a/js/modules/view.js +++ b/assets/js/modules/view.js @@ -1,11 +1,8 @@ /** - * @name view.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * UI View - * Responsible to reflect data changes to the UI. + * @name UI View + * @description Responsible to reflect data changes to the UI. + * @author Tobias Reich + * @copyright 2014 by Tobias Reich */ view = { @@ -19,14 +16,14 @@ view = { if (visible.photo()) { lychee.imageview.removeClass("full"); lychee.loadingBar.css("opacity", 1); - lychee.header.css("margin-Top", "0px"); + lychee.header.removeClass("hidden"); if ($("#imageview #image.small").length>0) { $("#imageview #image").css({ marginTop: -1*($("#imageview #image").height()/2)+20 }); } else { $("#imageview #image").css({ - top: 70, + top: 60, right: 30, bottom: 30, left: 30 @@ -43,7 +40,7 @@ view = { $(window).data("timeout", setTimeout(function() { lychee.imageview.addClass("full"); lychee.loadingBar.css("opacity", 0); - lychee.header.css("margin-Top", "-45px"); + lychee.header.addClass("hidden"); if ($("#imageview #image.small").length>0) { $("#imageview #image").css({ marginTop: -1*($("#imageview #image").height()/2) @@ -63,31 +60,58 @@ view = { mode: function(mode) { - var albumID; + 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(); - albumID = album.getID(); - if (albumID=="s"||albumID=="f") $("#button_edit_album, #button_trash_album, #button_share_album").hide(); - else if (albumID==0) $("#button_edit_album, #button_share_album").hide(); - else $("#button_edit_album, #button_trash_album, #button_share_album").show(); + if (albumID==="s"||albumID==="f") { + $("#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() { @@ -99,7 +123,7 @@ view = { title: function() { - lychee.setTitle("Albums", null, false); + lychee.setTitle("Albums", false); }, @@ -127,7 +151,7 @@ view = { } - if (smartData==""&&albumsData=="") $("body").append(build.no_content("picture")); + if (smartData===""&&albumsData==="") $("body").append(build.no_content("picture")); else lychee.content.html(smartData + albumsData); $("img").retina(); @@ -153,6 +177,7 @@ view = { marginLeft: 0 }, 300, function() { $(this).remove(); + if (albums.json.num<=0) lychee.animate(".divider:last-of-type", "fadeOut"); }); } @@ -167,6 +192,7 @@ view = { album.parse(); + view.album.infobox(); view.album.title(); view.album.public(); view.album.content.init(); @@ -175,22 +201,29 @@ view = { }, - title: function() { + hide: function() { + + view.infobox.hide(); + + }, + + title: function(oldTitle) { if ((visible.album()||!album.json.init)&&!visible.photo()) { switch (album.getID()) { case "f": - lychee.setTitle("Starred", album.json.num, false); + lychee.setTitle("Starred", false); break; case "s": - lychee.setTitle("Public", album.json.num, false); + lychee.setTitle("Public", false); break; case "0": - lychee.setTitle("Unsorted", album.json.num, false); + lychee.setTitle("Unsorted", false); break; default: - lychee.setTitle(album.json.title, album.json.num, true); + if (album.json.init) $("#infobox .attr_name").html(album.json.title + " " + build.editIcon("edit_title_album")); + lychee.setTitle(album.json.title, true); break; } @@ -198,6 +231,12 @@ view = { }, + description: function() { + + $("#infobox .attr_description").html(album.json.description + " " + build.editIcon("edit_description_album")); + + }, + content: { init: function() { @@ -248,6 +287,7 @@ view = { // Only when search is not active if (!visible.albums()) { album.json.num--; + view.album.num(); view.album.title(); } }); @@ -256,17 +296,38 @@ view = { }, + 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(); + } }, @@ -289,11 +350,18 @@ view = { 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"); }, @@ -301,43 +369,38 @@ view = { hide: function() { if (!visible.controls()) view.header.show(); - if (visible.infobox) view.photo.hideInfobox(); + if (visible.infobox) view.infobox.hide(); + lychee.content.removeClass("view"); view.header.mode("album"); // Make body scrollable $("body").css("overflow", "scroll"); + // Disable Fullscreen + $(document) + .unbind("mouseenter") + .unbind("mouseleave"); + // Hide Photo lychee.animate(lychee.imageview, "fadeOut"); - setTimeout(function() { lychee.imageview.hide() }, 300); - - }, - - showInfobox: function() { - - if (!visible.infobox()) $("body").append("
"); - lychee.infobox.css("right", "0px"); - - }, - - hideInfobox: function() { - - $("#infobox_overlay").remove(); - lychee.infobox.css("right", "-320px"); + setTimeout(function() { + lychee.imageview.hide(); + view.album.infobox(); + }, 300); }, title: function(oldTitle) { - if (photo.json.init) $("#infobox .attr_name").html($("#infobox .attr_name").html().replace(oldTitle, photo.json.title)); - lychee.setTitle(photo.json.title, null, true); + if (photo.json.init) $("#infobox .attr_name").html(photo.json.title + " " + build.editIcon("edit_title")); + lychee.setTitle(photo.json.title, true); }, - description: function(oldDescription) { + description: function() { - if (photo.json.init) $("#infobox .attr_description").html($("#infobox .attr_description").html().replace(oldDescription, photo.json.description)); + if (photo.json.init) $("#infobox .attr_description").html(photo.json.description + " " + build.editIcon("edit_description")); }, @@ -374,19 +437,16 @@ view = { photo: function() { - if (visible.controls()&&photo.isSmall()) lychee.imageview.html("
"); - else if (visible.controls()) lychee.imageview.html("
"); - else if (photo.isSmall()) lychee.imageview.html("
"); - else lychee.imageview.html("
"); + lychee.imageview.html(build.imageview(photo.json, photo.isSmall(), visible.controls())); - if (!photo.json.nextPhoto||lychee.viewMode) $("a#next").hide(); - if (!photo.json.previousPhoto||lychee.viewMode) $("a#previous").hide(); + if ((album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==="")||lychee.viewMode) $("a#next").hide(); + if ((album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==="")||lychee.viewMode) $("a#previous").hide(); }, infobox: function() { - lychee.infobox.html(build.infobox(photo.json)).show(); + lychee.infobox.html(build.infoboxPhoto(photo.json)).show(); } diff --git a/js/modules/visible.js b/assets/js/modules/visible.js similarity index 53% rename from js/modules/visible.js rename to assets/js/modules/visible.js index 8ece3a1..2855354 100755 --- a/js/modules/visible.js +++ b/assets/js/modules/visible.js @@ -1,22 +1,19 @@ /** - * @name visible.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Visible Module - * This module is used to check if elements are visible or not. + * @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; + if ($("#tools_albums").css("display")==="block") return true; else return false; }, album: function() { - if ($("#tools_album").css("display")=="block") return true; + if ($("#tools_album").css("display")==="block") return true; else return false; }, @@ -26,8 +23,8 @@ visible = { }, infobox: function() { - if (parseInt(lychee.infobox.css("right").replace("px", ""))==-320) return false; - else return true; + if ($("#infobox.active").length>0) return true; + else return false; }, controls: function() { @@ -40,6 +37,11 @@ visible = { 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; diff --git a/js/view.js b/assets/js/view.js old mode 100755 new mode 100644 similarity index 81% rename from js/view.js rename to assets/js/view.js index d542f68..00ed53f --- a/js/view.js +++ b/assets/js/view.js @@ -1,8 +1,8 @@ /** - * @name view.js - * @author Philipp Maurer + * @name View + * @description Used to view single photos with view.php * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich + * @copyright 2014 by Tobias Reich */ var header = $("header"), @@ -38,7 +38,7 @@ $(document).ready(function(){ function key(e) { code = (e.keyCode ? e.keyCode : e.which); - if (code==27&&visibleInfobox()) { hideInfobox(); e.preventDefault(); } + if (code===27&&visibleInfobox()) { hideInfobox(); e.preventDefault(); } } @@ -66,15 +66,16 @@ function isPhotoSmall(photo) { function showInfobox() { - $("body").append("
"); - infobox.css("right", "0px"); + $("body").append("
"); + infobox.addClass("active"); } function hideInfobox() { - $("#infobox_overlay").remove(); - infobox.css("right", "-320px"); + $("#infobox_overlay").removeClass("fadeIn").addClass("fadeOut"); + setTimeout(function() { $("#infobox_overlay").remove() }, 300); + infobox.removeClass("active"); } @@ -91,10 +92,10 @@ function loadPhotoInfo(photoID) { imageview.attr("data-id", photoID); if (isPhotoSmall(data)) imageview.html("
"); - else imageview.html("
"); + else imageview.html("
"); imageview.removeClass("fadeOut").addClass("fadeIn").show(); - infobox.html(build.infobox(data, true)).show(); + infobox.html(build.infoboxPhoto(data, true)).show(); }, error: ajaxError }); diff --git a/css/animations.css b/css/animations.css deleted file mode 100755 index e45fc77..0000000 --- a/css/animations.css +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @name animations.css - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - */ - -/* bounceInDown ------------------------------------------------*/ -@-webkit-keyframes bounceInDown { - 0% { - -webkit-transform: translateY(-2000px); - } - 60% { - -webkit-transform: translateY(30px); - } - 80% { - -webkit-transform: translateY(-10px); - } - 100% { - -webkit-transform: translateY(0); - } -} -@-moz-keyframes bounceInDown { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes bounceInDown { - 0% { - -ms-transform: translateY(-2000px); - } - 60% { - -ms-transform: translateY(30px); - } - 80% { - -ms-transform: translateY(-10px); - } - 100% { - -ms-transform: translateY(0); - } -} -@-o-keyframes bounceInDown { - 0% { - -o-transform: translateY(-2000px); - } - 60% { - -o-transform: translateY(30px); - } - 80% { - -o-transform: translateY(-10px); - } - 100% { - -o-transform: translateY(0); - } -} -@keyframes bounceInDown { - 0% { - transform: translateY(-2000px); - } - 60% { - transform: translateY(30px); - } - 80% { - transform: translateY(-10px); - } - 100% { - transform: translateY(0); - } -} - -/* bounceOutUp ------------------------------------------------*/ -@-webkit-keyframes bounceOutUp { - 0% { - -webkit-transform: translateY(0); - } - 20% { - -webkit-transform: translateY(20px); - } - 100% { - -webkit-transform: translateY(-2000px); - } -} -@-moz-keyframes bounceOutUp { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-ms-keyframes bounceOutUp { - 0% { - -ms-transform: translateY(0); - } - 20% { - -ms-transform: translateY(20px); - } - 100% { - -ms-transform: translateY(-2000px); - } -} -@-o-keyframes bounceOutUp { - 0% { - -o-transform: translateY(0); - } - 20% { - -o-transform: translateY(20px); - } - 100% { - -o-transform: translateY(-2000px); - } -} -@keyframes bounceOutUp { - 0% { - transform: translateY(0); - } - 20% { - transform: translateY(20px); - } - 100% { - transform: translateY(-2000px); - } -} - -/* moveUp ------------------------------------------------*/ -@-webkit-keyframes moveUp { - 0% { - -webkit-transform: translateY(1000px); - } - 100% { - -webkit-transform: translateY(0px); - } -} -@-moz-keyframes moveUp { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes moveUp { - 0% { - -ms-transform: translateY(1000px); - } - 100% { - -ms-transform: translateY(0px); - } -} -@-o-keyframes moveUp { - 0% { - -o-transform: translateY(1000px); - } - 100% { - -o-transform: translateY(0px); - } -} -@keyframes moveUp { - 0% { - transform: translateY(1000px); - } - 100% { - transform: translateY(0px); - } -} - -/* moveDown ------------------------------------------------*/ -@-webkit-keyframes moveDown { - 0% { - -webkit-transform: translateY(-100px); - } - 100% { - -webkit-transform: translateY(0); - } -} -@-moz-keyframes moveDown { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes moveDown { - 0% { - -ms-transform: translateY(-100px); - } - 100% { - -ms-transform: translateY(0); - } -} -@-o-keyframes moveDown { - 0% { - -o-transform: translateY(-100px); - } - 100% { - -o-transform: translateY(0); - } -} -@keyframes moveDown { - 0% { - transform: translateY(-100px); - } - 100% { - transform: translateY(0); - } -} - -/* fadeIn ------------------------------------------------*/ -@-webkit-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-moz-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-o-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -/* fadeOut ------------------------------------------------*/ -@-webkit-keyframes fadeOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-moz-keyframes fadeOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-ms-keyframes fadeOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-o-keyframes fadeOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@keyframes fadeOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} - -/* moveBackground ------------------------------------------------*/ -@-webkit-keyframes moveBackground { - 0% { - background-position-x: 0px; - } - 100% { - background-position-x: -33px; - } -} -@-moz-keyframes moveBackground { - 0% { - background-position-x: 0px; - } - 100% { - background-position-x: -33px; - } -} -@-ms-keyframes moveBackground { - 0% { - background-position-x: 0px; - } - 100% { - background-position-x: -33px; - } -} -@-o-keyframes moveBackground { - 0% { - background-position-x: 0px; - } - 100% { - background-position-x: -33px; - } -} -@keyframes moveBackground { - 0% { - background-position-x: 0px; - } - 100% { - background-position-x: -33px; - } -} - -/* zoomOut ------------------------------------------------*/ -@-webkit-keyframes zoomOut { - 0% { - opacity: 1; - -webkit-transform: scale(1); - } - 100% { - opacity: 0; - -webkit-transform: scale(.5); - } -} -@-moz-keyframes zoomOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-ms-keyframes zoomOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@-o-keyframes zoomOut { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} -@keyframes zoomOut { - 0% { - opacity: 1; - transform: scale(1); - } - 100% { - opacity: 0; - transform: scale(.5); - } -} - -/* zoomIn ------------------------------------------------*/ -@-webkit-keyframes zoomIn { - 0% { - opacity: 0; - -webkit-transform: scale(.5); - } - 100% { - opacity: 1; - -webkit-transform: scale(1); - } -} -@-moz-keyframes zoomIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes zoomIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-o-keyframes zoomIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@keyframes zoomIn { - 0% { - opacity: 0; - transform: scale(.5); - } - 100% { - opacity: 1; - transform: scale(1); - } -} - -/* pulse ------------------------------------------------*/ -@-webkit-keyframes pulse { - 0% { - opacity: 1; - } - 50% { - opacity: 0.3; - } - 100% { - opacity: 1; - } -} -@-moz-keyframes pulse { - 0% { - opacity: 1; - } - 50% { - opacity: 0.8; - } - 100% { - opacity: 1; - } -} -@-ms-keyframes pulse { - 0% { - opacity: 1; - } - 50% { - opacity: 0.8; - } - 100% { - opacity: 1; - } -} -@-o-keyframes pulse { - 0% { - opacity: 1; - } - 50% { - opacity: 0.8; - } - 100% { - opacity: 1; - } -} -@keyframes pulse { - 0% { - opacity: 1; - } - 50% { - opacity: 0.8; - } - 100% { - opacity: 1; - } -} \ No newline at end of file diff --git a/css/style.css b/css/style.css deleted file mode 100755 index ef10a09..0000000 --- a/css/style.css +++ /dev/null @@ -1,1398 +0,0 @@ -/** - * @name style.css - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - */ - -/* Reset -------------------------------------------------*/ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { margin:0; padding:0; border:0; font-size:100%; 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:before,blockquote:after,q:before,q:after { content:''; content:none; } -table { border-collapse:collapse; border-spacing:0; } - -/* Basics -------------------------------------------------*/ -html, body { - min-height: 100%; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - user-select: none; -} -body { background-color: #222; background-image: url(../img/background.jpg); font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; -webkit-font-smoothing: antialiased; } -.center { left: 50%; top:50%; position: absolute; } -* { - -webkit-transition: color .3s, opacity .3s ease-out, -webkit-transform .3s ease-out, box-shadow .3s; - -moz-transition: opacity .3s ease-out, -moz-transform .3s ease-out, box-shadow .3s; - -o-transition: opacity .3s ease-out, -o-transform .3s ease-out, box-shadow .3s; - transition: color .3s, opacity .3s ease-out, transform .3s ease-out, box-shadow .3s; -} - -/* Tooltip ------------------------------------------------*/ -.tipsy { - padding: 4px; - font-size: 12px; - position: absolute; - z-index: 100000; - - /* Animation */ - -webkit-animation-name: fadeIn; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: fadeIn; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: fadeIn; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: fadeIn; - animation-duration: .3s; - animation-fill-mode: forwards; -} -.tipsy-inner { - padding: 7px 10px 6px 10px; - color: white; - max-width: 200px; - text-align: center; - text-shadow: 0 -1px 0 #000; - background: #000; - box-shadow: 0 1px 2px hsla(0, 0%, 0%, .25); - border-radius: 3px; -} -.tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; } -.tipsy-arrow-n { border-bottom-color: #000; } -.tipsy-arrow-s { border-top-color: #000; } -.tipsy-arrow-e { border-left-color: #000; } -.tipsy-arrow-w { border-right-color: #000; } -.tipsy-n .tipsy-arrow { top: 0px; 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; } - -/* Animations ------------------------------------------------*/ -.fadeIn { - -webkit-animation-name: fadeIn; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: fadeIn; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: fadeIn; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: fadeIn; - animation-duration: .3s; - animation-fill-mode: forwards; -} -.fadeOut { - -webkit-animation-name: fadeOut; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: fadeOut; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: fadeOut; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: fadeOut; - animation-duration: .3s; - animation-fill-mode: forwards; -} -.contentFadeIn { - -webkit-animation-name: bounceInDown; - -webkit-animation-duration: 1s; - -webkit-animation-timing-function: ease-out; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: bounceInDown; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: bounceInDown; - -o-animation-duration: 1s; - -o-animation-timing-function: ease-out; - -o-animation-fill-mode: forwards; - animation-name: bounceInDown; - animation-duration: 1s; - animation-timing-function: ease-out; - animation-fill-mode: forwards; -} -.contentFadeOut { - -webkit-animation-name: bounceOutUp; - -webkit-animation-duration: 1s; - -webkit-animation-timing-function: ease-out; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: bounceOutUp; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: bounceOutUp; - -o-animation-duration: 1s; - -o-animation-timing-function: ease-out; - -o-animation-fill-mode: forwards; - animation-name: bounceOutUp; - animation-duration: 1s; - animation-timing-function: ease-out; - animation-fill-mode: forwards; -} -.contentZoomOut { - -webkit-animation-name: zoomOut; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: zoomOut; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: zoomOut; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: zoomOut; - animation-duration: .3s; - animation-fill-mode: forwards; -} -.contentZoomIn { - -webkit-animation-name: zoomIn; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: zoomIn; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: zoomIn; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: zoomIn; - animation-duration: .3s; - animation-fill-mode: forwards; -} - -/* Loading ------------------------------------------------*/ -#loading { - position: fixed; - width: 100%; - height: 2px; - background-color: #2f0d0e; - background-repeat: repeat-x; - z-index: 1; - display: none; - - /* Animation */ - -webkit-animation-name: moveBackground; - -webkit-animation-duration: .2s; - -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: infinite; - -moz-animation-name: moveBackground; - -moz-animation-duration: .2s; - -moz-animation-timing-function: linear; - -moz-animation-iteration-count: infinite; - -o-animation-name: moveBackground; - -o-animation-duration: .2s; - -o-animation-timing-function: linear; - -o-animation-iteration-count: infinite; - animation-name: moveBackground; - animation-duration: .2s; - animation-timing-function: linear; - animation-iteration-count: infinite; -} -#loading h1 { - margin: 13px; - color: #ddd; - font-size: 14px; - font-weight: bold; - text-shadow: 0px 1px 0px #000; - text-transform: capitalize; -} -#loading h1 span { - margin-left: 10px; - font-weight: normal; - text-transform: none; -} -#loading.loading { - background-image: url(../img/bar/loading.png); -} -#loading.error { - background-image: url(../img/bar/error.png); -} - -/* Header ------------------------------------------------*/ -header { - position: fixed; - height: 41px; - width: 100%; - - background-color: #333; - background-image: -webkit-gradient(linear, left top, left bottom, from(#555), to(#333)); - background-image: -webkit-linear-gradient(top, #555, #333); - background-image: -moz-linear-gradient(top, #555, #333); - background-image: -o-linear-gradient(top, #555, #333); - background-image: -ms-linear-gradient(top, #555, #333); - background-image: linear-gradient(top, #555, #333); - - box-shadow: inset 0px 1px 0px #666, inset 0px -1px 0px #393939, 0px 0px 3px #000; - border-top: 1px solid #222; - z-index: 1; - - -webkit-transition: opacity .3s ease-out, -webkit-transform .3s ease-out, box-shadow .3s, margin-top .3s; - -moz-transition: opacity .3s ease-out, -moz-transform .3s ease-out, box-shadow .3s, margin-top .3s; - -o-transition: opacity .3s ease-out, -o-transform .3s ease-out, box-shadow .3s, margin-top .3s; - transition: opacity .3s ease-out, transform .3s ease-out, box-shadow .3s, margin-top .3s; - - /* Animation */ - -webkit-animation-name: moveDown; - -webkit-animation-duration: .3s; - -webkit-animation-timing-function: ease-out; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: moveDown; - -moz-animation-duration: .3s; - -moz-animation-timing-function: ease-out; - -moz-animation-fill-mode: forwards; - -o-animation-name: moveDown; - -o-animation-duration: .3s; - -o-animation-timing-function: ease-out; - -o-animation-fill-mode: forwards; - animation-name: moveDown; - animation-duration: .3s; - animation-timing-function: ease-out; - animation-fill-mode: forwards; -} - - /* Title ------------------------------------------------*/ - #title { - position: absolute; - margin: 0px 30%; - width: 40%; - padding: 11px 0px; - color: #fff; - font-size: 16px; - font-weight: bold; - text-align: center; - text-shadow: 0px -1px 0px #000; - } - #title.editable { - cursor: pointer; - } - #title span { - color: #aaa; - font-size: 16px; - font-weight: normal; - } - - /* Button ------------------------------------------------*/ - header .button { - float: left; - position: absolute; - padding: 7px 10px 8px 10px; - margin: 6px 0px 0px 8px; - font-size: 12px; - font-weight: bold; - color: #fff; - text-shadow: 0px -1px 0px #000; - text-decoration: none !important; - - background: #555; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(1, #555), color-stop(0, #333)); - background-image: -webkit-linear-gradient(top, #555 0%, #333 100%); - background-image: -moz-linear-gradient(top, #555 0%, #333 100%); - background-image: -o-linear-gradient(top, #555 0%, #333 100%); - background: linear-gradient(top, #555 0%, #333 100%); - - border: 1px solid #222; - border-radius: 3px; - box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0px 1px 0px #444; - cursor: pointer; - } - header .button:hover { - background-color: #5c5c5c; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 92, 92)), to(rgb(57, 57, 57))); - background-image: -webkit-linear-gradient(top, rgb(92, 92, 92), rgb(57, 57, 57)); - background-image: -moz-linear-gradient(top, rgb(92, 92, 92), rgb(57, 57, 57)); - background-image: -o-linear-gradient(top, rgb(92, 92, 92), rgb(57, 57, 57)); - background-image: -ms-linear-gradient(top, rgb(92, 92, 92), rgb(57, 57, 57)); - background-image: linear-gradient(top, rgb(92, 92, 92), rgb(57, 57, 57)); - } - header .button:active { - background-color: #393939; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(57, 57, 57)), to(rgb(68, 68, 68))); - background-image: -webkit-linear-gradient(top, rgb(57, 57, 57), rgb(68, 68, 68)); - background-image: -moz-linear-gradient(top, rgb(57, 57, 57), rgb(68, 68, 68)); - background-image: -o-linear-gradient(top, rgb(57, 57, 57), rgb(68, 68, 68)); - background-image: -ms-linear-gradient(top, rgb(57, 57, 57), rgb(68, 68, 68)); - background-image: linear-gradient(top, rgb(57, 57, 57), rgb(68, 68, 68)); - } - header .button.icon { - float: right; - position: relative; - padding: 7px 11px 4px 11px; - margin: 6px 8px 0px 0px; - font-family: 'FontAwesome'; - font-size: 16px; - } - #tools_albums, #tools_album, #tools_photo, #button_signin { - display: none; - } - - /* Button Divider ------------------------------------------------*/ - header .button_divider { - float: right; - position: relative; - margin: 1px 12px 0px 0px; - width: 1px; - height: 40px; - background-color: transparent; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(68, 68, 68)), to(rgb(37, 37, 37))); - background-image: -webkit-linear-gradient(top, rgba(68, 68, 68, 0), rgb(25, 25, 25)); - background-image: -moz-linear-gradient(top, rgb(68, 68, 68), rgb(37, 37, 37)); - background-image: -o-linear-gradient(top, rgb(68, 68, 68), rgb(37, 37, 37)); - background-image: -ms-linear-gradient(top, rgb(68, 68, 68), rgb(37, 37, 37)); - background-image: linear-gradient(top, rgb(68, 68, 68), rgb(37, 37, 37)); - border-right: 1px solid #555; - } - header .button_divider.less { - margin: 1px 6px 0px 6px; - } - - - /* Search ------------------------------------------------*/ - #search { - float: right; - width: 80px; - margin: 7px 12px 0px 0px; - padding: 5px 10px 7px 10px; - background-color: #444; - color: #fff; - border: none; - border: 1px solid #111; - box-shadow: 0px 1px 0px #555; - outline: none; - border-radius: 5px; - opacity: .6; - -webkit-transition: opacity .3s ease-out, -webkit-transform .3s ease-out, box-shadow .3s, width .2s ease-out; - -moz-transition: opacity .3s ease-out, -moz-transform .3s ease-out, box-shadow .3s, width .2s ease-out; - -o-transition: opacity .3s ease-out, -o-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; - } - #search:focus { - box-shadow: 0px 1px 0px #555, inset 0px 0px 2px #333; - opacity: 1; - width: 140px; - } - - /* Tools ------------------------------------------------*/ - .tools:first-of-type { - margin-right: 6px; - } - .tools { - float: right; - padding: 10px 8px; - color: #aaa; - font-size: 21px; - text-shadow: 0px -1px 0px #222; - cursor: pointer; - } - .tools:hover a { - color: #fff; - } - .tools .icon-star { - color: #f0ef77; - } - .tools .icon-share.active { - color: #ff9737; - } - - -/* Content ------------------------------------------------*/ -#content { - position: absolute; - padding: 41px 0px 33px 0px; - width: 100%; - -webkit-overflow-scrolling: touch; -} - - /* Photo ------------------------------------------------*/ - .photo { - float: left; - display: inline-block; - width: 206px; - height: 206px; - margin: 30px 0px 0px 30px; - cursor: pointer; - } - .photo img { - position: absolute; - width: 200px; - height: 200px; - background-color: #222; - border-radius: 3px; - box-shadow: 0px 1px 5px #111; - border: 3px solid #ccc; - } - .photo:hover img, .photo.active img { - box-shadow: 0px 0px 10px #005ecc; - } - - /* Album ------------------------------------------------*/ - .album { - float: left; - display: inline-block; - width: 206px; - height: 206px; - margin: 30px 0px 0px 30px; - cursor: pointer; - } - .album img:first-child, .album img:nth-child(2) { - -webkit-transform: rotate(0deg) translateY(0px) translateX(0px); - -moz-transform: rotate(0deg) translateY(0px) translateX(0px); - -o-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); - -moz-transform: rotate(-2deg) translateY(10px) translateX(-12px); - -o-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); - -moz-transform: rotate(5deg) translateY(-8px) translateX(12px); - -o-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: 3px; - box-shadow: 0px 1px 5px #111; - border: 3px solid #ccc; - } - .album:hover img, .album.active img { - box-shadow: 0px 0px 10px #005ecc; - } - - /* Album/Photo Overlay ------------------------------------------------*/ - .album .overlay, .photo .overlay { - position: absolute; - width: 200px; - height: 200px; - margin: 3px; - background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0.9) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(20%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.9))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* IE10+ */ - background: linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); /* W3C */ - } - .photo .overlay { - opacity: 0; - } - .photo:hover .overlay, .photo.active .overlay { - opacity: 1; - } - .album .overlay h1, .photo .overlay h1 { - min-height: 19px; - width: 190px; - margin: 153px 0px 3px 15px; - color: #fff; - font-size: 16px; - font-weight: bold; - text-shadow: 0px 1px 0px #000; - overflow: hidden; - } - .album .overlay a { - margin-left: 15px; - font-size: 11px; - color: #aaa; - text-shadow: 0px 1px 0px #000; - } - .photo .overlay a { - margin: 155px 0px 5px 15px; - font-size: 11px; - color: #aaa; - text-shadow: 0px 1px 0px #000; - } - - /* Badges ------------------------------------------------*/ - .album .badge, .photo .badge { - position: absolute; - margin-top: -1px; - margin-left: 12px; - padding: 12px 7px 3px 7px; - box-shadow: 0px 0px 3px #000; - border-radius: 0px 0px 3px 3px; - border: 1px solid #fff; - border-top: none; - color: #fff; - font-size: 24px; - text-shadow: 0px 1px 0px #000; - opacity: .9; - } - .album .badge.icon-star, .photo .badge.icon-star { - padding: 12px 8px 3px 8px; - } - .album .badge.icon-share, .photo .badge.icon-share { - padding: 12px 6px 3px 8px; - } - .album .badge::after, .photo .badge::after { - content: ""; - position: absolute; - margin-top: -12px; - margin-left: -26px; - width: 34px; - height: 5px; - background: -moz-linear-gradient(top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,1)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* IE10+ */ - background: linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%); /* W3C */ - opacity: .4; - } - .album .badge.icon-star::after { - margin-left: -28px; - width: 36px; - } - .album .badge.icon-share::after, .photo .badge.icon-share::after { - margin-left: -30px; - width: 38px; - } - .album .badge.icon-reorder::after { - margin-left: -30px; - width: 38px; - } - .album .badge:nth-child(2n), .photo .badge:nth-child(2n) { - margin-left: 57px; - } - .album .badge.red, .photo .badge.red { - background: #d64b4b; - background: -webkit-gradient(linear, left top, left bottom, from(#d64b4b), to(#ab2c2c)); - background: -webkit-linear-gradient(top, #d64b4b, #ab2c2c); - background: -moz-linear-gradient(top, #d64b4b, #ab2c2c); - background: -ms-linear-gradient(top, #d64b4b, #ab2c2c); - background: -o-linear-gradient(top, #d64b4b, #ab2c2c); - } - .album .badge.blue, .photo .badge.blue { - background: #d64b4b; - background: -webkit-gradient(linear, left top, left bottom, from(#347cd6), to(#2945ab)); - background: -webkit-linear-gradient(top, #347cd6, #2945ab); - background: -moz-linear-gradient(top, #347cd6, #2945ab); - background: -ms-linear-gradient(top, #347cd6, #2945ab); - background: -o-linear-gradient(top, #347cd6, #2945ab); - } - - /* Divider ------------------------------------------------*/ - .divider { - float: left; - width: 100%; - height: 32px; - margin-top: 50px; - opacity: 0; - - background-color: #2b2b2b; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(43, 43, 43)), to(rgb(35, 35, 35))); - background-image: -webkit-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -moz-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -o-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -ms-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - - box-shadow: 0px 1px 0px #111, inset 0px 1px 0px rgba(255, 255, 255, .1); - } - .divider:first-child { - margin-top: 2px; - } - .divider h1 { - float: left; - margin: 8px 0px 0px 30px; - color: #fff; - font-size: 14px; - font-weight: bold; - text-shadow: 0px -1px 0px #000; - } - - /* No Content ------------------------------------------------*/ - .no_content { - position: absolute; - top: 50%; - left: 50%; - height: 160px; - width: 180px; - margin-top: -80px; - margin-left: -90px; - padding-top: 20px; - color: rgba(20, 20, 20, 1); - text-shadow: 0px 1px 0px rgba(255, 255, 255, .05); - text-align: center; - } - - .no_content .icon { - font-size: 120px; - } - - .no_content p { - font-size: 18px; - } - -/* Overlay ------------------------------------------------*/ -.message_overlay { - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - background-color: rgba(0,0,0,.3); - background-image: -webkit-gradient(radial, 50% 50%,0,50% 50%,200, from(rgba(0, 0, 0, 0.85)), to(rgba(0, 0, 0, 0.50))); - background-image: -webkit-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -moz-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -o-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -ms-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - z-index: 1000; -} - - .message { - position: absolute; - display: inline-block; - width: 500px; - margin-left: -250px; - margin-top: -85px; - background-color: #505050; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(80, 80, 80)), to(rgb(43, 42, 42))); - background-image: -webkit-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -moz-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -o-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -ms-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - border-radius: 5px; - border-bottom: 1px solid #000; - box-shadow: 0px 0px 5px #000, inset 0px 1px 0px rgba(255,255,255,.2), inset 1px 0px 0px rgba(255,255,255,.05), inset -1px 0px 0px rgba(255,255,255,.05); - - /* Animation */ - -webkit-animation-name: bounceInDown; - -webkit-animation-duration: 1s; - -webkit-animation-timing-function: ease-out; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: bounceInDown; - -moz-animation-duration: 1s; - -moz-animation-timing-function: ease-out; - -moz-animation-fill-mode: forwards; - -o-animation-name: bounceInDown; - -o-animation-duration: 1s; - -o-animation-timing-function: ease-out; - -o-animation-fill-mode: forwards; - animation-name: bounceInDown; - animation-duration: 1s; - animation-timing-function: ease-out; - animation-fill-mode: forwards; - } - .message h1 { - float: left; - width: 100%; - padding: 12px 0px; - color: #fff; - font-size: 16px; - font-weight: bold; - text-shadow: 0px -1px 0px #000; - text-align: center; - } - .message .close { - position: absolute; - top: 0px; - right: 0px; - padding: 12px 14px 6px 7px; - color: #aaa; - font-size: 20px; - text-shadow: 0px -1px 0px #111; - cursor: pointer; - } - .message .close:hover { - color: #fff; - } - .message p { - float: left; - width: 90%; - margin-top: 1px; - padding: 12px 5% 15px 5%; - color: #eee; - font-size: 14px; - text-shadow: 0px -1px 0px #222; - line-height: 20px; - } - .message p b { - font-weight: bold; - } - .message .button { - float: right; - margin: 15px 15px 15px 0px; - padding: 6px 10px 8px 10px; - background-color: #4e4e4e; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(78, 78, 78)), to(rgb(45, 45, 45))); - background-image: -webkit-linear-gradient(top, rgb(78, 78, 78), rgb(45, 45, 45)); - background-image: -moz-linear-gradient(top, rgb(78, 78, 78), rgb(45, 45, 45)); - background-image: -o-linear-gradient(top, rgb(78, 78, 78), rgb(45, 45, 45)); - background-image: -ms-linear-gradient(top, rgb(78, 78, 78), rgb(45, 45, 45)); - background-image: linear-gradient(top, rgb(78, 78, 78), rgb(45, 45, 45)); - - color: #ccc; - font-size: 14px; - font-weight: bold; - text-align: center; - text-shadow: 0px -1px 0px #000; - border-radius: 5px; - border: 1px solid #111; - box-shadow: inset 0px 1px 0px rgba(255,255,255,.2), 0px 1px 0px rgba(255,255,255,.1); - cursor: pointer; - } - .message .button:first-of-type { - margin: 15px 5% 18px 0px !important; - } - .message .button.active { - color: #fff; - box-shadow: inset 0px 1px 0px rgba(255,255,255,.2), 0px 1px 0px rgba(255,255,255,.1), 0px 0px 5px #005ecc; - } - .message .button:hover { - background-color: #565757; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(86, 87, 87)), to(rgb(57, 57, 57))); - background-image: -webkit-linear-gradient(top, rgb(86, 87, 87), rgb(57, 57, 57)); - background-image: -moz-linear-gradient(top, rgb(86, 87, 87), rgb(57, 57, 57)); - background-image: -o-linear-gradient(top, rgb(86, 87, 87), rgb(57, 57, 57)); - background-image: -ms-linear-gradient(top, rgb(86, 87, 87), rgb(57, 57, 57)); - background-image: linear-gradient(top, rgb(86, 87, 87), rgb(57, 57, 57)); - } - .message .button:active, .message .button.pressed { - background-color: #393939; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(57, 57, 57)), to(rgb(75, 76, 76))); - background-image: -webkit-linear-gradient(top, rgb(57, 57, 57), rgb(75, 76, 76)); - background-image: -moz-linear-gradient(top, rgb(57, 57, 57), rgb(75, 76, 76)); - background-image: -o-linear-gradient(top, rgb(57, 57, 57), rgb(75, 76, 76)); - background-image: -ms-linear-gradient(top, rgb(57, 57, 57), rgb(75, 76, 76)); - background-image: linear-gradient(top, rgb(57, 57, 57), rgb(75, 76, 76)); - } - - /* Add Album ------------------------------------------------*/ - .message.add { - width: 588px; - margin-top: -152px; - margin-left: -294px; - } - .add_album { - float: left; - display: inline-block; - width: 150px; - height: 200px; - margin: 30px 0px 30px 30px; - border-radius: 3px; - border: 3px dashed #777; - cursor: pointer; - text-align: center; - -webkit-transition: border .3s; - -moz-transition: border .3s; - -o-transition: border .3s; - transition: border .3s; - } - .add_album:hover { - border: 3px dashed #fff; - } - .add_album .icon { - margin-top: 55px; - color: #777; - font-family: 'FontAwesome'; - font-size: 80px; - text-shadow: 0px 1px 2px #000; - } - .add_album:hover .icon { - color: #fff; - } - .add_album a { - float: left; - width: 100%; - color: #777; - font-size: 14px; - font-weight: bold; - text-shadow: 0px 1px 0px #000; - } - .add_album:hover a { - color: #fff; - } - - /* Sign in ------------------------------------------------*/ - .sign_in { - float: left; - width: 100%; - margin-top: 1px; - padding: 5px 0px; - color: #eee; - font-size: 14px; - text-shadow: 0px -1px 0px #222; - line-height: 20px; - } - .sign_in input { - float: left; - width: 86%; - padding: 7px 2% 9px 2%; - margin: 0px 5%; - background-color: #444; - color: #fff; - text-shadow: 0px 1px 0px #222; - border: none; - border: 1px solid #111; - box-shadow: 0px 1px 0px #555; - outline: none; - border-radius: 5px; - } - .sign_in input:first-of-type { - margin-bottom: 10px; - } - .sign_in input:focus { - box-shadow: 0px 1px 0px #666, inset 0px 0px 3px #333, 0px 0px 5px #005ecc; - } - .sign_in input.error:focus { - box-shadow: 0px 1px 0px #666, inset 0px 0px 3px #333, 0px 0px 5px #cc0007; - } - .message #version { - display: inline-block; - margin-top: 23px; - margin-left: 5%; - color: #888; - text-shadow: 0px -1px 0px #111; - } - .message #version span { - display: none; - } - .message #version span a { - color: #888; - } - - /* Copy Link, Password ------------------------------------------------*/ - .message .copylink, .message .password { - float: left; - width: 95%; - padding: 7px 10px 9px 10px; - margin-top: 20px; - background-color: #444; - color: #fff; - text-shadow: 0px 1px 0px #222; - border: none; - border: 1px solid #111; - box-shadow: 0px 1px 0px #666, inset 0px 0px 3px #333, 0px 0px 5px #005ecc; - outline: none; - border-radius: 5px; - } - .message .copylink { - margin-bottom: 20px; - } - -/* Image View ------------------------------------------------*/ -#imageview { - position: fixed; - display: none; - width: 100%; - min-height: 100%; - background-color: rgba(30,30,30,.99); - box-shadow: 0px 2px 4px #000; - -webkit-transition: background-color .3s; -} -#imageview.full { - background-color: #111; -} - -#imageview #image { - position: absolute; - top: 70px; - right: 30px; - bottom: 30px; - left: 30px; - background-repeat: no-repeat; - background-position: 50% 50%; - background-size: contain; - -webkit-transition: top .3s, bottom .3s, margin-top .3s; - - -webkit-animation-name: zoomIn; - -webkit-animation-duration: .3s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: zoomIn; - -moz-animation-duration: .3s; - -moz-animation-fill-mode: forwards; - -o-animation-name: zoomIn; - -o-animation-duration: .3s; - -o-animation-fill-mode: forwards; - animation-name: zoomIn; - animation-duration: .3s; - animation-fill-mode: forwards; -} -#imageview #image.small { - top: 50%; - right: auto; - bottom: auto; - left: 50%; -} - - /* Previous/Next Buttons ------------------------------------------------*/ - #imageview a { - position: fixed; - top: 50%; - margin-top: -10px; - color: #fff; - font-size: 50px; - text-shadow: 0px 1px 2px #000; - cursor: pointer; - opacity: .1; - z-index: 1; - } - #imageview a:hover { - opacity: .9; - } - #imageview a#previous { - left: 20px; - -webkit-transition: left .3s; - } - #imageview.full a#previous { - left: -50px; - } - #imageview a#next { - right: 20px; - -webkit-transition: right .3s - } - #imageview.full a#next { - right: -50px; - } - - /* InfoBox ------------------------------------------------*/ - #infobox_overlay { - z-index: 2; - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - background-color: rgba(0,0,0,.7); - -webkit-animation-name: fadeIn; - -webkit-animation-duration: .5s; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: fadeIn; - -moz-animation-duration: .5s; - -moz-animation-fill-mode: forwards; - -o-animation-name: fadeIn; - -o-animation-duration: .5s; - -o-animation-fill-mode: forwards; - animation-name: fadeIn; - animation-duration: .5s; - animation-fill-mode: forwards; - } - #infobox { - z-index: 3; - position: fixed; - right: -320px; - width: 300px; - height: 100%; - background-color: rgba(20,20,20,0.98); - box-shadow: -1px 0px 2px #000; - display: none; - - -webkit-user-select: text; - -moz-user-select: text; - -o-user-select: text; - user-select: text; - - -webkit-transition: right .5s ease-out; - -moz-transition: right .5s; - -o-transition: right .5s; - transition: right .5s; - } - #infobox .wrapper { - float: left; - height: 100%; - overflow: scroll; - } - #infobox .header { - float: left; - height: 41px; - width: 100%; - - background-color: #1d1d1d; - background-image: -webkit-gradient(linear, left top, left bottom, from(#1d1d1d), to(#050505)); - background-image: -webkit-linear-gradient(top, #1d1d1d, #050505); - background-image: -moz-linear-gradient(top, #1d1d1d, #050505); - background-image: -o-linear-gradient(top, #1d1d1d, #050505); - background-image: -ms-linear-gradient(top, #1d1d1d, #050505); - background-image: linear-gradient(top, #1d1d1d, #050505); - - box-shadow: inset 0px 1px 0px #111, inset 0px -1px 0px #000; - border-top: 1px solid #000; - } - #infobox .header h1 { - position: absolute; - margin: 0px 30%; - width: 40%; - margin-top: 11px; - color: #fff; - font-size: 16px; - font-weight: bold; - text-align: center; - text-shadow: 0px -1px 0px #000; - } - #infobox .header a { - float: right; - padding: 10px 15px; - color: #fff; - font-size: 21px; - font-weight: bold; - text-shadow: 0px -1px 0px #000; - opacity: .5; - cursor: pointer; - } - #infobox .header a:hover { - opacity: 1; - } - #infobox .separater { - float: left; - width: 100%; - height: 27px; - - background-color: #2b2b2b; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(43, 43, 43)), to(rgb(35, 35, 35))); - background-image: -webkit-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -moz-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -o-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: -ms-linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - background-image: linear-gradient(top, rgb(43, 43, 43), rgb(35, 35, 35)); - - box-shadow: 0px 1px 0px #000, inset 0px 1px 0px rgba(255, 255, 255, .1); - } - #infobox .separater h1 { - margin: 5px 0px 0px 15px; - color: #fff; - font-size: 14px; - font-weight: bold; - text-shadow: 0px -1px 0px #000; - } - #infobox table { - float: left; - margin: 10px 0px 15px 15px; - } - #infobox table tr td { - padding: 5px 0px; - color: #fff; - font-size: 14px; - line-height: 19px; - } - #infobox table tr td:first-child { - width: 110px; - } - #infobox table tr td:last-child { - padding-right: 10px; - } - #infobox .bumper { - float: left; - width: 100%; - height: 35px; - } - #infobox #edit_title, - #infobox #edit_description { - display: inline; - margin-left: 3px; - width: 20px; - height: 5px; - cursor: pointer; - } - -/* ContextMenu ------------------------------------------------*/ -.contextmenu_bg { - position: fixed; - height: 100%; - width: 100%; - z-index: 1000; -} -.contextmenu { - position: fixed; - top: 110%; - left: 110%; - padding: 5px 0px; - background-color: #393939; - background-image: -webkit-gradient(linear, left top, left bottom, from(#393939), to(#2d2d2d)); - background-image: -webkit-linear-gradient(top, #444, #2d2d2d); - background-image: -moz-linear-gradient(top, #393939, #2d2d2d); - background-image: -o-linear-gradient(top, #393939, #2d2d2d); - background-image: -ms-linear-gradient(top, #393939, #2d2d2d); - background-image: linear-gradient(top, #393939, #2d2d2d); - border: 1px solid rgba(0,0,0,0.7); - border-bottom: 1px solid rgba(0,0,0,.9); - border-radius: 5px; - box-shadow: 0px 3px 5px rgba(0,0,0,0.4), inset 0px 1px 0px rgba(255,255,255,0.2), inset 1px 0px 0px rgba(255,255,255,0.05), inset -1px 0px 0px rgba(255,255,255,0.05); - opacity: .98; - z-index: 1001; -} - - /* Items ------------------------------------------------*/ - .contextmenu tr { - font-size: 14px; - color: #eee; - text-shadow: 0px -1px 0px rgba(0,0,0,.7); - cursor: pointer; - } - .contextmenu tr:hover { - background-color: #6a84f2; - background-image: -webkit-gradient(linear, left top, left bottom, from(#6a84f2), to(#3959ef)); - background-image: -webkit-linear-gradient(top, #6a84f2, #3959ef); - background-image: -moz-linear-gradient(top, #6a84f2, #3959ef); - background-image: -o-linear-gradient(top, #6a84f2, #3959ef); - background-image: -ms-linear-gradient(top, #6a84f2, #3959ef); - background-image: linear-gradient(top, #6a84f2, #3959ef); - } - .contextmenu tr.no_hover:hover { - cursor: inherit; - background-color: inherit; - background-image: none; - } - .contextmenu tr.separator { - float: left; - height: 1px; - width: 100%; - background-color: #222; - box-shadow: 0px 1px 0px #555; - margin: 4px 0px 5px 0px; - cursor: inherit; - } - .contextmenu tr.separator:hover { - background-color: #222; - background-image: none; - } - .contextmenu tr td { - padding: 5px 20px 5px 10px; - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; - } - .contextmenu tr:hover td { - color: #fff; - box-shadow: inset 0px 1px 0px rgba(255,255,255,.1); - text-shadow: 0px -1px 0px rgba(0,0,0,.7); - } - .contextmenu tr.no_hover:hover td { - box-shadow: none; - } - .contextmenu tr a { - float: left; - width: 10px; - margin-right: 10px; - text-align: center; - } - - /* Direct Link Input ------------------------------------------------*/ - .contextmenu #link { - float: right; - width: 140px; - margin: 0px -10px -1px 0px; - padding: 4px 6px 5px 6px; - background-color: #444; - color: #fff; - border: none; - border: 1px solid #111; - box-shadow: 0px 1px 0px rgba(255,255,255,.1); - outline: none; - border-radius: 5px; - } - .contextmenu tr a#link_icon { - padding-top: 4px; - } - -/* Upload ------------------------------------------------*/ -#upload { - display: none; -} -.upload_overlay { - position: fixed; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,.3); - background-image: -webkit-gradient(radial, 50% 50%,0,50% 50%,200, from(rgba(0, 0, 0, 0.85)), to(rgba(0, 0, 0, 0.50))); - background-image: -webkit-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -moz-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -o-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: -ms-radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - background-image: radial-gradient(50% 50%, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.85)); - z-index: 1000; -} -.upload_message { - position: absolute; - display: inline-block; - width: 200px; - margin-left: -100px; - margin-top: -85px; - background-color: #505050; - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(80, 80, 80)), to(rgb(43, 42, 42))); - background-image: -webkit-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -moz-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -o-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: -ms-linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - background-image: linear-gradient(top, rgb(80, 80, 80), rgb(43, 42, 42)); - border-radius: 5px; - border-bottom: 1px solid #000; - box-shadow: 0px 0px 5px #000, inset 0px 1px 0px rgba(255,255,255,.2), inset 1px 0px 0px rgba(255,255,255,.05), inset -1px 0px 0px rgba(255,255,255,.05); - - /* Animation */ - -webkit-animation-name: bounceInDown; - -webkit-animation-duration: 1s; - -webkit-animation-timing-function: ease-out; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: bounceInDown; - -moz-animation-duration: 1s; - -moz-animation-timing-function: ease-out; - -moz-animation-fill-mode: forwards; - -o-animation-name: bounceInDown; - -o-animation-duration: 1s; - -o-animation-timing-function: ease-out; - -o-animation-fill-mode: forwards; - animation-name: bounceInDown; - animation-duration: 1s; - animation-timing-function: ease-out; - animation-fill-mode: forwards; -} -.upload_message a { - float: left; - margin: 35px 69px 5px 69px; - color: #fff; - font-size: 80px; - text-shadow: 0px 1px 2px #000; - z-index: 2; - - /* Animation */ - -webkit-animation-name: pulse; - -webkit-animation-duration: 2s; - -webkit-animation-timing-function: ease-in-out; - -webkit-animation-iteration-count: infinite; - -moz-animation-name: pulse; - -moz-animation-duration: 2s; - -moz-animation-timing-function: ease-in-out; - -moz-animation-iteration-count: infinite; - -o-animation-name: pulse; - -o-animation-duration: 2s; - -o-animation-timing-function: ease-in-out; - -o-animation-iteration-count: infinite; - animation-name: pulse; - animation-duration: 2s; - animation-timing-function: ease-in-out; - animation-iteration-count: infinite; -} -.upload_message p { - float: left; - width: 200px; - margin: 10px 0px; - color: #fff; - font-size: 14px; - text-align: center; - text-shadow: 0px -1px 0px #000; -} -.upload_message .progressbar { - float: left; - width: 170px; - height: 25px; - margin: 15px; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), #101010; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), -webkit-linear-gradient(top, #101010, #1f1f1f); - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), -moz-linear-gradient(top, #101010, #1f1f1f); - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), -o-linear-gradient(top, #101010, #1f1f1f); - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), -ms-linear-gradient(top, #101010, #1f1f1f); - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZBAMAAABN41qcAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAAuIwAALiMBeKU/dgAABOBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuMS4yIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4xPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj41PC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4zMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjMwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNTwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxMi0wOS0yOFQxNDowOTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAyLjEuMTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KhsXwcAAAABJQTFRFAAAA////////////////////PlKtOgAAAAZ0Uk5TAAECAwQF749peAAAAF1JREFUGNNjYIAA11AICIDyGZigAqEGMBFWmAhMgMEUKhAEFwlFN4YZJqIAExGFCoTgNoYRpskBJsICExHAbQzMC4EYxhjgNkYVKhCM2xhiQgLTGCJCgpWckMAwBgAeZ0aFTqsxyQAAAABJRU5ErkJggg==), linear-gradient(top, #101010, #1f1f1f); - border: 1px solid #000; - box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0px 0px 2px #111; - border-radius: 5px; - - /* Animation */ - -webkit-animation-name: moveBackground; - -webkit-animation-duration: .6s; - -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: infinite; - -moz-animation-name: moveBackground; - -moz-animation-duration: .6s; - -moz-animation-timing-function: linear; - -moz-animation-iteration-count: infinite; - -o-animation-name: moveBackground; - -o-animation-duration: .6s; - -o-animation-timing-function: linear; - -o-animation-iteration-count: infinite; - animation-name: moveBackground; - animation-duration: .6s; - animation-timing-function: linear; - animation-iteration-count: infinite; -} -.upload_message .progressbar div { - float: left; - width: 0%; - height: 100%; - box-shadow: 0 1px 0 #000, 1px 0px 2px #000; - background-color: #f5f2f7; - background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f2f7), to(#c7c6c8)); - background-image: -webkit-linear-gradient(top, #f5f2f7, #c7c6c8); - background-image: -moz-linear-gradient(top, #f5f2f7, #c7c6c8); - background-image: -o-linear-gradient(top, #f5f2f7, #c7c6c8); - background-image: -ms-linear-gradient(top, #f5f2f7, #c7c6c8); - background-image: linear-gradient(top, #f5f2f7, #c7c6c8); - border-radius: 5px; - -webkit-transition: width .2s, opacity .5; - -moz-transition: width .2s, opacity .5; - -o-transition: width .2s, opacity .5; - transition: width .2s, opacity .5; -} - -/* Screen behavior -------------------------------------------------*/ -@media only screen and (max-width: 900px) { - - #title { margin: 0px 20%; width: 40%; } - #title.view { margin: 11px 20% 0px 20%; width: 60%; } - #title span { display: none; } - -} -@media only screen and (max-width: 640px) { - - #title { display: none; } - #title.view { display: block; margin: 11px 20% 0px 15%; width: 65%; } - #button_move { display: none; } - #button_archive { display: none; } - - .center { top: 0px; left: 0px; } - - .album { margin: 40px 0px 0px 50px; } - .photo { margin: 40px 0px 0px 50px; } - - .message { - position: fixed; - width: 100%; - height: 100%; - margin: 1px 0px 0px 0px !important; - border-radius: 0px; - - /* Animation */ - -webkit-animation-name: moveUp; - -webkit-animation-duration: .3s; - -moz-animation-name: moveUp; - -moz-animation-duration: .3s; - -o-animation-name: moveUp; - -o-animation-duration: .3s; - animation-name: moveUp; - animation-duration: .3s; - } - - .message.add { - width: 100%; - margin-top: 0px; - } - - .add_album { - width: 88%; - height: 100px; - margin: 30px 5% -10px 5%; - } - - .add_album .icon { - margin-top: 18px; - font-size: 50px; - } - -} \ No newline at end of file diff --git a/docs/assets/favicon.sketch/Data b/docs/assets/favicon.sketch/Data new file mode 100644 index 0000000..781092e Binary files /dev/null and b/docs/assets/favicon.sketch/Data differ diff --git a/docs/assets/favicon.sketch/QuickLook/Preview.png b/docs/assets/favicon.sketch/QuickLook/Preview.png new file mode 100644 index 0000000..8a59406 Binary files /dev/null and b/docs/assets/favicon.sketch/QuickLook/Preview.png differ diff --git a/docs/assets/favicon.sketch/QuickLook/Thumbnail.png b/docs/assets/favicon.sketch/QuickLook/Thumbnail.png new file mode 100644 index 0000000..bc37a48 Binary files /dev/null and b/docs/assets/favicon.sketch/QuickLook/Thumbnail.png differ diff --git a/docs/assets/favicon.sketch/fonts b/docs/assets/favicon.sketch/fonts new file mode 100644 index 0000000..2114530 --- /dev/null +++ b/docs/assets/favicon.sketch/fonts @@ -0,0 +1 @@ +Entypo \ No newline at end of file diff --git a/docs/assets/favicon.sketch/metadata b/docs/assets/favicon.sketch/metadata new file mode 100644 index 0000000..1491bff --- /dev/null +++ b/docs/assets/favicon.sketch/metadata @@ -0,0 +1,14 @@ + + + + + app + com.bohemiancoding.sketch + build + 5302 + commit + 9460a4bc62af5e9ba50dd4143578fd9401710ce5 + version + 18 + + diff --git a/docs/assets/favicon.sketch/version b/docs/assets/favicon.sketch/version new file mode 100644 index 0000000..25bf17f --- /dev/null +++ b/docs/assets/favicon.sketch/version @@ -0,0 +1 @@ +18 \ No newline at end of file diff --git a/docs/assets/thumbs.sketch/Data b/docs/assets/thumbs.sketch/Data new file mode 100644 index 0000000..5cb7328 Binary files /dev/null and b/docs/assets/thumbs.sketch/Data differ diff --git a/docs/assets/thumbs.sketch/QuickLook/Preview.png b/docs/assets/thumbs.sketch/QuickLook/Preview.png new file mode 100644 index 0000000..9dc91d0 Binary files /dev/null and b/docs/assets/thumbs.sketch/QuickLook/Preview.png differ diff --git a/docs/assets/thumbs.sketch/QuickLook/Thumbnail.png b/docs/assets/thumbs.sketch/QuickLook/Thumbnail.png new file mode 100644 index 0000000..ee7febe Binary files /dev/null and b/docs/assets/thumbs.sketch/QuickLook/Thumbnail.png differ diff --git a/docs/assets/thumbs.sketch/fonts b/docs/assets/thumbs.sketch/fonts new file mode 100644 index 0000000..e69de29 diff --git a/docs/assets/thumbs.sketch/metadata b/docs/assets/thumbs.sketch/metadata new file mode 100644 index 0000000..1491bff --- /dev/null +++ b/docs/assets/thumbs.sketch/metadata @@ -0,0 +1,14 @@ + + + + + app + com.bohemiancoding.sketch + build + 5302 + commit + 9460a4bc62af5e9ba50dd4143578fd9401710ce5 + version + 18 + + diff --git a/docs/assets/thumbs.sketch/version b/docs/assets/thumbs.sketch/version new file mode 100644 index 0000000..25bf17f --- /dev/null +++ b/docs/assets/thumbs.sketch/version @@ -0,0 +1 @@ +18 \ No newline at end of file diff --git a/docs/compile.sh b/docs/compile.sh new file mode 100644 index 0000000..5c30e6c --- /dev/null +++ b/docs/compile.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +folderCSS="../assets/css" +folderJS="../assets/js" + +if [ -e "$folderCSS/modules/" ] +then + + echo "Compiling CSS ..." + awk 'FNR==1{print ""}1' $folderCSS/modules/*.css > $folderCSS/min/main.css + csso $folderCSS/min/main.css $folderCSS/min/main.css + echo "CSS compiled!" + +else + + echo "CSS files not found in $folderCSS" + +fi + +if [ -e "$folderJS/modules/" ] +then + + echo "Compiling JS ..." + awk 'FNR==1{print ""}1' $folderJS/modules/*.js > $folderJS/min/main.js + uglifyjs $folderJS/min/main.js -o $folderJS/min/main.js + echo "JS compiled!" + +else + + echo "JS files not found in $folderJS" + +fi \ No newline at end of file diff --git a/docs/install.sh b/docs/install.sh new file mode 100644 index 0000000..f0ad8cc --- /dev/null +++ b/docs/install.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +VERSION='1.3.2' + +echo 'Press ENTER to continue or any other key to abort' +read -s -n 1 key + +if [[ "$key" = "" ]] +then + + if [ -e Lychee-$VERSION ] + then + + echo "The folder 'Lychee-$VERSION' already exists. Please delete it before you try to install Lychee." + exit 1 + + fi + + if [ -e lychee ] + then + + echo "The folder 'lychee' already exists. Please delete it before you try to install Lychee." + exit 1 + + fi + + echo 'Downloading and installing Lychee...' && \ + curl -sS https://codeload.github.com/electerious/Lychee/zip/v$VERSION > lychee.zip && \ + echo 'Downloaded.' && \ + echo 'Unzipping...' && \ + unzip lychee.zip && \ + rm lychee.zip && \ + mv Lychee-$VERSION lychee && \ + cd lychee && \ + echo 'The required directories will be made writable and executable for others. Please enter your password if prompted to do so.' && \ + sudo chmod -R 777 uploads php && \ + echo 'Installation successful!' && \ + exit 0 + +fi \ No newline at end of file diff --git a/docs/md/Changelog.md b/docs/md/Changelog.md new file mode 100644 index 0000000..b36ea12 --- /dev/null +++ b/docs/md/Changelog.md @@ -0,0 +1,16 @@ +### v2.0 +- All new redefined interface +- Faster animations and transitions +- Import from Dropbox +- Import from Server +- Download public albums +- Several sorting options +- Installation assistent +- Infobox and description for albums +- Faster loading and improved performance +- Better file handling and upload +- Album covers are chosen intelligent +- Prettier URLs +- Massive changes under the hood +- IPTC support (Headline and Caption) +- EXIF Orientation support \ No newline at end of file diff --git a/docs/md/FAQ.md b/docs/md/FAQ.md new file mode 100644 index 0000000..e5df297 --- /dev/null +++ b/docs/md/FAQ.md @@ -0,0 +1,44 @@ +#### Lychee is not working +If Lychee is not working properly, try to open `plugins/check.php`. This script will display all errors it can find. Everything should work if you can see the message "Lychee is ready. Lets rock!". + +#### What do I need to run Lychee on my server? +To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. + +#### I can't upload multiple photos at once +If you experience problems uploading large amounts of photos, you might want to change the PHP parameters in `.htaccess` (if you are using the PHP Apache module) or in `.user.ini` (if you are using PHP >= 5.3 with CGI or FastCGI). +If possible, change these settings directly in your `php.ini`. We recommend to increase the values of the following properties: + + max_execution_time = 200 + post_max_size = 200M + upload_max_size = 200M + upload_max_filesize = 20M + max_file_uploads = 100 + +#### Which browsers are supported? +Lychee supports the latest versions of Google Chrome, Apple Safari, Mozilla Firefox and Opera. Photos you share with others can be viewed from every browser. + +#### How can I set thumbnails for my albums? +Thumbnails are choosen automatically by the photos you have starred and in the order you uploaded them. Star a photo inside a album to set it as an thumbnail. + +#### What is new? +Take a look at the [Changelog](Changelog.md) to see whats new. + +#### How can I backup my installation? +To backup your Lychee installation you need to do the following steps: + +1. Create a copy of the whole Lychee folder +2. Run the following MySQL Queries: + - CREATE TABLE lychee_albums_backup LIKE lychee_albums; + - INSERT INTO lychee_albums_backup SELECT * FROM lychee_albums; + - CREATE TABLE lychee_photos_backup LIKE lychee_photos; + - INSERT INTO lychee_photos_backup SELECT * FROM lychee_photos; + - CREATE TABLE lychee_settings_backup LIKE lychee_settings; + - INSERT INTO lychee_settings_backup SELECT * FROM lychee_settings; + +#### How to update? + +1. Replace all files, excluding `uploads/` +2. Open Lychee and enter your database details + +#### Can I upload videos? +No. Video support is not planned. \ No newline at end of file diff --git a/docs/md/FTP Upload.md b/docs/md/FTP Upload.md new file mode 100644 index 0000000..ca8a70d --- /dev/null +++ b/docs/md/FTP Upload.md @@ -0,0 +1,13 @@ +### Import from server + +To import photos from your server (photos you have uploaded via FTP to your server), sign in and click the add-icon on the top right. Then choose 'Import from Server'. + +### Upload and share single photos + +You can upload photos directly with every FTP client into Lychee. This feature helps you to share single images quickly with others. + +1. Upload an image to `uploads/import/` +2. Navigate your browser to the place where Lychee is located (e.g. `http://example.com/view.php?p=filename.png`). `filename.png` must be replaced with the filename of your uploaded file. +3. Share the link. + +Lychee will import the file as an public image, delete the original (unused) file and display it in the browser. [Sample FTP configuration](http://l.electerious.com/view.php?p=13657692738813). \ No newline at end of file diff --git a/docs/md/Installation.md b/docs/md/Installation.md new file mode 100644 index 0000000..50bac52 --- /dev/null +++ b/docs/md/Installation.md @@ -0,0 +1,29 @@ +### Requirements +Everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. + +### PHP configuration `php.ini` + +The following extensions must be activated: + + extension = php_mbstring.dll + extension = php_exif.dll + extension = php_gd2.dll + +To use Lychee without restrictions, we recommend to increase the values of the following properties: + + max_execution_time = 200 + post_max_size = 200M + upload_max_size = 200M + upload_max_filesize = 20M + max_file_uploads = 100 + +### Folder permissions + +Change the permissions of `uploads/` and `php/` to 777, including all subfolders: + + chmod -R 777 uploads/ php/ + +### Lychee installation + +Open Lychee in your browser and follow the given steps. +If you have trouble, take a look at the [FAQ](FAQ.md). \ No newline at end of file diff --git a/docs/md/Keyboard Shortcuts.md b/docs/md/Keyboard Shortcuts.md new file mode 100644 index 0000000..a4ea4c7 --- /dev/null +++ b/docs/md/Keyboard Shortcuts.md @@ -0,0 +1,17 @@ +### Everywhere +| Key | Action | +|:-----------|:------------| +| `enter` | Confirm Dialog | +| `u` | Upload photo | +| `esc` | Close/Back | +| `cmd`+`up` | Close/Back | + +### Photoview +| Key | Action | +|:-----------|:------------| +| `s` | Star photo | +| `i` | Show information | +| `f` | Show photo in new tab +| `cmd`+`backspace` | Delete photo +| `left` | Previous photo +| `right` | Next photo \ No newline at end of file diff --git a/docs/md/Settings.md b/docs/md/Settings.md new file mode 100644 index 0000000..de49d2d --- /dev/null +++ b/docs/md/Settings.md @@ -0,0 +1,41 @@ +### Database Details + +Your MySQL details are stored in `php/config.php`. This file doesn't exist until you installed Lychee. If you need to change your connection details, you can edit this file manually. + + + + $dbHost = Your MySQL host (in most cases you can use localhost) + $dbUser = Your MySQL username + $dbPassword = Your MySQL password + $dbName = The name of the database you want to use + +Fill these properties with your MySQL information. Lychee will create the database and tables for you, if they doesn't exist. + +### Settings + +All settings are stored in the database. You can change the properties manually, but we recommend to use the menu in Lychee. You can find this menu on the top left corner after you signed in. + +#### Login + + username = Username for Lychee + password = Password for Lychee, saved as an md5 hash + +Your photos and albums are protected by a username and password you need to set. If both rows are empty, Lychee will prompt you to set them. + +#### Thumb Quality + + thumbQuality = [0-100] + +Less means a inferiority quality of your thumbs, but faster loading. More means a better quality of your thumbs, but slower loading. The default value is 90. The allowed values are between 0 and 100. + +#### Check For Updates + + checkForUpdates = [0|1] + +If `1`, Lychee will check if you are using the latest version. The notice will be displayed beside the version-number when you sign in. + +#### Sorting + + sorting = ORDER BY [row] [ASC|DESC] + +A typical part of an MySQL statement. This string will be appended to mostly every MySQL query. \ No newline at end of file diff --git a/img/apple-touch-icon.png b/img/apple-touch-icon.png deleted file mode 100755 index bd3b738..0000000 Binary files a/img/apple-touch-icon.png and /dev/null differ diff --git a/img/background.jpg b/img/background.jpg deleted file mode 100755 index e19d372..0000000 Binary files a/img/background.jpg and /dev/null differ diff --git a/img/bar/error.png b/img/bar/error.png deleted file mode 100755 index ea61be0..0000000 Binary files a/img/bar/error.png and /dev/null differ diff --git a/img/bar/loading.png b/img/bar/loading.png deleted file mode 100755 index e84a7d8..0000000 Binary files a/img/bar/loading.png and /dev/null differ diff --git a/img/checks.png b/img/checks.png deleted file mode 100755 index 8556378..0000000 Binary files a/img/checks.png and /dev/null differ diff --git a/img/favicon.png b/img/favicon.png deleted file mode 100755 index de8b675..0000000 Binary files a/img/favicon.png and /dev/null differ diff --git a/img/no_images.png b/img/no_images.png deleted file mode 100755 index 37833d4..0000000 Binary files a/img/no_images.png and /dev/null differ diff --git a/img/no_images@2x.png b/img/no_images@2x.png deleted file mode 100755 index 15bef9f..0000000 Binary files a/img/no_images@2x.png and /dev/null differ diff --git a/img/password.png b/img/password.png deleted file mode 100755 index 4d47bec..0000000 Binary files a/img/password.png and /dev/null differ diff --git a/img/password@2x.png b/img/password@2x.png deleted file mode 100755 index bde12a8..0000000 Binary files a/img/password@2x.png and /dev/null differ diff --git a/index.html b/index.html index f123005..1fe1fff 100644 --- a/index.html +++ b/index.html @@ -5,16 +5,35 @@ Lychee - + - - - - + + + + + + + + + + + - @@ -30,30 +49,30 @@
- Back - + +
-
+
- Back +
-
-
- +
+
- +
@@ -74,31 +93,30 @@
-
-
- + + + + + + + + + + + + + + + + --> - - - + \ No newline at end of file diff --git a/js/functions.js b/js/functions.js deleted file mode 100644 index f22d3bd..0000000 --- a/js/functions.js +++ /dev/null @@ -1 +0,0 @@ -album={json:null,getID:function(){var e;if(photo.json)e=photo.json.album;else if(album.json)e=album.json.id;else e=$(".album:hover, .album.active").attr("data-id");if(!e)e=$(".photo:hover, .photo.active").attr("data-album-id");if(e)return e;else return false},load:function(e,t){var n,r,i,s,o="";password.get(e,function(){if(!t){loadingBar.show();lychee.animate(".album, .photo","contentZoomOut");lychee.animate(".divider","fadeOut")}n=(new Date).getTime();r="getAlbum&albumID="+e+"&password="+password.value;lychee.api(r,"json",function(r){if(r=="HTTP/1.1 403 Album private!"){lychee.setMode("view");return false}if(r=="HTTP/1.1 403 Wrong password!"){album.load(e,t);return false}album.json=r;i=(new Date).getTime()-n;if(i>300)s=0;else if(t)s=0;else s=300-i;if(!visible.albums()&&!visible.photo()&&!visible.album())s=0;setTimeout(function(){view.album.init();if(!t){lychee.animate(".album, .photo","contentZoomIn");view.header.mode("album")}},s)})})},parse:function(e){if(e&&e.thumbUrl)e.thumbUrl=lychee.upload_path_thumb+e.thumbUrl;else if(!album.json.title)album.json.title="Untitled"},add:function(){var e=prompt("Please enter a title for this album:","Untitled"),t;if(e.length>0&&e.length<31){modal.close();t="addAlbum&title="+escape(encodeURI(e));lychee.api(t,"text",function(e){if(e)lychee.goto("a"+e);else loadingBar.show("error")})}else if(e.length>0)loadingBar.show("error","Error","Title to short or too long. Please try another one!")},"delete":function(e){var t,n,r;n=[["Delete Album and Photos",function(){t="deleteAlbum&albumID="+e+"&delAll=true";lychee.api(t,"text",function(t){if(visible.albums())view.albums.content.delete(e);else lychee.goto("");if(!t)loadingBar.show("error")})}],["Keep Album",function(){}]];if(e==0){n[0][0]="Clear Unsorted";modal.show("Clear Unsorted","Are you sure you want to delete all photos from 'Unsorted'?
This action can't be undone!",n)}else{if(album.json)r=album.json.title;else if(albums.json)r=albums.json.content[e].title;modal.show("Delete Album","Are you sure you want to delete the album '"+r+"' and all of the photos it contains? This action can't be undone!",n)}},setTitle:function(e){var t="",n,r;if(!e)e=album.getID();if(album.json)t=album.json.title;else if(albums.json)t=albums.json.content[e].title;n=prompt("Please enter a new title for this album:",t);if(e!=""&&e!=null&&e&&n.length>0&&n.length<31){if(visible.album()){album.json.title=n;view.album.title()}else if(visible.albums()){albums.json.content[e].title=n;view.albums.content.title(e)}r="setAlbumTitle&albumID="+e+"&title="+escape(encodeURI(n));lychee.api(r,"text",function(e){if(!e)loadingBar.show("error")})}else if(n.length>0)loadingBar.show("error","Error","New title to short or too long. Please try another one!")},setPublic:function(e,t){var n;if($("input.password").length>0&&$("input.password").val().length>0){n="setAlbumPublic&albumID="+e+"&password="+hex_md5($("input.password").val());album.json.password=true}else{n="setAlbumPublic&albumID="+e;album.json.password=false}if(visible.album()){album.json.public=album.json.public==0?1:0;view.album.public();if(album.json.public==1)contextMenu.shareAlbum(e,t)}lychee.api(n,"text",function(e){if(!e)loadingBar.show("error")})},share:function(e){var t="",n=location.href;switch(e){case 0:t="https://twitter.com/share?url="+encodeURI(n);break;case 1:t="http://www.facebook.com/sharer.php?u="+encodeURI(n)+"&t="+encodeURI(album.json.title);break;case 2:t="mailto:?subject="+encodeURI(album.json.title)+"&body="+encodeURI("Hi! Check this out: "+n);break;default:t="";break}if(t.length>5)location.href=t},getArchive:function(e){var t;if(location.href.indexOf("index.html")>0)t=location.href.replace(location.hash,"").replace("index.html","php/api.php?function=getAlbumArchive&albumID="+e);else t=location.href.replace(location.hash,"")+"php/api.php?function=getAlbumArchive&albumID="+e;location.href=t}};albums={json:null,load:function(){var e,t,n,r,i,s="",o="";lychee.animate(".album, .photo","contentZoomOut");lychee.animate(".divider","fadeOut");e=(new Date).getTime();lychee.api("getAlbums","json",function(n){n.unsortedAlbum={id:0,title:"Unsorted",sysdate:n.unsortedNum+" photos",unsorted:1,thumb0:n.unsortedThumb0,thumb1:n.unsortedThumb1,thumb2:n.unsortedThumb2};n.starredAlbum={id:"f",title:"Starred",sysdate:n.starredNum+" photos",star:1,thumb0:n.starredThumb0,thumb1:n.starredThumb1,thumb2:n.starredThumb2};n.publicAlbum={id:"s",title:"Public",sysdate:n.publicNum+" photos","public":1,thumb0:n.publicThumb0,thumb1:n.publicThumb1,thumb2:n.publicThumb2};albums.json=n;t=(new Date).getTime()-e;if(t>300)waitTime=0;else waitTime=300-t;if(!visible.albums()&&!visible.photo()&&!visible.album())waitTime=0;setTimeout(function(){view.header.mode("albums");view.albums.init();lychee.animate(".album, .photo","contentZoomIn")},waitTime)})},parse:function(e){if(e.password&&lychee.publicMode){e.thumb0="img/password.png";e.thumb1="img/password.png";e.thumb2="img/password.png"}else{if(e.thumb0)e.thumb0=lychee.upload_path_thumb+e.thumb0;else e.thumb0="img/no_images.png";if(e.thumb1)e.thumb1=lychee.upload_path_thumb+e.thumb1;else e.thumb1="img/no_images.png";if(e.thumb2)e.thumb2=lychee.upload_path_thumb+e.thumb2;else e.thumb2="img/no_images.png"}}};build={divider:function(e){return"

"+e+"

"},album:function(e){if(!e)return"";var t="";title=e.title;if(title.length>18)title=e.title.substr(0,18)+"...";t+="
";t+="thumb";t+="thumb";t+="thumb";t+="
";if(e.password&&!lychee.publicMode)t+="

"+title+"

";else t+="

"+title+"

";t+=""+e.sysdate+"";t+="
";if(!lychee.publicMode&&e.star==1)t+="";if(!lychee.publicMode&&e.public==1)t+="";if(!lychee.publicMode&&e.unsorted==1)t+="";t+="
";return t},photo:function(e){if(!e)return"";var t="",n=e.title;if(n.length>18)n=e.title.substr(0,18)+"...";t+="
";t+="thumb";t+="
";t+="

"+n+"

";t+=""+e.sysdate+"";t+="
";if(e.star==1)t+="";if(!lychee.publicMode&&e.public==1&&album.json.public!=1)t+="";t+="
";return t},no_content:function(e){var t="";t+="
";t+="";if(e=="search")t+="

No results

";else if(e=="picture")t+="

No public albums

";t+="
";return t},modal:function(e,t,n){var r="";r+="
";r+="
";r+="

"+e+"

";r+="";r+="

"+t+"

";$.each(n,function(e){if(this[0]!=""){if(e==0)r+=""+this[0]+"";else r+=""+this[0]+""}});r+="
";r+="
";return r},addModal:function(){var e="";e+="
";e+="
";e+="

Add Album or Photo

";e+="";e+="
";e+="
";e+="New Album";e+="
";e+="";e+="
";e+="
";e+="Upload Photo";e+="
";e+="
";e+="
";return e},signInModal:function(){var e="";e+="
";e+="
";e+="

Sign In

";e+="";e+="
Version "+lychee.version+"Update available!
";e+="Sign in";e+="
";e+="
";return e},uploadModal:function(){var e="";e+="
";e+="
";e+="";e+="
";e+="
";e+="
";return e},contextMenu:function(e){var t="";t+="
";t+="
";t+="";t+="";$.each(e,function(n){if(e[n][0]=="separator"&&e[n][1]==-1)t+="";else if(e[n][1]==-1)t+="";else if(e[n][2]!=undefined)t+="";else t+=""});t+="";t+="
"+e[n][0]+"
"+e[n][0]+"
"+e[n][0]+"
";t+="
";return t},infobox:function(e,t){if(!e)return"";var n="",r,i,s,o;n+="

About

";n+="
";switch(e.public){case"0":r="Private";break;case"1":r="Public";break;case"2":r="Public (Album)";break;default:r="-";break}i=t==true||lychee.publicMode?"":"
";s=t==true||lychee.publicMode?"":"
";o=[["","Basics"],["Name",e.title+i],["Uploaded",e.sysdate],["Description",e.description+s],["","Image"],["Size",e.size],["Format",e.type],["Resolution",e.width+" x "+e.height],["","Camera"],["Captured",e.takedate],["Make",e.make],["Type/Model",e.model],["Shutter Speed",e.shutter],["Aperture",e.aperture],["Focal Length",e.focal],["ISO",e.iso],["","Share"],["Visibility",r]];$.each(o,function(e){if(o[e][1]==""||o[e][1]==undefined||o[e][1]==null)o[e][1]="-";if(o[e][0]==""){n+="";n+="

"+o[e][1]+"

";n+=""}else{n+="";n+="";n+="";n+=""}});n+="
"+o[e][0]+""+o[e][1]+"
";n+="
";n+="
";return n}};contextMenu={fns:null,album:function(e){e.preventDefault();var t=e.pageX,n=e.pageY,r=album.getID(),i;if(r=="0"||r=="f"||r=="s")return false;n-=$(document).scrollTop();contextMenu.fns=[function(){album.setTitle(r)},function(){album.delete(r)}];i=[[" Rename",0],[" Delete",1]];contextMenu.close();$(".album[data-id='"+r+"']").addClass("active");$("body").css("overflow","hidden").append(build.contextMenu(i));$(".contextmenu").css({top:n,left:t})},photo:function(e){e.preventDefault();var t=e.pageX,n=e.pageY,r=photo.getID(),i;n-=$(document).scrollTop();contextMenu.fns=[function(){photo.setStar(r)},function(){photo.setTitle(r)},function(){contextMenu.move(r,e)},function(){photo.delete(r)}];i=[[" Star",0],["separator",-1],[" Rename",1],[" Move",2],[" Delete",3]];contextMenu.close();$(".photo[data-id='"+r+"']").addClass("active");$("body").css("overflow","hidden").append(build.contextMenu(i));$(".contextmenu").css({top:n,left:t})},move:function(e,t){var n=t.pageX,r=t.pageY,i=[],s;contextMenu.fns=[];r-=$(document).scrollTop();if(!n||!r){n="10px";r="10px"}if(album.getID()!=0){i=[["Unsorted",0,"photo.setAlbum(0, "+e+")"],["separator",-1]]}lychee.api("getAlbums","json",function(t){if(!t.albums){i=[["New Album",0,"album.add()"]]}else{$.each(t.content,function(t){if(this.id!=album.getID())i.push([this.title,0,"photo.setAlbum("+this.id+", "+e+")"])})}contextMenu.close();$(".photo[data-id='"+e+"']").addClass("active");$("body").css("overflow","hidden").append(build.contextMenu(i));if(!visible.photo())n+=$(".contextmenu").width();$(".contextmenu").css({top:r,left:n-$(".contextmenu").width()})})},sharePhoto:function(e,t){var n=t.pageX,r=t.pageY,i;r-=$(document).scrollTop();if(!n||!r){n="10px";r="10px"}contextMenu.fns=[function(){photo.setPublic(e)},function(){photo.share(e,0)},function(){photo.share(e,1)},function(){photo.share(e,2)},function(){photo.share(e,3)}];if(document.location.hostname!="localhost"){i=[["",-1],["separator",-1],[" Make Private",0],["separator",-1],[" Twitter",1],[" Facebook",2],[" Mail",3],[" Dropbox",4]]}else{i=[["",-1],["separator",-1],[" Make Private",0],["separator",-1],[" Mail",3]]}contextMenu.close();$("body").css("overflow","hidden").append(build.contextMenu(i));$(".contextmenu").css({top:r,left:n+20-$(".contextmenu").width()});$(".contextmenu input").focus()},shareAlbum:function(e,t){var n=t.pageX,r=t.pageY,i;r-=$(document).scrollTop();if(!n||!r){n="10px";r="10px"}contextMenu.fns=[function(){album.setPublic(e)},function(){password.set(e)},function(){album.share(0)},function(){album.share(1)},function(){album.share(2)},function(){password.remove(e)}];if(document.location.hostname!="localhost"){i=[["",-1],["separator",-1],[" Make Private",0],[" Set Password",1],["separator",-1],[" Twitter",2],[" Facebook",3],[" Mail",4]]}else{i=[["",-1],["separator",-1],[" Make Private",0],[" Set Password",1],["separator",-1],[" Mail",4]]}if(album.json.password==true)i[3]=[" Remove Password",5];contextMenu.close();$("body").css("overflow","hidden").append(build.contextMenu(i));$(".contextmenu").css({top:r,left:n+20-$(".contextmenu").width()});$(".contextmenu input").focus()},close:function(){contextMenu.js=null;$(".contextmenu_bg, .contextmenu").remove();$(".photo.active, .album.active").removeClass("active");$("body").css("overflow","scroll")}};loadingBar={status:null,show:function(e,t,n){if(e=="error"){loadingBar.status="error";if(!t)t="Error";if(!n)n="Whoops, it looks like something went wrong. Please reload the site and try again!";lychee.loadingBar.removeClass("loading uploading error").addClass(e).html("

"+t+": "+n+"

").show().css("height","40px");if(visible.controls())lychee.header.css("margin-Top","40px");clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.data("timeout",setTimeout(function(){loadingBar.hide(true)},3e3))}else if(loadingBar.status==null){loadingBar.status="loading";clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.data("timeout",setTimeout(function(){lychee.loadingBar.show().removeClass("loading uploading error").addClass("loading");if(visible.controls())lychee.header.css("margin-Top","3px")},1e3))}},hide:function(e){if(loadingBar.status!="error"&&loadingBar.status!=null||e){loadingBar.status=null;clearTimeout(lychee.loadingBar.data("timeout"));lychee.loadingBar.html("").css("height","3px");if(visible.controls())lychee.header.css("marginTop","0px");setTimeout(function(){lychee.loadingBar.hide()},300)}}};var lychee={init:function(){this.version="1.3.2";this.api_path="php/api.php";this.update_path="http://lychee.electerious.com/version/index.php";this.updateURL="https://github.com/electerious/Lychee";this.upload_path_thumb="uploads/thumb/";this.upload_path_big="uploads/big/";this.publicMode=false;this.viewMode=false;this.checkForUpdates=false;this.dropbox=false;this.loadingBar=$("#loading");this.header=$("header");this.content=$("#content");this.imageview=$("#imageview");this.infobox=$("#infobox")},run:function(){lychee.api("init","json",function(e){lychee.checkForUpdates=e.config.checkForUpdates;if(!e.loggedIn)lychee.setMode("public");$(window).bind("popstate",lychee.load);lychee.load()})},api:function(e,t,n,r){if(r==undefined)loadingBar.show();$.ajax({type:"POST",url:lychee.api_path,data:"function="+e,dataType:t,success:function(e){setTimeout(function(){loadingBar.hide()},100);n(e)},error:lychee.error})},login:function(){var e=$("input#username").val(),t=hex_md5($("input#password").val()),n;n="login&user="+e+"&password="+t;lychee.api(n,"text",function(t){if(t){localStorage.setItem("username",e);window.location.reload()}else{$("#password").val("").addClass("error");$(".message .button.active").removeClass("pressed")}})},loginDialog:function(){$("body").append(build.signInModal());$("#username").focus();if(localStorage){local_username=localStorage.getItem("username");if(local_username!=null){if(local_username.length>0)$("#username").val(local_username);$("#password").focus()}}if(lychee.checkForUpdates)lychee.getUpdate()},logout:function(){lychee.api("logout","text",function(e){window.location.reload()})},"goto":function(e){if(e==undefined)e="";document.location.hash=e},load:function(){var e="",t="",n=document.location.hash.replace("#","");contextMenu.close();if(n.indexOf("a")!=-1)e=n.split("p")[0].replace("a","");if(n.indexOf("p")!=-1)t=n.split("p")[1];if(e&&t){albums.json=null;photo.json=null;if(lychee.content.html()==""||$("#search").length&&$("#search").val().length!=0){lychee.content.hide();album.load(e,true)}if(!visible.photo())view.photo.show();photo.load(t,e)}else if(e){albums.json=null;photo.json=null;if(visible.photo())view.photo.hide();if(album.json&&e==album.json.id)view.album.title();else album.load(e)}else{albums.json=null;album.json=null;photo.json=null;search.code="";if(visible.photo())view.photo.hide();albums.load()}},getUpdate:function(){$.ajax({url:lychee.update_path,success:function(e){if(e!=lychee.version)$("#version span").show()}})},setTitle:function(e,t,n){if(e=="Albums")document.title="Lychee";else document.title="Lychee - "+e;if(t)e+=" - "+t+" photos";if(n)$("#title").addClass("editable");else $("#title").removeClass("editable");$("#title").html(e)},setMode:function(e){$("#button_signout, #search, #button_trash_album, #button_share_album, #button_edit_album, .button_add, #button_archive, .button_divider").remove();$("#button_trash, #button_move, #button_edit, #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("n").unbind("u").unbind("s").unbind("backspace");if(e=="public"){$("#button_signin").show();lychee.publicMode=true}else if(e=="view"){Mousetrap.unbind("esc");$("#button_back, a#next, a#previous").remove();lychee.publicMode=true;lychee.viewMode=true}},animate:function(e,t){var n=[["fadeIn","fadeOut"],["contentZoomIn","contentZoomOut"]];if(!e.jQuery)e=$(e);for(var r=0;r",t)},get:function(e,t){var n=$("input.password").val(),r;if(!lychee.publicMode)t();else if(album.json&&album.json.password==false)t();else if(albums.json&&albums.json.content[e].password==false)t();else if(!albums.json&&!album.json){album.json={password:true};t("")}else if(n==undefined){password.getDialog(e,t)}else{r="checkAlbumAccess&albumID="+e+"&password="+hex_md5(n);lychee.api(r,"text",function(e){if(e){password.value=hex_md5(n);t()}else{lychee.goto("");loadingBar.show("error","Error","Access denied. Wrong password!")}})}},getDialog:function(e,t){var n;n=[["Enter",function(){password.get(e,t)}],["Cancel",lychee.goto]];modal.show(" Enter Password","This album is protected with a password. Enter the password below to view the photos of this album: ",n)},remove:function(e){var t;if(visible.album())album.json.password=false;t="setAlbumPassword&albumID="+e+"&password=";lychee.api(t,"text",function(e){if(!e)loadingBar.show("error")})}};photo={json:null,getID:function(){var e;if(photo.json)e=photo.json.id;else e=$(".photo:hover, .photo.active").attr("data-id");if(e)return e;else return false},load:function(e,t){var n,r;n="getPhoto&photoID="+e+"&albumID="+t+"&password="+password.value;lychee.api(n,"json",function(n){if(n=="HTTP/1.1 403 Wrong password!"){r=function(){if(password.value!="")photo.load(e,t);else setTimeout(r,250)};r();return false}photo.json=n;view.photo.init();lychee.imageview.show();setTimeout(function(){lychee.content.show()},300)})},parse:function(){if(!photo.json.title)photo.json.title="Untitled";photo.json.url=lychee.upload_path_big+photo.json.url},add:{files:function(e){var t=0,n=new FormData,r=new XMLHttpRequest,i,s;$(".upload_overlay").remove();$("body").append(build.uploadModal());window.onbeforeunload=function(){return"Lychee is currently uploading!"};for(var o=0;ot){$(".progressbar div").css("width",s+"%");t=s}if(s>=100)$(".progressbar div").css("opacity",.2)}};$("#upload_files").val("");r.send(n)},url:function(e){var t=album.getID();if(!e)e=prompt("Please enter the direct link to a photo to import it:","");if(album.getID()=="")t=0;if(e&&e.length>3){modal.close();$(".upload_overlay").remove();$("body").append(build.uploadModal());$(".progressbar div").css({opacity:.2,width:"100%"});params="importUrl&url="+escape(e)+"&albumID="+t;lychee.api(params,"text",function(e){$(".upload_overlay").removeClass("fadeIn").css("opacity",0);setTimeout(function(){$(".upload_overlay").remove()},300);if(e){if(album.getID()=="")lychee.goto("a0");else album.load(album.getID())}else loadingBar.show("error")})}else if(e.length>0)loadingBar.show("error","Error","Link to short or too long. Please try another one!")},dropbox:function(){lychee.loadDropbox(function(){Dropbox.choose({linkType:"direct",multiselect:false,success:function(e){photo.add.url(e[0].link)}})})}},"delete":function(e){var t,n,r;if(!e)e=photo.getID();if(visible.photo())r=photo.json.title;else r=album.json.content[e].title;if(r=="")r="Untitled";n=[["Delete Photo",function(){album.json.content[e]=null;view.album.content.delete(e);if(!visible.albums())lychee.goto("a"+album.getID());t="deletePhoto&photoID="+e;lychee.api(t,"text",function(e){if(!e)loadingBar.show("error")})}],["Keep Photo",function(){}]];modal.show("Delete Photo","Are you sure you want to delete the photo '"+r+"'?
This action can't be undone!",n)},setTitle:function(e){var t="",n,r;if(!e)e=photo.getID();if(photo.json)t=photo.json.title;else if(album.json)t=album.json.content[e].title;n=prompt("Please enter a new title for this photo:",t);if(e!=null&&e&&n.length<31){if(visible.photo()){photo.json.title=n==""?"Untitled":n;view.photo.title(t)}album.json.content[e].title=n;view.album.content.title(e);r="setPhotoTitle&photoID="+e+"&title="+escape(encodeURI(n));lychee.api(r,"text",function(e){if(!e)loadingBar.show("error")})}else if(n.length>0)loadingBar.show("error","Error","New title to short or too long. Please try another one!")},setAlbum:function(e,t){var n;if(e>=0){if(visible.photo)lychee.goto("a"+album.getID());album.json.content[t]=null;view.album.content.delete(t);n="setAlbum&photoID="+t+"&albumID="+e;lychee.api(n,"text",function(e){if(!e)loadingBar.show("error")})}},setStar:function(e){var t;if(visible.photo()){photo.json.star=photo.json.star==0?1:0;view.photo.star()}album.json.content[e].star=album.json.content[e].star==0?1:0;view.album.content.star(e);t="setPhotoStar&photoID="+e;lychee.api(t,"text",function(e){if(!e)loadingBar.show("error")})},setPublic:function(e,t){var n;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("a"+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(e,t)}album.json.content[e].public=album.json.content[e].public==0?1:0;view.album.content.public(e);n="setPhotoPublic&photoID="+e+"&url="+photo.getViewLink(e);lychee.api(n,"text",function(e){if(!e)loadingBar.show("error")})},setDescription:function(e){var t=photo.json.description,n=prompt("Please enter a description for this photo:",t),r;if(n.length>0&&n.length<160){if(visible.photo()){photo.json.description=n;view.photo.description(t)}r="setPhotoDescription&photoID="+e+"&description="+escape(n);lychee.api(r,"text",function(e){if(!e)loadingBar.show("error")})}else if(n.length>0)loadingBar.show("error","Error","Description to short or too long. Please try another one!")},share:function(e,t){var n="",r=photo.getViewLink(e),i,s="unknown";switch(t){case 0:n="https://twitter.com/share?url="+encodeURI(r);break;case 1:n="http://www.facebook.com/sharer.php?u="+encodeURI(r)+"&t="+encodeURI(photo.json.title);break;case 2:n="mailto:?subject="+encodeURI(photo.json.title)+"&body="+encodeURI(r);break;case 3:lychee.loadDropbox(function(){s=photo.json.title+"."+photo.getDirectLink().split(".").pop();Dropbox.save(photo.getDirectLink(),s)});break;default:n="";break}if(n.length>5)location.href=n},isSmall:function(){var e=[["width",false],["height",false]];if(photo.json.width<$(window).width()-60)e["width"]=true;if(photo.json.height<$(window).height()-100)e["height"]=true;if(e["width"]&&e["height"])return true;else return false},getDirectLink:function(){return $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig,"")},getViewLink:function(e){if(location.href.indexOf("index.html")>0)return location.href.replace("index.html"+location.hash,"view.php?p="+e);else return location.href.replace(location.hash,"view.php?p="+e)}};search={code:null,find:function(e){var t,n="",r="",i;clearTimeout($(window).data("timeout"));$(window).data("timeout",setTimeout(function(){if($("#search").val().length!=0){t="search&term="+e;lychee.api(t,"json",function(e){if(e&&e.albums){albums.json={content:e.albums};$.each(albums.json.content,function(){albums.parse(this);n+=build.album(this)})}if(e&&e.photos){album.json={content:e.photos};$.each(album.json.content,function(){album.parse(this);r+=build.photo(this)})}if(n==""&&r=="")i="error";else if(n=="")i=build.divider("Photos")+r;else if(r=="")i=build.divider("Albums")+n;else i=build.divider("Photos")+r+build.divider("Albums")+n;if(search.code!=hex_md5(i)){$(".no_content").remove();lychee.animate(".album, .photo","contentZoomOut");lychee.animate(".divider","fadeOut");search.code=hex_md5(i);setTimeout(function(){if(i=="error")$("body").append(build.no_content("search"));else{lychee.content.html(i);lychee.animate(".album, .photo","contentZoomIn")}},300)}})}else search.reset()},250))},reset:function(){$("#search").val("");$(".no_content").remove();if(search.code!=""){search.code="";lychee.animate(".divider","fadeOut");albums.load()}}};view={header:{show:function(){clearTimeout($(window).data("timeout"));if(visible.photo()){lychee.imageview.removeClass("full");lychee.loadingBar.css("opacity",1);lychee.header.css("margin-Top","0px");if($("#imageview #image.small").length>0){$("#imageview #image").css({marginTop:-1*($("#imageview #image").height()/2)+20})}else{$("#imageview #image").css({top:70,right:30,bottom:30,left:30})}}},hide:function(){if(visible.photo()&&!visible.infobox()){clearTimeout($(window).data("timeout"));$(window).data("timeout",setTimeout(function(){lychee.imageview.addClass("full");lychee.loadingBar.css("opacity",0);lychee.header.css("margin-Top","-45px");if($("#imageview #image.small").length>0){$("#imageview #image").css({marginTop:-1*($("#imageview #image").height()/2)})}else{$("#imageview #image").css({top:0,right:0,bottom:0,left:0})}},500))}},mode:function(e){var t;switch(e){case"albums":$("#tools_album, #tools_photo").hide();$("#tools_albums").show();break;case"album":$("#tools_albums, #tools_photo").hide();$("#tools_album").show();t=album.getID();if(t=="s"||t=="f")$("#button_edit_album, #button_trash_album, #button_share_album").hide();else if(t==0)$("#button_edit_album, #button_share_album").hide();else $("#button_edit_album, #button_trash_album, #button_share_album").show();break;case"photo":$("#tools_albums, #tools_album").hide();$("#tools_photo").show();break}}},albums:{init:function(){view.albums.title();view.albums.content.init()},title:function(){lychee.setTitle("Albums",null,false)},content:{init:function(){var e="",t="";albums.parse(albums.json.unsortedAlbum);albums.parse(albums.json.publicAlbum);albums.parse(albums.json.starredAlbum);if(!lychee.publicMode)e=build.divider("Smart Albums")+build.album(albums.json.unsortedAlbum)+build.album(albums.json.starredAlbum)+build.album(albums.json.publicAlbum);if(albums.json.content){if(!lychee.publicMode)t=build.divider("Albums");$.each(albums.json.content,function(){albums.parse(this);t+=build.album(this)})}if(e==""&&t=="")$("body").append(build.no_content("picture"));else lychee.content.html(e+t);$("img").retina()},title:function(e){var t="",n=albums.json.content[e].title;if(albums.json.content[e].password)t=" ";if(n.length>18)n=n.substr(0,18)+"...";$(".album[data-id='"+e+"'] .overlay h1").html(t+n)},"delete":function(e){$(".album[data-id='"+e+"']").css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove()})}}},album:{init:function(){album.parse();view.album.title();view.album.public();view.album.content.init();album.json.init=1},title:function(){if((visible.album()||!album.json.init)&&!visible.photo()){switch(album.getID()){case"f":lychee.setTitle("Starred",album.json.num,false);break;case"s":lychee.setTitle("Public",album.json.num,false);break;case"0":lychee.setTitle("Unsorted",album.json.num,false);break;default:lychee.setTitle(album.json.title,album.json.num,true);break}}},content:{init:function(){var e="";$.each(album.json.content,function(){album.parse(this);e+=build.photo(this)});lychee.content.html(e);$("img").retina()},title:function(e){var t=album.json.content[e].title;if(t.length>18)t=t.substr(0,18)+"...";$(".photo[data-id='"+e+"'] .overlay h1").html(t)},star:function(e){$(".photo[data-id='"+e+"'] .icon-star").remove();if(album.json.content[e].star==1)$(".photo[data-id='"+e+"']").append("")},"public":function(e){$(".photo[data-id='"+e+"'] .icon-share").remove();if(album.json.content[e].public==1)$(".photo[data-id='"+e+"']").append("")},"delete":function(e){$(".photo[data-id='"+e+"']").css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove();if(!visible.albums()){album.json.num--;view.album.title()}})}},"public":function(){if(album.json.public==1){$("#button_share_album a").addClass("active");$("#button_share_album").attr("title","Share Album");$(".photo .icon-share").remove()}else{$("#button_share_album a").removeClass("active");$("#button_share_album").attr("title","Make Public")}}},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(){view.header.mode("photo");$("body").css("overflow","hidden");lychee.animate(lychee.imageview,"fadeIn")},hide:function(){if(!visible.controls())view.header.show();if(visible.infobox)view.photo.hideInfobox();view.header.mode("album");$("body").css("overflow","scroll");lychee.animate(lychee.imageview,"fadeOut");setTimeout(function(){lychee.imageview.hide()},300)},showInfobox:function(){if(!visible.infobox())$("body").append("
");lychee.infobox.css("right","0px")},hideInfobox:function(){$("#infobox_overlay").remove();lychee.infobox.css("right","-320px")},title:function(e){if(photo.json.init)$("#infobox .attr_name").html($("#infobox .attr_name").html().replace(e,photo.json.title));lychee.setTitle(photo.json.title,null,true)},description:function(e){if(photo.json.init)$("#infobox .attr_description").html($("#infobox .attr_description").html().replace(e,photo.json.description))},star:function(){$("#button_star a").removeClass("icon-star-empty icon-star");if(photo.json.star==1){$("#button_star a").addClass("icon-star");$("#button_star").attr("title","Unstar Photo")}else{$("#button_star a").addClass("icon-star-empty");$("#button_star").attr("title","Star Photo")}},"public":function(){if(photo.json.public==1||photo.json.public==2){$("#button_share a").addClass("active");$("#button_share").attr("title","Share Photo");if(photo.json.init)$("#infobox .attr_visibility").html("Public")}else{$("#button_share a").removeClass("active");$("#button_share").attr("title","Make Public");if(photo.json.init)$("#infobox .attr_visibility").html("Private")}},photo:function(){if(visible.controls()&&photo.isSmall())lychee.imageview.html("
");else if(visible.controls())lychee.imageview.html("
");else if(photo.isSmall())lychee.imageview.html("
");else lychee.imageview.html("
");if(!photo.json.nextPhoto||lychee.viewMode)$("a#next").hide();if(!photo.json.previousPhoto||lychee.viewMode)$("a#previous").hide()},infobox:function(){lychee.infobox.html(build.infobox(photo.json)).show()}}};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},infobox:function(){if(parseInt(lychee.infobox.css("right").replace("px",""))==-320)return false;else return true},controls:function(){if(lychee.loadingBar.css("opacity")<1)return false;else return true},message:function(){if($(".message").length>0)return true;else return false},contextMenu:function(){if($(".contextmenu").length>0)return true;else return false}} \ No newline at end of file diff --git a/js/main.js b/js/main.js deleted file mode 100755 index 8cf4aed..0000000 --- a/js/main.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @name main.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - */ - -$(document).ready(function(){ - - /* Init */ - lychee.init(); - - /* Event Name */ - var event_name = (mobileBrowser()) ? "touchend" : "click"; - - /* Notifications */ - if (window.webkitNotifications) window.webkitNotifications.requestPermission(); - - /* Tooltips */ - if (!mobileBrowser()) $(".tools").tipsy({gravity: 'n'}); - - /* Header */ - $("#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 modal.show("Share Album", "All photos inside this album will be public and visible for everyone. Existing public photos will have the same sharing permission as this album. Are your sure you want to share this album? ", [["Share Album", function() { album.setPublic(album.getID(), e) }], ["Cancel", function() {}]]); - }); - $("#button_signout").on(event_name, lychee.logout); - $("#button_download").on(event_name, function() { window.open(photo.getDirectLink(),"_newtab") }); - $("#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() }); - $("#button_edit_album").on(event_name, function() { album.setTitle() }); - $("#button_edit").on(event_name, function() { photo.setTitle(photo.getID()) }); - $("#button_info").on(event_name, function() { view.photo.showInfobox() }); - $("#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()) }); - - /* Back Buttons */ - $("#button_back_home").on(event_name, function() { lychee.goto("") }); - $("#button_back").on(event_name, function() { lychee.goto("a" + album.getID()) }); - - /* Image View */ - lychee.imageview - .on(event_name, "a#previous", function() { - if (photo.json&&photo.json.previousPhoto) lychee.goto("a" + album.getID() + "p" + photo.json.previousPhoto) - }) - .on(event_name, "a#next", function() { - if (photo.json&&photo.json.nextPhoto) lychee.goto("a" + album.getID() + "p" + photo.json.nextPhoto) - }); - - /* Infobox */ - $("#infobox") - .on(event_name, ".header a", function() { view.photo.hideInfobox() }) - .on(event_name, "#edit_title", function() { photo.setTitle(photo.getID()) }) - .on(event_name, "#edit_description", function() { photo.setDescription(photo.getID()) }); - - /* Keyboard */ - Mousetrap - .bind('n', function(e) { if (!visible.message()) $("body").append(build.addModal) }) - .bind('u', function(e) { $("#auswahl").html(""); $("#upload_files").click() }) - .bind('s', function(e) { if (visible.photo()) $("#button_star").click() }) - .bind('f', function(e) { if (visible.photo()) $("#button_download").click() }) - .bind('command+backspace', function(e) { if (visible.photo()&&!visible.message()) photo.delete() }) - .bind('left', function(e) { if (visible.photo()) $("#imageview a#previous").click() }) - .bind('right', function(e) { if (visible.photo()) $("#imageview a#next").click() }) - .bind('i', function(e) { - if (visible.infobox()) view.photo.hideInfobox(); - else if (visible.photo()) view.photo.showInfobox(); - }); - - Mousetrap.bindGlobal('enter', function(e) { - if ($(".message .button.active").length) $(".message .button.active").addClass("pressed").click() - }); - - Mousetrap.bindGlobal(['esc', 'command+up'], function(e) { - e.preventDefault(); - if (visible.message()) modal.close(); - else if (visible.contextMenu()) contextMenu.close(); - else if (visible.infobox()) view.photo.hideInfobox(); - else if (visible.photo()) lychee.goto("a" + album.getID()); - else if (visible.album()) lychee.goto(""); - else if (visible.albums()&&$("#search").val().length!=0) search.reset(); - }); - - /* Document */ - $(document) - - /* Login */ - .on(event_name, "#button_signin", function() { lychee.loginDialog() }) - .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(); - }) - - /* Navigation */ - .on("click", ".album", function() { lychee.goto("a" + $(this).attr("data-id")) }) - .on("click", ".photo", function() { lychee.goto("a" + album.getID() + "p" + $(this).attr("data-id")) }) - - /* Modal */ - .on(event_name, ".message .close", modal.close) - .on(event_name, ".message .button:first", function() { modal.fns[0](); modal.close(); }) - .on(event_name, ".message .button:last", function() { modal.fns[1](); modal.close(); }) - - /* Add Dialog */ - .on(event_name, ".button_add", function() { $("body").append(build.addModal) }) - .on(event_name, "#add_album", album.add) - .on(event_name, "#add_link", function() { photo.add.url() }) - .on(event_name, "#add_photo", function() { $("#auswahl").html(""); $("#upload_files").click() }) - - /* Upload */ - .on("change", "#upload_files", function() { modal.close(); photo.add.files(this.files); }) - - /* Context Menu */ - .on("contextmenu", ".photo", contextMenu.photo) - .on("contextmenu", ".album", contextMenu.album) - .on(event_name, ".contextmenu_bg", contextMenu.close) - - /* Infobox */ - .on(event_name, "#infobox_overlay", function() { view.photo.hideInfobox() }) - - /* Controls */ - .bind("mouseenter", view.header.show) - .bind("mouseleave", view.header.hide) - - /* Upload */ - .on("dragover", function(e) { e.preventDefault(); }, false) - .on("drop", function(e) { - e.stopPropagation(); - e.preventDefault(); - photo.add.files(e.originalEvent.dataTransfer.files); - return true; - }); - - /* Run */ - lychee.run(); - -}); \ No newline at end of file diff --git a/js/modules/build.js b/js/modules/build.js deleted file mode 100755 index 4040c3a..0000000 --- a/js/modules/build.js +++ /dev/null @@ -1,288 +0,0 @@ -/** - * @name build.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Build Module - * This module is used to generate HTML-Code. - */ - -build = { - - divider: function(title) { - - return "

" + title + "

"; - - }, - - album: function(albumJSON) { - - if (!albumJSON) return ""; - - var album = "" - title = albumJSON.title; - - if (title.length>18) title = albumJSON.title.substr(0, 18) + "..."; - - 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&&albumJSON.star==1) album += ""; - if(!lychee.publicMode&&albumJSON.public==1) album += ""; - if(!lychee.publicMode&&albumJSON.unsorted==1) album += ""; - - album += "
"; - - return album; - - }, - - photo: function(photoJSON) { - - if (!photoJSON) return ""; - - var photo = "", - title = photoJSON.title; - - if (title.length>18) title = photoJSON.title.substr(0, 18) + "..."; - - photo += "
"; - photo += "thumb"; - photo += "
"; - photo += "

" + title + "

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

No results

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

No public albums

"; - - no_content += "
"; - - return no_content; - - }, - - modal: function(title, text, button) { - - var modal = ""; - - modal += "
"; - modal += "
"; - modal += "

" + title + "

"; - modal += ""; - modal += "

" + text + "

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

Add Album or Photo

"; - modal += ""; - modal += "
"; - modal += "
"; - modal += "New Album"; - modal += "
"; - modal += ""; - modal += "
"; - modal += "
"; - modal += "Upload Photo"; - modal += "
"; - modal += "
"; - modal += "
"; - - return modal; - - }, - - signInModal: function() { - - var modal = ""; - - modal += "
"; - modal += "
"; - modal += "

Sign In

"; - modal += ""; - modal += "
Version " + lychee.version + "Update available!
"; - modal += "Sign in"; - modal += "
"; - modal += "
"; - - return modal; - - }, - - uploadModal: function() { - - var modal = ""; - - modal += "
"; - 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; - - }, - - infobox: function(photoJSON, forView) { - - if (!photoJSON) return ""; - - var infobox = "", - public, - editTitleHTML, - editDescriptionHTML, - infos; - - infobox += "

About

"; - infobox += "
"; - - switch (photoJSON.public) { - case "0": - public = "Private"; - break; - case "1": - public = "Public"; - break; - case "2": - public = "Public (Album)"; - break; - default: - public = "-"; - break; - } - - editTitleHTML = (forView==true||lychee.publicMode) ? "" : "
"; - editDescriptionHTML = (forView==true||lychee.publicMode) ? "" : "
"; - - infos = [ - ["", "Basics"], - ["Name", photoJSON.title + editTitleHTML], - ["Uploaded", photoJSON.sysdate], - ["Description", photoJSON.description + editDescriptionHTML], - ["", "Image"], - ["Size", photoJSON.size], - ["Format", photoJSON.type], - ["Resolution", photoJSON.width + " x " + photoJSON.height], - ["", "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], - ["", "Share"], - ["Visibility", public] - ]; - - $.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/js/modules/modal.js b/js/modules/modal.js deleted file mode 100644 index aeaf385..0000000 --- a/js/modules/modal.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @name modal.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Modal Module - * Build, show and hide a modal. - */ - -modal = { - - fns: null, - - show: function(title, text, buttons) { - - if (!buttons) { - var buttons = []; - buttons[0] = ["", function() {}]; - buttons[1] = ["", function() {}]; - } - - modal.fns = [buttons[0][1], buttons[1][1]]; - $("body").append(build.modal(title, text, buttons)); - $(".message input").focus(); - - }, - - 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/js/modules/photo.js b/js/modules/photo.js deleted file mode 100644 index 4deb588..0000000 --- a/js/modules/photo.js +++ /dev/null @@ -1,403 +0,0 @@ -/** - * @name photo.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Photo Module - * Takes care of every action a photo can handle and execute. - */ - -photo = { - - json: 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, "json", function(data) { - - if (data=="HTTP/1.1 403 Wrong password!") { - checkPasswd = function() { - if (password.value!="") photo.load(photoID, albumID); - else setTimeout(checkPasswd, 250); - } - checkPasswd(); - return false; - } - - photo.json = data; - view.photo.init(); - - lychee.imageview.show(); - setTimeout(function() { lychee.content.show() }, 300); - - }); - - }, - - parse: function() { - - if (!photo.json.title) photo.json.title = "Untitled"; - photo.json.url = lychee.upload_path_big + photo.json.url; - - }, - - add: { - - files: function(files) { - - var pre_progress = 0, - formData = new FormData(), - xhr = new XMLHttpRequest(), - popup, - progress; - - $(".upload_overlay").remove(); - $("body").append(build.uploadModal()); - - window.onbeforeunload = function() { return "Lychee is currently uploading!"; }; - - for (var i = 0; i < files.length; i++) formData.append(i, files[i]); - - formData.append("function", "upload"); - - if (album.getID()=="") formData.append("albumID", 0); - else formData.append("albumID", album.getID()); - - xhr.open('POST', lychee.api_path); - xhr.onload = function() { - - if (xhr.status===200) { - - $(".progressbar div").css("width", "100%"); - $(".upload_overlay").removeClass("fadeIn").css("opacity", 0); - setTimeout(function() { $(".upload_overlay").remove() }, 300); - - if (window.webkitNotifications&&BrowserDetect.browser=="Safari") { - popup = window.webkitNotifications.createNotification("", "Upload complete", "You can now manage your new photo."); - popup.show(); - } - - window.onbeforeunload = null; - - if (album.getID()=="") lychee.goto("a0"); - else album.load(album.getID()); - - } - - }; - - xhr.upload.onprogress = function(event) { - - if (event.lengthComputable) { - - progress = (event.loaded / event.total * 100 | 0); - - if (progress>pre_progress) { - $(".progressbar div").css("width", progress + "%"); - pre_progress = progress; - } - - if (progress>=100) $(".progressbar div").css("opacity", 0.2); - - } - - }; - - $("#upload_files").val(""); - - xhr.send(formData); - - }, - - url: function(link) { - - var albumID = album.getID(); - - if (!link) link = prompt("Please enter the direct link to a photo to import it:", ""); - if (album.getID()=="") albumID = 0; - - if (link&&link.length>3) { - - modal.close(); - - $(".upload_overlay").remove(); - $("body").append(build.uploadModal()); - $(".progressbar div").css({ - "opacity": 0.2, - "width": "100%" - }); - - params = "importUrl&url=" + escape(link) + "&albumID=" + albumID; - lychee.api(params, "text", function(data) { - - $(".upload_overlay").removeClass("fadeIn").css("opacity", 0); - setTimeout(function() { $(".upload_overlay").remove() }, 300); - - if (data) { - if (album.getID()=="") lychee.goto("a0"); - else album.load(album.getID()); - } else loadingBar.show("error"); - - }); - - } else if (link.length>0) loadingBar.show("error", "Error", "Link to short or too long. Please try another one!"); - - }, - - dropbox: function() { - - lychee.loadDropbox(function() { - Dropbox.choose({ - linkType: "direct", - multiselect: false, - success: function(files) { photo.add.url(files[0].link) } - }); - }); - - } - - }, - - delete: function(photoID) { - - var params, - buttons, - photoTitle; - - if (!photoID) photoID = photo.getID(); - - if (visible.photo()) photoTitle = photo.json.title; - else photoTitle = album.json.content[photoID].title; - if (photoTitle=="") photoTitle = "Untitled"; - - buttons = [ - ["Delete Photo", function() { - - album.json.content[photoID] = null; - view.album.content.delete(photoID); - - // Only when search is not active - if (!visible.albums()) lychee.goto("a" + album.getID()); - - params = "deletePhoto&photoID=" + photoID; - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - }], - ["Keep Photo", function() {}] - ]; - modal.show("Delete Photo", "Are you sure you want to delete the photo '" + photoTitle + "'?
This action can't be undone!", buttons); - - }, - - setTitle: function(photoID) { - - var oldTitle = "", - newTitle, - params; - - if (!photoID) photoID = photo.getID(); - if (photo.json) oldTitle = photo.json.title; - else if (album.json) oldTitle = album.json.content[photoID].title; - - newTitle = prompt("Please enter a new title for this photo:", oldTitle); - - if (photoID!=null&&photoID&&newTitle.length<31) { - - if (visible.photo()) { - photo.json.title = (newTitle=="") ? "Untitled" : newTitle; - view.photo.title(oldTitle); - } - - album.json.content[photoID].title = newTitle; - view.album.content.title(photoID); - - params = "setPhotoTitle&photoID=" + photoID + "&title=" + escape(encodeURI(newTitle)); - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - } else if (newTitle.length>0) loadingBar.show("error", "Error", "New title to short or too long. Please try another one!"); - - }, - - setAlbum: function(albumID, photoID) { - - var params; - - if (albumID>=0) { - - if (visible.photo) lychee.goto("a" + album.getID()); - album.json.content[photoID] = null; - view.album.content.delete(photoID); - - params = "setAlbum&photoID=" + photoID + "&albumID=" + albumID; - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - } - - }, - - setStar: function(photoID) { - - var params; - - if (visible.photo()) { - photo.json.star = (photo.json.star==0) ? 1 : 0; - view.photo.star(); - } - - album.json.content[photoID].star = (album.json.content[photoID].star==0) ? 1 : 0; - view.album.content.star(photoID); - - params = "setPhotoStar&photoID=" + photoID; - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - }, - - 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("a" + 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); - - params = "setPhotoPublic&photoID=" + photoID + "&url=" + photo.getViewLink(photoID); - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - }, - - setDescription: function(photoID) { - - var oldDescription = photo.json.description, - description = prompt("Please enter a description for this photo:", oldDescription), - params; - - if (description.length>0&&description.length<160) { - - if (visible.photo()) { - photo.json.description = description; - view.photo.description(oldDescription); - } - - params = "setPhotoDescription&photoID=" + photoID + "&description=" + escape(description); - lychee.api(params, "text", function(data) { - - if (!data) loadingBar.show("error"); - - }); - - } else if (description.length>0) loadingBar.show("error", "Error", "Description to short or too long. Please try another one!"); - - }, - - share: function(photoID, service) { - - var link = "", - url = photo.getViewLink(photoID), - params, - 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; - - }, - - getDirectLink: function() { - - return $("#imageview #image").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig, ""); - - }, - - getViewLink: function(photoID) { - - if (location.href.indexOf("index.html")>0) return location.href.replace("index.html" + location.hash, "view.php?p=" + photoID); - else return location.href.replace(location.hash, "view.php?p=" + photoID); - - } - -} \ No newline at end of file diff --git a/js/modules/photos.js b/js/modules/photos.js deleted file mode 100755 index 473744f..0000000 --- a/js/modules/photos.js +++ /dev/null @@ -1,431 +0,0 @@ -/** - * @name photos.js - * @author Philipp Maurer - * @author Tobias Reich - * @copyright 2013 by Philipp Maurer, Tobias Reich - * - * Photos Module - * Takes care of every action photos can handle and execute. - */ - -photos = { - - load: function(albumID, refresh) { - - // If refresh is true the function will only refresh the content and not change the toolbar buttons either the title - - /*password = localStorage.getItem("album" + albumID); - if (password==null) { - if (lychee.publicMode) password = prompt("Please enter a password for this album:", ""); else password = ""; - if (password!="") password = hex_md5(password); - localStorage.setItem("album" + albumID, password); - }*/ - - password = ""; - - if (!refresh) { - loadingBar.show(); - if (visible.imageview()) photos.hideView(); - lychee.animate(".album, .photo", "contentZoomOut"); - lychee.animate(".divider", "fadeOut"); - } - - startTime = new Date().getTime(); - - params = "getPhotos&albumID=" + albumID + "&password=" + password; - lychee.api(params, "json", function(data) { - - if (data=="HTTP/1.1 403 Wrong password!") { - localStorage.removeItem("album" + albumID); - photos.load(albumID, refresh); - return false; - } - - durationTime = (new Date().getTime() - startTime); - if (durationTime>300) waitTime = 0; else if (refresh) waitTime = 0; else waitTime = 300 - durationTime; - - $.timer(waitTime,function(){ - - photosData = ""; - $.each(data, function() { photosData += build.photo(this); }); - lychee.content.html(photosData); - - if (!refresh) { - - lychee.animate(".album, .photo", "contentZoomIn"); - $("#tools_albums, #tools_photo").hide(); - $("#tools_album").show(); - $("img").retina(); - - albums.loadInfo(albumID, password); - - } - - }, false); - - }); - - }, - - loadInfo: function(photoID, albumID) { - - /*password = localStorage.getItem("album" + albumID); - if (password==null) { - if (lychee.publicMode) password = prompt("Please enter a password for this album:", ""); else password = ""; - if (password!="") password = hex_md5(password); - localStorage.setItem("album" + albumID, password); - }*/ - - password = ""; - - photos.showView(); - - params = "getPhotoInfo&photoID=" + photoID + "&password=" + password; - lychee.api(params, "json", function(data) { - - if (data=="HTTP/1.1 403 Wrong password!") { - localStorage.removeItem("album" + albumID); - photos.loadInfo(photoID, albumID); - return false; - } - - if (!data.title) data.title = "Untitled"; - - document.title = "Lychee - " + data.title; - lychee.headerTitle.html(data.title).addClass("editable"); - - $("#button_star a").removeClass("icon-star-empty icon-star"); - if (data.star=="1") { - $("#button_star a").addClass("icon-star"); - $("#button_star").attr("title", "Unstar Photo"); - } else { - $("#button_star a").addClass("icon-star-empty"); - $("#button_star").attr("title", "Star Photo"); - } - - if (data.public=="1") { - $("#button_share a").addClass("active"); - $("#button_share").attr("title", "Share Photo"); - } else { - $("#button_share a").removeClass("active"); - $("#button_share").attr("title", "Make Public"); - } - - data.url = lychee.upload_path + data.url; - - if (visible.controls()&&photos.isSmall(data)) lychee.image_view.html("
"); - else if (visible.controls()) lychee.image_view.html("
"); - else if (photos.isSmall(data)) lychee.image_view.html("
"); - else lychee.image_view.html("
"); - - lychee.animate(image_view, "fadeIn"); - lychee.image_view.show(); - - if (!visible.controls()) lychee.hideControls(); - - lychee.infobox.html(build.infobox(data)).show(); - - $.timer(300,function(){ lychee.content.show(); }); - - }); - - }, - - isSmall: function(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; - - }, - - showView: function() { - - // Change toolbar-buttons - $("#tools_albums, #tools_album").hide(); - $("#tools_photo").show(); - - // Make body not scrollable - $("body").css("overflow", "hidden"); - - }, - - hideView: function() { - - // Change toolbar-buttons - $("#tools_photo, #tools_albums").hide(); - $("#tools_album").show(); - - // Make body scrollable - $("body").css("overflow", "scroll"); - - // Change website title and url by using albums.loadInfo - albums.loadInfo(lychee.content.attr("data-id")); - - // Hide ImageViewer - lychee.animate(image_view, "fadeOut"); - $.timer(300,function(){ lychee.image_view.hide() }); - - }, - - showInfobox: function() { - - if (!visible.infobox()) $("body").append("
"); - lychee.infobox.css("right", "0px"); - - }, - - hideInfobox: function() { - - $("#infobox_overlay").remove(); - lychee.infobox.css("right", "-320px"); - - }, - - hide: function(photoID) { - - $(".photo[data-id='" + photoID + "']").css("opacity", 0).animate({ - width: 0, - marginLeft: 0 - }, 300, function() { - $(this).remove(); - if (!visible.imageview()) { - imgNum = parseInt($("#title span").html().replace("- ", "").replace(" photos", ""))-1; - $("#title span").html(" - " + imgNum + " photos"); - } - }); - - }, - - delete: function(photoID) { - - params = "deletePhoto&photoID=" + photoID; - lychee.api(params, "text", function(data) { - - if (data) { - - photos.hide(photoID); - lychee.goto("a" + lychee.content.attr("data-id")); - - } else loadingBar.show("error"); - - }); - - }, - - deleteDialog: function(photoID) { - - if (!photoID) photoID = lychee.image_view.attr("data-id"); - - if (visible.imageview()) photoTitle = lychee.title(); - else photoTitle = $(".photo[data-id='" + photoID + "'] .overlay h1").html(); - if (photoTitle=="") photoTitle = "Untitled"; - - f1 = "photos.delete(" + photoID + ");"; - f2 = ""; - modal = build.modal("Delete Photo", "Are you sure you want to delete the photo '" + photoTitle + "'?
This action can't be undone!", ["Delete Photo", "Keep Photo"], [f1, f2]); - $("body").append(modal); - - }, - - setTitle: function(photoID) { - - if (!photoID) oldTitle = lychee.title(); else oldTitle = ""; - if (!photoID) photoID = lychee.image_view.attr("data-id"); - - newTitle = prompt("Please enter a new title for this photo:", oldTitle); - - if (photoID!=null&&photoID&&newTitle.length<31) { - - if (newTitle=="") newTitle = "Untitled"; - - params = "setPhotoTitle&photoID=" + photoID + "&title=" + encodeURI(newTitle); - lychee.api(params, "text", function(data) { - - if (data) { - if (visible.imageview()) { - $("#infobox .attr_name").html($("#infobox .attr_name").html().replace(lychee.title(), newTitle)); - lychee.headerTitle.html(newTitle); - document.title = "Lychee - " + newTitle; - } - $(".photo[data-id='" + photoID + "'] .overlay h1").html(newTitle); - } else loadingBar.show("error"); - - }); - - } else if (newTitle.length>0) loadingBar.show("error", "Error", "New title to short or too long. Please try another one!"); - - }, - - setAlbum: function(photoID, albumID) { - - if (albumID>=0) { - - params = "setAlbum&photoID=" + photoID + "&albumID=" + albumID; - lychee.api(params, "text", function(data) { - - if (data) { - photos.hide(photoID); - lychee.goto("a" + lychee.content.attr("data-id")); - } else loadingBar.show("error"); - - }); - - } - - }, - - setStar: function() { - - photoID = lychee.image_view.attr("data-id"); - - params = "setPhotoStar&photoID=" + photoID; - lychee.api(params, "text", function(data) { - - if (data) { - - if ($("#button_star a.icon-star-empty").length) { - $("#button_star a").removeClass("icon-star-empty icon-star").addClass("icon-star"); - $("#button_star").attr("title", "Unstar Photo"); - } else { - $("#button_star a").removeClass("icon-star-empty icon-star").addClass("icon-star-empty"); - $("#button_star").attr("title", "Star Photo"); - } - - photos.load(lychee.content.attr("data-id"), true); - - } else loadingBar.show("error"); - - }); - - }, - - setPublic: function(e) { - - photoID = lychee.image_view.attr("data-id"); - - params = "setPhotoPublic&photoID=" + photoID + "&url=" + photos.getViewLink(photoID); - lychee.api(params, "text", function(data) { - - if (data) { - - if ($("#button_share a.active").length) { - $("#button_share a").removeClass("active"); - $("#button_share").attr("title", "Make Public"); - $("#infobox .attr_visibility").html("Private"); - } else { - $("#button_share a").addClass("active"); - $("#button_share").attr("title", "Share Photo"); - $("#infobox .attr_visibility").html("Public"); - contextMenu.share(photoID, e.pageX, e.pageY); - } - - photos.load(lychee.content.attr("data-id"), true); - - } else loadingBar.show("error"); - - }); - - }, - - setDescription: function() { - - description = prompt("Please enter a description for this photo:", ""); - photoID = lychee.image_view.attr("data-id"); - - if (description.length>0&&description.length<160) { - - params = "setPhotoDescription&photoID=" + photoID + "&description=" + escape(description); - lychee.api(params, "text", function(data) { - - if (data) { - $("#infobox .attr_description").html(description + "
"); - } else loadingBar.show("error"); - - }); - - } else if (description.length>0) loadingBar.show("error", "Error", "Description to short or too long. Please try another one!"); - - }, - - share: function(service, photoID) { - - link = ""; - url = photos.getViewLink(photoID); - - 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(lychee.title()); - break; - case 2: - link = "mailto:?subject=" + encodeURI(lychee.title()) + "&body=" + encodeURI("Hi! Check this out: " + url); - break; - case 3: - modal = build.modal("Copy Link", "Everyone can view your public photos, but only you can edit them. Use this link to share your photo with others: ", ["Close"], [""]); - $("body").append(modal); - $(".copylink").focus(); - break; - case 4: - params = "getShortlink&photoID=" + photoID; - lychee.api(params, "text", function(data) { - if (data=="") data = "Something went wrong!"; - modal = build.modal("Copy Shortlink", "Everyone can view your public photos, but only you can edit them. Use this link to share your photo with others: ", ["Close"], [""]); - $("body").append(modal); - $(".copylink").focus(); - }); - break; - default: - link = ""; - break; - } - - if (link.length>5) location.href = link; - - }, - - getViewLink: function(photoID) { - - if (location.href.indexOf("index.html")>0) return location.href.replace("index.html" + location.hash, "view.php?p=" + photoID); - else return location.href.replace(location.hash, "view.php?p=" + photoID); - - }, - - previous: function() { - - albumID = lychee.content.attr("data-id"); - photoID = lychee.image_view.attr("data-id"); - - params = "previousPhoto&photoID=" + photoID + "&albumID=" + albumID; - lychee.api(params, "json", function(data) { - - if (data!=false) lychee.goto("a" + albumID + "p" + data.id); - - }); - - }, - - next: function() { - - albumID = lychee.content.attr("data-id"); - photoID = lychee.image_view.attr("data-id"); - - params = "nextPhoto&photoID=" + photoID + "&albumID=" + albumID; - lychee.api(params, "json", function(data) { - - if (data) lychee.goto("a" + albumID + "p" + data.id); - - }); - - } - -} \ No newline at end of file diff --git a/lychee.sql b/lychee.sql deleted file mode 100755 index 7e5e6b0..0000000 --- a/lychee.sql +++ /dev/null @@ -1,48 +0,0 @@ -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - -CREATE TABLE IF NOT EXISTS `lychee_albums` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(50) NOT NULL, - `sysdate` varchar(10) NOT NULL, - `public` TINYINT(1) DEFAULT '0', - `password` VARCHAR(100), - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - -CREATE TABLE IF NOT EXISTS `lychee_photos` ( - `id` bigint(14) NOT NULL, - `title` varchar(50) NOT NULL, - `description` varchar(160) NOT NULL, - `url` varchar(100) NOT NULL, - `public` tinyint(1) NOT NULL, - `shortlink` varchar(20) NOT NULL, - `type` varchar(10) NOT NULL, - `width` int(11) NOT NULL, - `height` int(11) NOT NULL, - `size` varchar(10) NOT NULL, - `sysdate` varchar(10) NOT NULL, - `systime` varchar(8) NOT NULL, - `iso` varchar(15) NOT NULL, - `aperture` varchar(10) NOT NULL, - `make` varchar(20) NOT NULL, - `model` varchar(50) NOT NULL, - `shutter` varchar(10) NOT NULL, - `focal` varchar(10) NOT NULL, - `takedate` varchar(10) NOT NULL, - `taketime` varchar(8) NOT NULL, - `star` tinyint(1) NOT NULL, - `thumbUrl` varchar(50) NOT NULL, - `album` varchar(30) NOT NULL DEFAULT '0', - `import_name` varchar(100) DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/php/api.php b/php/api.php old mode 100755 new mode 100644 index 7f108cf..a15579e --- a/php/api.php +++ b/php/api.php @@ -1,115 +1,282 @@ - \ No newline at end of file diff --git a/php/check.php b/php/check.php deleted file mode 100644 index bf06453..0000000 --- a/php/check.php +++ /dev/null @@ -1,45 +0,0 @@ -\n'); - - // Extensions - if (!extension_loaded('exif')) $error .= ('Error 200: PHP exif extension not activated.
\n'); - if (!extension_loaded('mbstring')) $error .= ('Error 201: PHP mbstring extension not activated.
\n'); - if (!extension_loaded('gd')) $error .= ('Error 202: PHP gd extension not activated.
\n'); - if (!extension_loaded('mysqli')) $error .= ('Error 203: PHP mysqli extension not activated.
\n'); - - // Config - if (!$db||$db=='') $error .= ('Error 300: No property for \$db in config.php.
\n'); - if (!$dbUser||$dbUser=='') $error .= ('Error 301: No property for \$dbUser in config.php.
\n'); - if (!$dbPassword||$dbPassword=='') $error .= ('Error 302: No property for \$dbPassword in config.php.
\n'); - if (!$dbHost||$dbHost=='') $error .= ('Error 303: No property for \$dbHost in config.php.
\n'); - if (!$user||$user=='') $error .= ('Error 304: No property for \$user in config.php.
\n'); - if (!$password||$password=='') $error .= ('Error 305: No property for \$password in config.php.
\n'); - - // Additional Config - //if ($checkForUpdates!=true&&heckForUpdates!=false) $error .= ('Error 306: No property for \$checkForUpdates in config.php.
\n'); - if (!is_numeric($thumbQuality)||$thumbQuality<=0||$thumbQuality>=100) $error .= ('Error 307: Wrong property for \$thumbQuality in config.php.
\n'); - if ($sorting!='ASC'&&$sorting!='DESC') $error .= ('Error 308: Wrong property for \$sorting in config.php.
\n'); - - // Database - $database = new mysqli($dbHost, $dbUser, $dbPassword, $db); - if (mysqli_connect_errno()!=0) $error .= ('Error 400: ' . mysqli_connect_errno() . ': ' . mysqli_connect_error() . '
\n'); - - // Permissions - if (substr(sprintf('%o', fileperms('../uploads/big/')), -4)!='0777') $error .= ('Error 500: Wrong permissions for \'/uploads/big\' (777 required).
\n'); - if (substr(sprintf('%o', fileperms('../uploads/thumb/')), -4)!='0777') $error .= ('Error 501: Wrong permissions for \'/uploads/thumb\' (777 required).
\n'); - if (substr(sprintf('%o', fileperms('../uploads/import/')), -4)!='0777') $error .= ('Error 502: Wrong permissions for \'/uploads/import\' (777 required).
\n'); - if (substr(sprintf('%o', fileperms('../uploads/')), -4)!='0777') $error .= ('Error 503: Wrong permissions for \'/uploads\' (777 required).
\n'); - - if ($error=='') echo('Lychee is ready!'); else echo $error; - -?> \ No newline at end of file diff --git a/php/config.php b/php/config.php deleted file mode 100755 index 789bf44..0000000 --- a/php/config.php +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/php/functions.php b/php/functions.php deleted file mode 100644 index 87eeb25..0000000 --- a/php/functions.php +++ /dev/null @@ -1,801 +0,0 @@ -select_db($db)) { - createDatabase($db, $database); - } - $query = "SELECT * FROM lychee_photos, lychee_albums;"; - if (!$database->query($query)) createTables($database); - return $database; -} -function dbClose() { - global $database; - if (!$database->close()) { - echo "Closing the connection failed!"; - return false; - } - return true; -} -function createDatabase($db, $database) { - $result = $database->query("CREATE DATABASE IF NOT EXISTS $db;"); - $database->select_db($db); - if (!$result) return false; - return true; -} -function createTables($database) { - $query = "CREATE TABLE IF NOT EXISTS `lychee_albums` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(50) NOT NULL, - `sysdate` varchar(10) NOT NULL, - `public` TINYINT(1) DEFAULT '0', - `password` VARCHAR(100), - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;"; - $result = $database->query($query); - if (!$result) return false; - - $query = "CREATE TABLE `lychee_photos` ( - `id` bigint(14) NOT NULL, - `title` varchar(50) NOT NULL, - `description` varchar(160) NOT NULL, - `url` varchar(100) NOT NULL, - `public` tinyint(1) NOT NULL, - `type` varchar(10) NOT NULL, - `width` int(11) NOT NULL, - `height` int(11) NOT NULL, - `size` varchar(10) NOT NULL, - `sysdate` varchar(10) NOT NULL, - `systime` varchar(8) NOT NULL, - `iso` varchar(15) NOT NULL, - `aperture` varchar(10) NOT NULL, - `make` varchar(20) NOT NULL, - `model` varchar(50) NOT NULL, - `shutter` varchar(20) NOT NULL, - `focal` varchar(10) NOT NULL, - `takedate` varchar(10) NOT NULL, - `taketime` varchar(8) NOT NULL, - `star` tinyint(1) NOT NULL, - `thumbUrl` varchar(50) NOT NULL, - `album` varchar(30) NOT NULL DEFAULT '0', - `import_name` varchar(100) DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1;"; - $result = $database->query($query); - if (!$result) return false; - return true; -} - -// Upload Functions -function upload($files, $albumID) { - - global $database; - - switch($albumID) { - // s for public (share) - case 's': - $public = 1; - $star = 0; - $albumID = 0; - break; - // f for starred (fav) - case 'f': - $star = 1; - $public = 0; - $albumID = 0; - break; - default: - $star = 0; - $public = 0; - } - - foreach ($files as $file) { - - $id = str_replace('.', '', microtime(true)); - while(strlen($id)<14) $id .= 0; - $tmp_name = $file["tmp_name"]; - $type = getimagesize($tmp_name); - if (($type[2]!=1)&&($type[2]!=2)&&($type[2]!=3)) return false; - $data = $file["name"]; - $data = explode('.',$data); - $data = array_reverse ($data); - $data = $data[0]; - - // Import if not uploaded via web - if (!is_uploaded_file($file)) { - if (copy($tmp_name, "../uploads/big/" . md5($id) . ".$data")) { - unlink($tmp_name); - $import_name = $tmp_name; - } - } else { - move_uploaded_file($tmp_name, "../uploads/big/" . md5($id) . ".$data"); - $import_name = ""; - } - - // Create Thumb - createThumb(md5($id).".".$data); - - // Read infos - $info = getCamera(md5($id).".".$data); - $title = ""; - if (isset($info['type'])){$type=$info['type'];} else {$type="";} - if (isset($info['width'])){$width=$info['width'];} else {$width="";} - if (isset($info['height'])){$height=$info['height'] OR "";} else {$height="";} - if (isset($info['size'])){$size=$info['size'] OR "";} else {$size="";} - if (isset($info['date'])){$sysdate=$info['date'];} else {$sysdate="";} - if (isset($info['time'])){$systime=$info['time'];} else {$systime="";} - if (isset($info['iso'])){$iso=$info['iso'];} else {$iso="";} - if (isset($info['aperture'])){$aperture=$info['aperture'];} else {$aperture="";} - if (isset($info['make'])){$make=$info['make'];} else {$make="";} - if (isset($info['model'])){$model=$info['model'] OR "";} else {$model="";} - if (isset($info['shutter'])){$shutter=$info['shutter'];} else {$shutter="";} - if (isset($info['focal'])){$focal=$info['focal'];} else {$focal="";} - if (isset($info['takeDate'])){$takeDate=$info['takeDate'];} else {$takeDate="";} - if (isset($info['takeTime'])){$takeTime=$info['takeTime'];} else {$takeTime="";} - $query = "INSERT INTO lychee_photos (id, title, url, description, type, width, height, size, sysdate, systime, iso, aperture, make, model, shutter, focal, takedate, taketime, thumbUrl, album, public, star, import_name) - VALUES ('$id', '$title', '" . md5($id) . ".$data', '', '$type', '$width', '$height', '$size', '$sysdate', '$systime', '$iso', '$aperture', '$make', '$model', '$shutter', '$focal', '$takeDate', '$takeTime', '" . md5($id) . ".$data', '$albumID', '$public', '$star', '$import_name');"; - $result = $database->query($query); - - } - - return true; - -} -function getCamera($filename) { - global $database; - $url = "../uploads/big/$filename"; - $type = getimagesize($url); - $type = $type['mime']; - - if (($type == "image/jpeg") && function_exists('exif_read_data') ){ - - $exif = exif_read_data($url, "EXIF", 0); - - // General information - $return['name'] = $exif['FileName']; - $generalInfos = getimagesize($url); - $return['type'] = $generalInfos['mime']; - $return['width'] = $generalInfos[0]; - $return['height'] = $generalInfos[1]; - $size = (filesize($url) / 1024); - if ($size >= 1024){$size=round($size/1024,1)." MB";} else {$size=round($size,1)." KB";} - $return['size'] = $size; - $return['date'] = date("d.m.Y",filectime($url)); - $return['time'] = date("H:i:s",filectime($url)); - - // Camera Information - if (isset($exif['ISOSpeedRatings'])){$return['iso']="ISO-".$exif['ISOSpeedRatings'];} - if (isset($exif['COMPUTED']['ApertureFNumber'])){$return['aperture']=$exif['COMPUTED']['ApertureFNumber'];} - if (isset($exif['Make'])){$return['make']=$exif['Make'];} - if (isset($exif['Model'])){$return['model']=$exif['Model'];} - if (isset($exif['ExposureTime'])){$return['shutter']=$exif['ExposureTime']." Sek.";} - if (isset($exif['FocalLength'])){$return['focal']=($exif['FocalLength']/1)." mm";} - if (isset($exif['Software'])){$return['software']=$exif['Software'];} - if (isset($exif['DateTimeOriginal'])) { - $exifDate = explode(" ",$exif['DateTimeOriginal']); - $date = explode(":", $exifDate[0]); $return['takeDate'] = $date[2].".".$date[1].".".$date[0]; - $return['takeTime'] = $exifDate[1]; - } - - } else { - - $exif = getimagesize($url); - $return['type'] = $exif['mime']; - $return['width'] = $exif[0]; - $return['height'] = $exif[1]; - $size = (filesize($url) / 1024); - if ($size >= 1024){$size=round($size/1024,1)." MB";} else {$size=round($size,1)." KB";} - $return['size'] = $size; - $return['date'] = date("d.m.Y",filectime($url)); - $return['time'] = date("H:i:s",filectime($url)); - - } - return $return; -} -function createThumb($filename, $width = 200, $width2x = 400, $height = 200, $height2x = 400) { - - global $database, $thumbQuality; - $photoUrl = "../uploads/big/$filename"; - $newUrl = "../uploads/thumb/$filename"; - $thumbPhotoName = explode(".", $filename); - $newUrl2x = "../uploads/thumb/".$thumbPhotoName[0]."@2x.".$thumbPhotoName[1]; - $oldImg = getimagesize($photoUrl); - $type = $oldImg['mime']; - - // Set position and size - $thumb = imagecreatetruecolor($width, $height); - $thumb2x = imagecreatetruecolor($width2x, $height2x); - if ($oldImg[0]<$oldImg[1]) { - $newSize = $oldImg[0]; - $startWidth = 0; - $startHeight = $oldImg[1]/2 - $oldImg[0]/2; - } else { - $newSize = $oldImg[1]; - $startWidth = $oldImg[0]/2 - $oldImg[1]/2; - $startHeight = 0; - } - - // Create new image - switch($type) { - case "image/jpeg": $sourceImg = imagecreatefromjpeg($photoUrl); break; - case "image/png": $sourceImg = imagecreatefrompng($photoUrl); break; - case "image/gif": $sourceImg = imagecreatefromgif($photoUrl); break; - default: return false; - } - imagecopyresampled($thumb,$sourceImg,0,0,$startWidth,$startHeight,$width,$height,$newSize,$newSize); - imagecopyresampled($thumb2x,$sourceImg,0,0,$startWidth,$startHeight,$width2x,$height2x,$newSize,$newSize); - switch($type) { - case "image/jpeg": imagejpeg($thumb,$newUrl,$thumbQuality); imagejpeg($thumb2x,$newUrl2x,$thumbQuality); break; - case "image/png": imagepng($thumb,$newUrl); imagepng($thumb2x,$newUrl2x); break; - case "image/gif": imagegif($thumb,$newUrl); imagegif($thumb2x,$newUrl2x); break; - default: return false; - } - - return true; - -} - -// Session Functions -function init($mode) { - global $checkForUpdates; - $return["config"]["checkForUpdates"] = $checkForUpdates; - if ($mode=="admin") $return["loggedIn"] = true; - else $return["loggedIn"] = false; - return $return; -} -function login($loginUser, $loginPassword) { - global $database, $user, $password; - if ($loginUser==$user&&$loginPassword==md5($password)) { - // Admin Login - $_SESSION['login'] = true; - return true; - } else { - return false; - } -} -function logout() { - session_destroy(); - return true; -} - -// Album Functions -function addAlbum($title) { - global $database; - $title = mysqli_real_escape_string($database, urldecode($title)); - if (strlen($title)<1||strlen($title)>30) return false; - $sysdate = date("d.m.Y"); - $query = "INSERT INTO lychee_albums (title, sysdate) VALUES ('$title', '$sysdate');"; - $result = $database->query($query); - if (!$result) return false; - return $database->insert_id; -} -function getAlbums($public) { - global $database, $sorting; - - // Smart Albums - if (!$public) $return = getSmartInfo(); - - // Albums - if ($public) $query = "SELECT * FROM lychee_albums WHERE public = 1 ORDER BY id $sorting;"; - else $query = "SELECT * FROM lychee_albums ORDER BY id $sorting;"; - $result = $database->query($query) OR die("Error: $result
".$database->error); - $i=0; - while($row = $result->fetch_object()) { - $return["content"][$row->id]['id'] = $row->id; - $return["content"][$row->id]['title'] = $row->title; - $return["content"][$row->id]['public'] = $row->public; - $return["content"][$row->id]['sysdate'] = $row->sysdate; - if ($row->password=="") $return["content"][$row->id]['password'] = false; - else $return["content"][$row->id]['password'] = true; - - // Thumbs - if (($public&&$row->password=="")||(!$public)) { - $albumID = $row->id; - $query = "SELECT thumbUrl FROM lychee_photos WHERE album = '$albumID' ORDER BY id $sorting LIMIT 0, 3;"; - $result2 = $database->query($query); - $k = 0; - while($row2 = $result2->fetch_object()){ - $return["content"][$row->id]["thumb$k"] = $row2->thumbUrl; - $k++; - } - if (!isset($return["content"][$row->id]["thumb0"])) $return["content"][$row->id]["thumb0"]=""; - if (!isset($return["content"][$row->id]["thumb1"])) $return["content"][$row->id]["thumb1"]=""; - if (!isset($return["content"][$row->id]["thumb2"])) $return["content"][$row->id]["thumb2"]=""; - } - $i++; - } - if ($i==0) $return["albums"] = false; - else $return["albums"] = true; - return $return; -} -function getAlbum($albumID) { - global $database, $sorting; - switch($albumID) { - case "f": - $return['public'] = false; - $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE star = 1 ORDER BY id $sorting;"; - break; - case "s": - $return['public'] = false; - $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE public = 1 ORDER BY id $sorting;"; - break; - case 0: - $return['public'] = false; - $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE album = 0 ORDER BY id $sorting;"; - default: - $result = $database->query("SELECT title, public, password FROM lychee_albums WHERE id = '$albumID';"); - $row = $result->fetch_object(); - $return['title'] = $row->title; - $return['public'] = $row->public; - if ($row->password=="") $return['password'] = false; - else $return['password'] = true; - $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE album = '$albumID' ORDER BY id $sorting;"; - break; - } - $result = $database->query($query); - $i = 0; - while($row = $result->fetch_array()) { - $return['content'][$row['id']] = $row; - $i++; - } - if ($i==0) $return['content'] = false; - $return['id'] = $albumID; - $return['num'] = $i; - return $return; -} -function getSmartInfo() { - - global $database, $sorting; - - // Unsorted - $query = "SELECT * FROM lychee_photos WHERE album = 0 ORDER BY id $sorting;"; - $result = $database->query($query); - $i = 0; - while($row = $result->fetch_object()) { - if ($i<3) $return["unsortedThumb$i"] = $row->thumbUrl; - $i++; - } - $return['unsortedNum'] = $i; - - // Public - $query2 = "SELECT * FROM lychee_photos WHERE public = 1 ORDER BY id $sorting;"; - $result2 = $database->query($query2); - $i = 0; - while($row2 = $result2->fetch_object()) { - if ($i<3) $return["publicThumb$i"] = $row2->thumbUrl; - $i++; - } - $return['publicNum'] = $i; - - // Starred - $query3 = "SELECT * FROM lychee_photos WHERE star = 1 ORDER BY id $sorting;"; - $result3 = $database->query($query3); - $i = 0; - while($row3 = $result3->fetch_object()) { - if ($i<3) $return["starredThumb$i"] = $row3->thumbUrl; - $i++; - } - $return['starredNum'] = $i; - - return $return; - -} -function setAlbumTitle($albumID, $title) { - global $database; - $title = mysqli_real_escape_string($database, urldecode($title)); - if (strlen($title)<1||strlen($title)>30) return false; - $query = "UPDATE lychee_albums SET title = '$title' WHERE id = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - return true; -} -function deleteAlbum($albumID, $delAll) { - global $database; - if ($delAll=="true") { - $query = "SELECT id FROM lychee_photos WHERE album = '$albumID';"; - $result = $database->query($query); - $error = false; - while($row = $result->fetch_object()) { - if (!deletePhoto($row->id)) $error = true; - } - } else { - $query = "UPDATE lychee_photos SET album = '0' WHERE album = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - } - if ($albumID!=0) { - $query = "DELETE FROM lychee_albums WHERE id = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - } - if ($error) return false; - return true; -} -function getAlbumArchive($albumID) { - global $database; - switch($albumID) { - case 's': - $query = "SELECT * FROM lychee_photos WHERE public = '1';"; - $zipTitle = "Public"; - break; - case 'f': - $query = "SELECT * FROM lychee_photos WHERE star = '1';"; - $zipTitle = "Starred"; - break; - default: - $query = "SELECT * FROM lychee_photos WHERE album = '$albumID';"; - $zipTitle = "Unsorted"; - } - $result = $database->query($query); - $files = array(); - $i=0; - while($row = $result->fetch_object()) { - $files[$i] = "../uploads/big/".$row->url; - $i++; - } - $query = "SELECT * FROM lychee_albums WHERE id = '$albumID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($albumID!=0&&is_numeric($albumID))$zipTitle = $row->title; - $filename = "../uploads/".$zipTitle.".zip"; - - $zip = new ZipArchive(); - - if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) { - return false; - } - - foreach($files AS $zipFile) { - $newFile = explode("/",$zipFile); - $newFile = array_reverse($newFile); - $zip->addFile($zipFile, $zipTitle."/".$newFile[0]); - } - - $zip->close(); - - header("Content-Type: application/zip"); - header("Content-Disposition: attachment; filename=\"$zipTitle.zip\""); - header("Content-Length: ".filesize($filename)); - readfile($filename); - unlink($filename); - - return true; -} -function setAlbumPublic($albumID, $password) { - global $database; - $query = "SELECT public FROM lychee_albums WHERE id = '$albumID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->public == 0){ - $public = 1; - } else { - $public = 0; - } - $query = "UPDATE lychee_albums SET public = '$public', password = NULL WHERE id = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - if ($public==1) { - $query = "UPDATE lychee_photos SET public = 0 WHERE album = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - } - if (strlen($password)>0) return setAlbumPassword($albumID, $password); - else return true; -} -function setAlbumPassword($albumID, $password) { - global $database; - $query = "UPDATE lychee_albums SET password = '$password' WHERE id = '$albumID';"; - $result = $database->query($query); - if (!$result) return false; - return true; -} -function checkAlbumPassword($albumID, $password) { - global $database; - $query = "SELECT public, password FROM lychee_albums WHERE id = '$albumID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->password=="") return true; - else if ($row->password==$password) return true; - else return false; -} -function isAlbumPublic($albumID) { - global $database; - $query = "SELECT public, password FROM lychee_albums WHERE id = '$albumID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->public==1) return true; - else return false; -} - -// Photo Functions -function getPhoto($photoID, $albumID) { - global $database; - if (!is_numeric($photoID)) { - $query = "SELECT COUNT(*) AS quantity FROM lychee_photos WHERE import_name = '../uploads/import/$photoID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->quantity == 0) { - importPhoto($photoID, 's'); - } - if (is_file("../uploads/import/$photoID")) { - importPhoto($photoID, 's'); - } - $query = "SELECT * FROM lychee_photos WHERE import_name = '../uploads/import/$photoID' ORDER BY ID DESC;"; - } else { - $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; - } - $result = $database->query($query); - $return = $result->fetch_array(); - - if ($albumID!='false') { - - if ($return['album']!=0) { - - $result = $database->query("SELECT public FROM lychee_albums WHERE id = " . $return['album'] . ";"); - $return_album = $result->fetch_array(); - if ($return_album['public']=="1") $return['public'] = "2"; - - } - - $return['original_album'] = $return['album']; - $return['album'] = $albumID; - - $nextPhoto = getNextPhotoID($photoID, $albumID, false); - if ($nextPhoto==$photoID) $return['nextPhoto'] = false; - else $return['nextPhoto'] = $nextPhoto; - - $previousPhoto = getPreviousPhotoID($photoID, $albumID, false); - if ($previousPhoto==$photoID) $return['previousPhoto'] = false; - else $return['previousPhoto'] = $previousPhoto; - - } - - unset($return['album_public']); - - return $return; -} -function setPhotoPublic($photoID, $url) { - global $database; - $query = "SELECT public FROM lychee_photos WHERE id = '$photoID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->public == 0){ - $public = 1; - } else { - $public = 0; - } - $query = "UPDATE lychee_photos SET public = '$public' WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$result) return false; - return true; -} -function setPhotoStar($photoID) { - global $database; - $query = "SELECT star FROM lychee_photos WHERE id = '$photoID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - if ($row->star == 0) { - $star = 1; - } else { - $star = 0; - } - $query = "UPDATE lychee_photos SET star = '$star' WHERE id = '$photoID';"; - $result = $database->query($query); - return true; -} -function getNextPhotoID($photoID, $albumID, $innerCall) { - global $database, $sorting; - if (!$innerCall&&$sorting=="ASC") return getPreviousPhotoID($photoID, $albumID, true); - switch($albumID) { - case 'f': $query = "SELECT id FROM lychee_photos WHERE id < '$photoID' AND star = '1' ORDER BY id DESC LIMIT 0, 1;"; - break; - case 's': $query = "SELECT id FROM lychee_photos WHERE id < '$photoID' AND public = '1' ORDER BY id DESC LIMIT 0, 1;"; - break; - default: $query = "SELECT id FROM lychee_photos WHERE id < '$photoID' AND album = '$albumID' ORDER BY id DESC LIMIT 0, 1;"; - } - $result = $database->query($query); - $return = $result->fetch_array(); - if (!$return || ($return==0)) { - switch($albumID) { - case 'f': $query = "SELECT id FROM lychee_photos WHERE star = '1' ORDER BY id DESC LIMIT 0, 1;"; - break; - case 's': $query = "SELECT id FROM lychee_photos WHERE public = '1' ORDER BY id DESC LIMIT 0, 1;"; - break; - default: $query = "SELECT id FROM lychee_photos WHERE album = '$albumID' ORDER BY id DESC LIMIT 0, 1;"; - } - $result = $database->query($query); - $return = $result->fetch_array(); - } - return $return['id']; -} -function getPreviousPhotoID($photoID, $albumID, $innerCall) { - global $database, $sorting; - if (!$innerCall&&$sorting=="ASC") return getNextPhotoID($photoID, $albumID, true); - switch($albumID) { - case 'f': $query = "SELECT id FROM lychee_photos WHERE id > '$photoID' AND star = '1' ORDER BY id LIMIT 0, 1;"; - break; - case 's': $query = "SELECT id FROM lychee_photos WHERE id > '$photoID' AND public = '1' ORDER BY id LIMIT 0, 1;"; - break; - default: $query = "SELECT id FROM lychee_photos WHERE id > '$photoID' AND album = '$albumID' ORDER BY id LIMIT 0, 1;"; - } - $result = $database->query($query); - $return = $result->fetch_array(); - if (!$return || ($return==0)) { - switch($albumID) { - case 'f': $query = "SELECT id FROM lychee_photos WHERE star = '1' ORDER BY id LIMIT 0, 1;"; - break; - case 's': $query = "SELECT id FROM lychee_photos WHERE public = '1' ORDER BY id LIMIT 0, 1;"; - break; - default: $query = "SELECT id FROM lychee_photos WHERE album = '$albumID' ORDER BY id LIMIT 0, 1;"; - } - $result = $database->query($query); - $return = $result->fetch_array(); - } - return $return['id']; -} -function setAlbum($photoID, $newAlbum) { - global $database; - $query = "UPDATE lychee_photos SET album = '$newAlbum' WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$result) return false; - else return true; -} -function setPhotoTitle($photoID, $title) { - global $database; - $title = mysqli_real_escape_string($database, urldecode($title)); - if (strlen($title)>30) return false; - $query = "UPDATE lychee_photos SET title = '$title' WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$result) return false; - else return true; -} -function setPhotoDescription($photoID, $description) { - global $database; - $description = mysqli_real_escape_string($database, htmlentities($description)); - if (strlen($description)>160) return false; - $query = "UPDATE lychee_photos SET description = '$description' WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$result) return false; - return true; -} -function deletePhoto($photoID) { - global $database; - $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$result) return false; - $row = $result->fetch_object(); - $retinaUrl = explode(".", $row->thumbUrl); - $unlink1 = unlink("../uploads/big/".$row->url); - $unlink2 = unlink("../uploads/thumb/".$row->thumbUrl); - $unlink3 = unlink("../uploads/thumb/".$retinaUrl[0].'@2x.'.$retinaUrl[1]); - $query = "DELETE FROM lychee_photos WHERE id = '$photoID';"; - $result = $database->query($query); - if (!$unlink1 || !$unlink2 || !$unlink3) return false; - if (!$result) return false; - return true; -} -function importPhoto($name, $albumID) { - $tmp_name = "../uploads/import/$name"; - $details = getimagesize($tmp_name); - $size = filesize($tmp_name); - $nameFile = array(array()); - $nameFile[0]['name'] = $name; - $nameFile[0]['type'] = $details['mime']; - $nameFile[0]['tmp_name'] = $tmp_name; - $nameFile[0]['error'] = 0; - $nameFile[0]['size'] = $size; - if (!upload($nameFile, $albumID)) return false; - else return true; -} -function importUrl($url, $albumID) { - if (@getimagesize($url)) { - $pathinfo = pathinfo($url); - $filename = $pathinfo['filename'].".".$pathinfo['extension']; - $tmp_name = "../uploads/import/$filename"; - copy($url, $tmp_name); - return importPhoto($filename, $albumID); - } else { - return false; - } -} - -// Share Functions -function facebookHeader($photoID) { - $database = dbConnect(); - if (!is_numeric($photoID)) return false; - $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; - $result = $database->query($query); - $row = $result->fetch_object(); - - $parseUrl = parse_url("http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); - $thumb = $parseUrl['scheme']."://".$parseUrl['host'].$parseUrl['path']."/../uploads/big/".$row->thumbUrl; - - $return .= ''; - $return = ''; - $return .= ''; - $return .= ''; - - $return .= ''; - $return .= ''; - $return .= ''; - $return .= ''; - - $return .= ''; - $return .= ''; - $return .= ''; - - return $return; -} -function isPhotoPublic($photoID, $password) { - global $database; - $photoID = mysqli_real_escape_string($database, $photoID); - if (is_numeric($photoID)) { - $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; - } else { - $query = "SELECT * FROM lychee_photos WHERE import_name = '../uploads/import/$photoID';"; - } - $result = $database->query($query); - $row = $result->fetch_object(); - if (!is_numeric($photoID)&&!$row) return true; - if ($row->public==1) return true; - else { - $cAP = checkAlbumPassword($row->album, $password); - $iAP = isAlbumPublic($row->album); - if ($iAP&&$cAP) return true; - else return false; - } -} - -// Search Function -function search($term) { - global $database, $sorting; - $return["albums"] = ""; - $term = mysqli_real_escape_string($database, $term); - - $query = "SELECT * FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%';"; - $result = $database->query($query); - while($row = $result->fetch_array()) { - $return['photos'][$row['id']] = $row; - } - - $query = "SELECT * FROM lychee_albums WHERE title like '%$term%';"; - $result = $database->query($query); - $i=0; - while($row = $result->fetch_object()) { - - $return["albums"][$row->id]['id'] = $row->id; - $return["albums"][$row->id]['title'] = $row->title; - $return["albums"][$row->id]['public'] = $row->public; - $return["albums"][$row->id]['sysdate'] = $row->sysdate; - if ($row->password=="") $return["albums"][$row->id]['password'] = false; - else $return["albums"][$row->id]['password'] = true; - - $query2 = "SELECT thumbUrl FROM lychee_photos WHERE album = '".$row->id."' ORDER BY id $sorting LIMIT 0, 3;"; - $result2 = $database->query($query2); - $k = 0; - while($row2 = $result2->fetch_object()){ - $return['albums'][$row->id]["thumb$k"] = $row2->thumbUrl; - $k++; - } - $i++; - - } - return $return; -} - -?> diff --git a/php/modules/album.php b/php/modules/album.php new file mode 100755 index 0000000..501f3f1 --- /dev/null +++ b/php/modules/album.php @@ -0,0 +1,354 @@ +30) return false; + $sysdate = date("d.m.Y"); + $result = $database->query("INSERT INTO lychee_albums (title, sysdate) VALUES ('$title', '$sysdate');"); + if (!$result) return false; + + return $database->insert_id; + +} + +function getAlbums($public) { + + global $database, $settings; + + // Smart Albums + if (!$public) $return = getSmartInfo(); + + // Albums + if ($public) $query = "SELECT * FROM lychee_albums WHERE public = 1"; + else $query = "SELECT * FROM lychee_albums"; + $result = $database->query($query) OR exit("Error: $result
".$database->error); + $i = 0; + while($row = $result->fetch_object()) { + + // Info + $return["content"][$row->id]['id'] = $row->id; + $return["content"][$row->id]['title'] = $row->title; + $return["content"][$row->id]['public'] = $row->public; + $return["content"][$row->id]['sysdate'] = date('F Y', strtotime($row->sysdate)); + if ($row->password=="") $return["content"][$row->id]['password'] = false; + else $return["content"][$row->id]['password'] = true; + + // Thumbs + if (($public&&$row->password=="")||(!$public)) { + $albumID = $row->id; + $result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '$albumID' ORDER BY star DESC, " . substr($settings['sorting'], 9) . " LIMIT 0, 3"); + $k = 0; + while($row2 = $result2->fetch_object()){ + $return["content"][$row->id]["thumb$k"] = $row2->thumbUrl; + $k++; + } + if (!isset($return["content"][$row->id]["thumb0"])) $return["content"][$row->id]["thumb0"] = ""; + if (!isset($return["content"][$row->id]["thumb1"])) $return["content"][$row->id]["thumb1"] = ""; + if (!isset($return["content"][$row->id]["thumb2"])) $return["content"][$row->id]["thumb2"] = ""; + } + + // Album count + $i++; + + } + + $return["num"] = $i; + + if ($i==0) $return["albums"] = false; + else $return["albums"] = true; + + return $return; + +} + +function getSmartInfo() { + + global $database, $settings; + + // Unsorted + $result = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $settings['sorting']); + $i = 0; + while($row = $result->fetch_object()) { + if ($i<3) $return["unsortedThumb$i"] = $row->thumbUrl; + $i++; + } + $return['unsortedNum'] = $i; + + // Public + $result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE public = 1 " . $settings['sorting']); + $i = 0; + while($row2 = $result2->fetch_object()) { + if ($i<3) $return["publicThumb$i"] = $row2->thumbUrl; + $i++; + } + $return['publicNum'] = $i; + + // Starred + $result3 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE star = 1 " . $settings['sorting']); + $i = 0; + while($row3 = $result3->fetch_object()) { + if ($i<3) $return["starredThumb$i"] = $row3->thumbUrl; + $i++; + } + $return['starredNum'] = $i; + + return $return; + +} + +function getAlbum($albumID) { + + global $database, $settings; + + // Get album information + switch($albumID) { + + case "f": $return['public'] = false; + $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE star = 1 " . $settings['sorting']; + break; + + case "s": $return['public'] = false; + $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE public = 1 " . $settings['sorting']; + break; + + case 0: $return['public'] = false; + $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE album = 0 " . $settings['sorting']; + + default: $result = $database->query("SELECT * FROM lychee_albums WHERE id = '$albumID';"); + $row = $result->fetch_object(); + $return['title'] = $row->title; + $return['description'] = $row->description; + $return['sysdate'] = date('d M. Y', strtotime($row->sysdate)); + $return['public'] = $row->public; + if ($row->password=="") $return['password'] = false; + else $return['password'] = true; + $query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE album = '$albumID' " . $settings['sorting']; + break; + + } + + // Get photos + $result = $database->query($query); + $previousPhotoID = ""; + $i = 0; + while($row = $result->fetch_array()) { + + $return['content'][$row['id']]['id'] = $row['id']; + $return['content'][$row['id']]['title'] = $row['title']; + $return['content'][$row['id']]['sysdate'] = date('d F Y', strtotime($row['sysdate'])); + $return['content'][$row['id']]['public'] = $row['public']; + $return['content'][$row['id']]['star'] = $row['star']; + $return['content'][$row['id']]['album'] = $row['album']; + $return['content'][$row['id']]['thumbUrl'] = $row['thumbUrl']; + + $return['content'][$row['id']]['previousPhoto'] = $previousPhotoID; + $return['content'][$row['id']]['nextPhoto'] = ""; + if ($previousPhotoID!="") $return['content'][$previousPhotoID]['nextPhoto'] = $row['id']; + + $previousPhotoID = $row['id']; + $i++; + + } + + if ($i==0) { + + // Empty album + $return['content'] = false; + + } else { + + // Enable next and previous for the first and last photo + $lastElement = end($return['content']); + $lastElementId = $lastElement['id']; + $firstElement = reset($return['content']); + $firstElementId = $firstElement['id']; + + if ($lastElementId!==$firstElementId) { + $return['content'][$lastElementId]['nextPhoto'] = $firstElementId; + $return['content'][$firstElementId]['previousPhoto'] = $lastElementId; + } + + } + + $return['id'] = $albumID; + $return['num'] = $i; + + return $return; + +} + +function setAlbumTitle($albumID, $title) { + + global $database; + + if (strlen($title)<1||strlen($title)>30) return false; + $result = $database->query("UPDATE lychee_albums SET title = '$title' WHERE id = '$albumID';"); + if (!$result) return false; + + return true; + +} + +function setAlbumDescription($albumID, $description) { + + global $database; + + $description = htmlentities($description); + if (strlen($description)>800) return false; + $result = $database->query("UPDATE lychee_albums SET description = '$description' WHERE id = '$albumID';"); + + if (!$result) return false; + return true; + +} + +function deleteAlbum($albumID, $delAll) { + + global $database; + + if ($delAll=="true") { + $result = $database->query("SELECT id FROM lychee_photos WHERE album = '$albumID';"); + $error = false; + while($row = $result->fetch_object()) { + if (!deletePhoto($row->id)) $error = true; + } + } else { + $result = $database->query("UPDATE lychee_photos SET album = '0' WHERE album = '$albumID';"); + if (!$result) return false; + } + + if ($albumID!=0) { + $result = $database->query("DELETE FROM lychee_albums WHERE id = '$albumID';"); + if (!$result) return false; + } + + if ($error) return false; + return true; + +} + +function getAlbumArchive($albumID) { + + global $database; + + switch($albumID) { + case 's': + $query = "SELECT * FROM lychee_photos WHERE public = '1';"; + $zipTitle = "Public"; + break; + case 'f': + $query = "SELECT * FROM lychee_photos WHERE star = '1';"; + $zipTitle = "Starred"; + break; + default: + $query = "SELECT * FROM lychee_photos WHERE album = '$albumID';"; + $zipTitle = "Unsorted"; + } + + $result = $database->query($query); + $files = array(); + $i=0; + while($row = $result->fetch_object()) { + $files[$i] = "../uploads/big/".$row->url; + $i++; + } + $result = $database->query("SELECT * FROM lychee_albums WHERE id = '$albumID';"); + $row = $result->fetch_object(); + if ($albumID!=0&&is_numeric($albumID))$zipTitle = $row->title; + $filename = "../uploads/".$zipTitle.".zip"; + + $zip = new ZipArchive(); + + if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) { + return false; + } + + foreach($files AS $zipFile) { + $newFile = explode("/",$zipFile); + $newFile = array_reverse($newFile); + $zip->addFile($zipFile, $zipTitle."/".$newFile[0]); + } + + $zip->close(); + + header("Content-Type: application/zip"); + header("Content-Disposition: attachment; filename=\"$zipTitle.zip\""); + header("Content-Length: ".filesize($filename)); + readfile($filename); + unlink($filename); + + return true; + +} + +function setAlbumPublic($albumID, $password) { + + global $database; + + $result = $database->query("SELECT public FROM lychee_albums WHERE id = '$albumID';"); + $row = $result->fetch_object(); + if ($row->public == 0){ + $public = 1; + } else { + $public = 0; + } + $result = $database->query("UPDATE lychee_albums SET public = '$public', password = NULL WHERE id = '$albumID';"); + if (!$result) return false; + if ($public==1) { + $result = $database->query("UPDATE lychee_photos SET public = 0 WHERE album = '$albumID';"); + if (!$result) return false; + } + + if (strlen($password)>0) return setAlbumPassword($albumID, $password); + else return true; + +} + +function setAlbumPassword($albumID, $password) { + + global $database; + + $result = $database->query("UPDATE lychee_albums SET password = '$password' WHERE id = '$albumID';"); + + if (!$result) return false; + return true; + +} + +function checkAlbumPassword($albumID, $password) { + + global $database; + + $result = $database->query("SELECT password FROM lychee_albums WHERE id = '$albumID';"); + $row = $result->fetch_object(); + if ($row->password=="") return true; + + else if ($row->password==$password) return true; + else return false; + +} + +function isAlbumPublic($albumID) { + + global $database; + + $result = $database->query("SELECT public FROM lychee_albums WHERE id = '$albumID';"); + $row = $result->fetch_object(); + + if ($row->public==1) return true; + else return false; + +} + +?> \ No newline at end of file diff --git a/php/modules/db.php b/php/modules/db.php new file mode 100755 index 0000000..792e2d6 --- /dev/null +++ b/php/modules/db.php @@ -0,0 +1,183 @@ +select_db($dbName)) + if (!createDatabase($dbName, $database)) exit('Error: Could not create database!'); + if (!$database->query("SELECT * FROM lychee_photos, lychee_albums, lychee_settings;")) + if (!createTables($database)) exit('Error: Could not create tables!'); + + return $database; + +} + +function dbClose() { + + global $database; + + if (!$database->close()) exit("Error: Closing the connection failed!"); + + return true; + +} + +function createConfig($dbHost = 'localhost', $dbUser, $dbPassword, $dbName = 'lychee') { + + $dbPassword = urldecode($dbPassword); + $database = new mysqli($dbHost, $dbUser, $dbPassword); + + if (mysqli_connect_errno()||$dbUser=="") return "Warning: Connection failed!"; + else { + +$config = ""; + + if (file_put_contents("config.php", $config)===false) return "Warning: Could not create file!"; + else { + + $_SESSION['login'] = true; + return true; + + } + + } + +} + +function createDatabase($dbName, $database) { + + $result = $database->query("CREATE DATABASE IF NOT EXISTS $dbName;"); + $database->select_db($dbName); + + if (!$database->select_db($dbName)||!$result) return false; + return true; + +} + +function createTables($database) { + + if (!$database->query("SELECT * FROM lychee_settings;")) { + + $query = " + + CREATE TABLE `lychee_settings` ( + `key` varchar(50) NOT NULL DEFAULT '', + `value` varchar(50) DEFAULT '' + ) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + "; + + if (!$database->query($query)) return false; + + $query = " + + INSERT INTO `lychee_settings` (`key`, `value`) + VALUES + ('username',''), + ('password',''), + ('thumbQuality','90'), + ('checkForUpdates','1'), + ('sorting','ORDER BY id DESC'); + + "; + + if (!$database->query($query)) return false; + + } + + if (!$database->query("SELECT * FROM lychee_albums;")) { + + $query = " + + CREATE TABLE `lychee_albums` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(50) NOT NULL, + `description` varchar(1000) DEFAULT '', + `sysdate` varchar(10) NOT NULL, + `public` tinyint(1) DEFAULT '0', + `password` varchar(100) DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + "; + + if (!$database->query($query)) return false; + + } + + if (!$database->query("SELECT * FROM lychee_photos;")) { + + $query = " + + CREATE TABLE `lychee_photos` ( + `id` bigint(14) NOT NULL, + `title` varchar(50) NOT NULL, + `description` varchar(1000) NOT NULL DEFAULT '', + `url` varchar(100) NOT NULL, + `public` tinyint(1) NOT NULL, + `type` varchar(10) NOT NULL, + `width` int(11) NOT NULL, + `height` int(11) NOT NULL, + `size` varchar(20) NOT NULL, + `sysdate` varchar(10) NOT NULL, + `systime` varchar(8) NOT NULL, + `iso` varchar(15) NOT NULL, + `aperture` varchar(20) NOT NULL, + `make` varchar(20) NOT NULL, + `model` varchar(50) NOT NULL, + `shutter` varchar(30) NOT NULL, + `focal` varchar(20) NOT NULL, + `takedate` varchar(20) NOT NULL, + `taketime` varchar(8) NOT NULL, + `star` tinyint(1) NOT NULL, + `thumbUrl` varchar(50) NOT NULL, + `album` varchar(30) NOT NULL DEFAULT '0', + `import_name` varchar(100) DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + "; + + if (!$database->query($query)) return false; + + } + + return true; + +} + +?> \ No newline at end of file diff --git a/php/modules/misc.php b/php/modules/misc.php new file mode 100755 index 0000000..62852ba --- /dev/null +++ b/php/modules/misc.php @@ -0,0 +1,95 @@ +query("SELECT * FROM lychee_photos WHERE id = '$photoID';"); + $row = $result->fetch_object(); + + $parseUrl = parse_url("http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); + $picture = $parseUrl['scheme']."://".$parseUrl['host'].$parseUrl['path']."/../uploads/big/".$row->url; + + $return = ''; + $return .= ''; + $return .= ''; + $return .= ''; + + $return .= ''; + $return .= ''; + $return .= ''; + $return .= ''; + + $return .= ''; + $return .= ''; + $return .= ''; + + return $return; + +} + +function search($term) { + + global $database, $settings; + + $return["albums"] = ""; + + $result = $database->query("SELECT * FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%';"); + while($row = $result->fetch_array()) { + $return['photos'][$row['id']] = $row; + $return['photos'][$row['id']]['sysdate'] = date('d F Y', strtotime($row['sysdate'])); + } + + $result = $database->query("SELECT * FROM lychee_albums WHERE title like '%$term%';"); + $i=0; + while($row = $result->fetch_object()) { + + $return["albums"][$row->id]['id'] = $row->id; + $return["albums"][$row->id]['title'] = $row->title; + $return["albums"][$row->id]['public'] = $row->public; + $return["albums"][$row->id]['sysdate'] = date('F Y', strtotime($row->sysdate)); + if ($row->password=="") $return["albums"][$row->id]['password'] = false; + else $return["albums"][$row->id]['password'] = true; + + $result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '" . $row->id . "' " . $settings['sorting'] . " LIMIT 0, 3;"); + $k = 0; + while($row2 = $result2->fetch_object()){ + $return['albums'][$row->id]["thumb$k"] = $row2->thumbUrl; + $k++; + } + $i++; + + } + + return $return; + +} + +function update() { + + global $database; + + if(!$database->query("SELECT `public` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `public` TINYINT( 1 ) NOT NULL DEFAULT '0'"); + if(!$database->query("SELECT `password` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `password` VARCHAR( 100 ) NULL DEFAULT ''"); + if(!$database->query("SELECT `description` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `description` VARCHAR( 1000 ) NULL DEFAULT ''"); + if($database->query("SELECT `password` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` CHANGE `password` `password` VARCHAR( 100 ) NULL DEFAULT ''"); + + if($database->query("SELECT `description` FROM `lychee_photos`;")) $database->query("ALTER TABLE `lychee_photos` CHANGE `description` `description` VARCHAR( 1000 ) NULL DEFAULT ''"); + if($database->query("SELECT `shortlink` FROM `lychee_photos`;")) $database->query("ALTER TABLE `lychee_photos` DROP `shortlink`"); + $database->query("UPDATE `lychee_photos` SET url = replace(url, 'uploads/big/', ''), thumbUrl = replace(thumbUrl, 'uploads/thumb/', '')"); + + return true; + +} + +?> diff --git a/php/modules/photo.php b/php/modules/photo.php new file mode 100755 index 0000000..9a21774 --- /dev/null +++ b/php/modules/photo.php @@ -0,0 +1,167 @@ +query("SELECT COUNT(*) AS quantity FROM lychee_photos WHERE import_name = '../uploads/import/$photoID';"); + $row = $result->fetch_object(); + if ($row->quantity == 0) { + importPhoto($photoID, 's'); + } + if (is_file("../uploads/import/$photoID")) { + importPhoto($photoID, 's'); + } + $query = "SELECT * FROM lychee_photos WHERE import_name = '../uploads/import/$photoID' ORDER BY ID DESC;"; + } else { + $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; + } + + $result = $database->query($query); + $return = $result->fetch_array(); + + if ($albumID!='false') { + + if ($return['album']!=0) { + + $result = $database->query("SELECT public FROM lychee_albums WHERE id = " . $return['album'] . ";"); + $return_album = $result->fetch_array(); + if ($return_album['public']=="1") $return['public'] = "2"; + + } + + $return['original_album'] = $return['album']; + $return['album'] = $albumID; + $return['sysdate'] = date('d M. Y', strtotime($return['sysdate'])); + if (strlen($return['takedate'])>0) $return['takedate'] = date('d M. Y', strtotime($return['takedate'])); + + } + + unset($return['album_public']); + + return $return; + +} + +function setPhotoPublic($photoID, $url) { + + global $database; + + $result = $database->query("SELECT public FROM lychee_photos WHERE id = '$photoID';"); + $row = $result->fetch_object(); + if ($row->public == 0){ + $public = 1; + } else { + $public = 0; + } + $result = $database->query("UPDATE lychee_photos SET public = '$public' WHERE id = '$photoID';"); + + if (!$result) return false; + return true; + +} + +function setPhotoStar($photoID) { + + global $database; + + $result = $database->query("SELECT star FROM lychee_photos WHERE id = '$photoID';"); + $row = $result->fetch_object(); + if ($row->star == 0) { + $star = 1; + } else { + $star = 0; + } + $result = $database->query("UPDATE lychee_photos SET star = '$star' WHERE id = '$photoID';"); + return true; + +} + +function setAlbum($photoID, $newAlbum) { + + global $database; + + $result = $database->query("UPDATE lychee_photos SET album = '$newAlbum' WHERE id = '$photoID';"); + + if (!$result) return false; + else return true; + +} + +function setPhotoTitle($photoID, $title) { + + global $database; + + if (strlen($title)>30) return false; + $result = $database->query("UPDATE lychee_photos SET title = '$title' WHERE id = '$photoID';"); + + if (!$result) return false; + else return true; + +} + +function setPhotoDescription($photoID, $description) { + + global $database; + + $description = htmlentities($description); + if (strlen($description)>800) return false; + $result = $database->query("UPDATE lychee_photos SET description = '$description' WHERE id = '$photoID';"); + + if (!$result) return false; + return true; + +} + +function deletePhoto($photoID) { + + global $database; + + $result = $database->query("SELECT * FROM lychee_photos WHERE id = '$photoID';"); + if (!$result) return false; + $row = $result->fetch_object(); + $retinaUrl = explode(".", $row->thumbUrl); + $unlink1 = unlink("../uploads/big/".$row->url); + $unlink2 = unlink("../uploads/thumb/".$row->thumbUrl); + $unlink3 = unlink("../uploads/thumb/".$retinaUrl[0].'@2x.'.$retinaUrl[1]); + $result = $database->query("DELETE FROM lychee_photos WHERE id = '$photoID';"); + if (!$unlink1 || !$unlink2 || !$unlink3) return false; + if (!$result) return false; + + return true; + +} + +function isPhotoPublic($photoID, $password) { + + global $database; + + if (is_numeric($photoID)) { + $query = "SELECT * FROM lychee_photos WHERE id = '$photoID';"; + } else { + $query = "SELECT * FROM lychee_photos WHERE import_name = '../uploads/import/$photoID';"; + } + $result = $database->query($query); + $row = $result->fetch_object(); + if (!is_numeric($photoID)&&!$row) return true; + if ($row->public==1) return true; + else { + $cAP = checkAlbumPassword($row->album, $password); + $iAP = isAlbumPublic($row->album); + if ($iAP&&$cAP) return true; + else return false; + } + +} + +?> \ No newline at end of file diff --git a/php/modules/session.php b/php/modules/session.php new file mode 100755 index 0000000..ae42083 --- /dev/null +++ b/php/modules/session.php @@ -0,0 +1,64 @@ + \ No newline at end of file diff --git a/php/modules/settings.php b/php/modules/settings.php new file mode 100755 index 0000000..1c9246a --- /dev/null +++ b/php/modules/settings.php @@ -0,0 +1,137 @@ +query('SELECT * FROM lychee_settings;'); + + while($row = $result->fetch_object()) { + $return[$row->key] = $row->value; + } + + return $return; + +} + +function setLogin($oldPassword = '', $username, $password) { + + global $settings; + + if ($oldPassword==$settings['password']) { + + if (!setUsername($username)) exit('Error: Updating username failed!'); + if (!setPassword($password)) exit('Error: Updating password failed!'); + + return true; + + } + + exit('Error: Current password entered incorrectly!'); + +} + +function setUsername($username) { + + global $database; + + $username = htmlentities($username); + if (strlen($username)>50) return false; + + $result = $database->query("UPDATE lychee_settings SET value = '$username' WHERE `key` = 'username';"); + + if (!$result) return false; + return true; + +} + +function setPassword($password) { + + global $database; + + if (strlen($password)<1||strlen($password)>50) return false; + + $result = $database->query("UPDATE lychee_settings SET value = '$password' WHERE `key` = 'password';"); + + if (!$result) return false; + return true; + +} + +/*function setCheckForUpdates() { + + global $database; + + $result = $database->query("SELECT value FROM lychee_settings WHERE `key` = 'checkForUpdates';"); + $row = $result->fetch_object(); + + if ($row->value==0) $checkForUpdates = 1; + else $checkForUpdates = 0; + + $result = $database->query("UPDATE lychee_settings SET value = '$checkForUpdates' WHERE `key` = 'checkForUpdates';"); + + if (!$result) return false; + return true; + +}*/ + +function setSorting($type, $order) { + + global $database; + + $sorting = 'ORDER BY '; + + switch ($type) { + + case 'id': $sorting .= 'id'; + break; + + case 'title': $sorting .= 'title'; + break; + + case 'description': $sorting .= 'description'; + break; + + case 'public': $sorting .= 'public'; + break; + + case 'type': $sorting .= 'type'; + break; + + case 'star': $sorting .= 'star'; + break; + + default: exit('Error: Unknown type for sorting!'); + + } + + $sorting .= ' '; + + switch ($order) { + + case 'ASC': $sorting .= 'ASC'; + break; + + case 'DESC': $sorting .= 'DESC'; + break; + + default: exit('Error: Unknown order for sorting!'); + + } + + $result = $database->query("UPDATE lychee_settings SET value = '$sorting' WHERE `key` = 'sorting';"); + + if (!$result) return false; + return true; + +} + +?> \ No newline at end of file diff --git a/php/modules/upload.php b/php/modules/upload.php new file mode 100755 index 0000000..699fd05 --- /dev/null +++ b/php/modules/upload.php @@ -0,0 +1,378 @@ +query($query); + + if (!$result) return false; + + } + + return true; + +} + +function getInfo($filename) { + + global $database; + + $url = '../uploads/big/' . $filename; + $iptcArray = array(); + $info = getimagesize($url, $iptcArray); + + // General information + $return['type'] = $info['mime']; + $return['width'] = $info[0]; + $return['height'] = $info[1]; + $return['date'] = date('d.m.Y', filectime($url)); + $return['time'] = date('H:i:s', filectime($url)); + + // Size + $size = filesize($url)/1024; + if ($size>=1024) $return['size'] = round($size/1024, 1) . ' MB'; + else $return['size'] = round($size, 1) . ' KB'; + + // IPTC Metadata Fallback + $return['title'] = ''; + $return['description'] = ''; + + // IPTC Metadata + $iptcInfo = iptcparse($iptcArray['APP13']); + if (is_array($iptcInfo)) { + + $temp = $iptcInfo['2#105'][0]; + if (isset($temp)&&strlen($temp)>0) $return['title'] = $temp; + + $temp = $iptcInfo['2#120'][0]; + if (isset($temp)&&strlen($temp)>0) $return['description'] = $temp; + + } + + // EXIF Metadata Fallback + $return['orientation'] = ''; + $return['iso'] = ''; + $return['aperture'] = ''; + $return['make'] = ''; + $return['model'] = ''; + $return['shutter'] = ''; + $return['focal'] = ''; + $return['takeDate'] = ''; + $return['takeTime'] = ''; + + // EXIF Metadata + if ($info['mime']=='image/jpeg'&&function_exists('exif_read_data')&&@exif_read_data($url, 'EXIF', 0)) { + + $exif = exif_read_data($url, 'EXIF', 0); + + $temp = $exif['Orientation']; + if (isset($temp)) $return['orientation'] = $temp; + + $temp = $exif['ISOSpeedRatings']; + if (isset($temp)) $return['iso'] = $temp; + + $temp = $exif['COMPUTED']['ApertureFNumber']; + if (isset($temp)) $return['aperture'] = $temp; + + $temp = $exif['Make']; + if (isset($temp)) $return['make'] = $exif['Make']; + + $temp = $exif['Model']; + if (isset($temp)) $return['model'] = $temp; + + $temp = $exif['ExposureTime']; + if (isset($temp)) $return['shutter'] = $exif['ExposureTime'] . ' Sec.'; + + $temp = $exif['FocalLength']; + if (isset($temp)) $return['focal'] = ($temp/1) . ' mm'; + + $temp = $exif['DateTimeOriginal']; + if (isset($temp)) { + $exifDate = explode(' ', $temp); + $date = explode(':', $exifDate[0]); + $return['takeDate'] = $date[2].'.'.$date[1].'.'.$date[0]; + $return['takeTime'] = $exifDate[1]; + } + + } + + // Security + foreach(array_keys($return) as $key) $return[$key] = mysqli_real_escape_string($database, $return[$key]); + + return $return; + +} + +function createThumb($filename, $width = 200, $height = 200) { + + global $settings; + + $url = "../uploads/big/$filename"; + $info = getimagesize($url); + + $photoName = explode(".", $filename); + $newUrl = "../uploads/thumb/".$photoName[0].".jpeg"; + $newUrl2x = "../uploads/thumb/".$photoName[0]."@2x.jpeg"; + + // Set position and size + $thumb = imagecreatetruecolor($width, $height); + $thumb2x = imagecreatetruecolor($width*2, $height*2); + if ($info[0]<$info[1]) { + $newSize = $info[0]; + $startWidth = 0; + $startHeight = $info[1]/2 - $info[0]/2; + } else { + $newSize = $info[1]; + $startWidth = $info[0]/2 - $info[1]/2; + $startHeight = 0; + } + + // Create new image + switch($info['mime']) { + case 'image/jpeg': $sourceImg = imagecreatefromjpeg($url); break; + case 'image/png': $sourceImg = imagecreatefrompng($url); break; + case 'image/gif': $sourceImg = imagecreatefromgif($url); break; + default: return false; + } + + imagecopyresampled($thumb,$sourceImg,0,0,$startWidth,$startHeight,$width,$height,$newSize,$newSize); + imagecopyresampled($thumb2x,$sourceImg,0,0,$startWidth,$startHeight,$width*2,$height*2,$newSize,$newSize); + + imagejpeg($thumb,$newUrl,$settings['thumbQuality']); + imagejpeg($thumb2x,$newUrl2x,$settings['thumbQuality']); + + return true; + +} + +function importPhoto($name, $albumID = 0) { + + $tmp_name = "../uploads/import/$name"; + $info = getimagesize($tmp_name); + $size = filesize($tmp_name); + $nameFile = array(array()); + $nameFile[0]['name'] = $name; + $nameFile[0]['type'] = $info['mime']; + $nameFile[0]['tmp_name'] = $tmp_name; + $nameFile[0]['error'] = 0; + $nameFile[0]['size'] = $size; + + if (upload($nameFile, $albumID)) return true; + + return false; + +} + +function importUrl($url, $albumID = 0) { + + if (strpos($url, ',')!==false) { + + // Multiple photos + + $url = explode(',', $url); + + foreach ($url as &$key) { + + $key = str_replace(' ', '%20', $key); + + if (@getimagesize($key)) { + + $pathinfo = pathinfo($key); + $filename = $pathinfo['filename'].".".$pathinfo['extension']; + $tmp_name = "../uploads/import/$filename"; + copy($key, $tmp_name); + + } + + } + + return importServer($albumID); + + } else { + + // One photo + + $url = str_replace(' ', '%20', $url); + + if (@getimagesize($url)) { + + $pathinfo = pathinfo($url); + $filename = $pathinfo['filename'].".".$pathinfo['extension']; + $tmp_name = "../uploads/import/$filename"; + copy($url, $tmp_name); + return importPhoto($filename, $albumID); + + } + + } + + return false; + +} + +function importServer($albumID = 0) { + + global $database; + + $i = 0; + $files = glob('../uploads/import/*'); + + foreach ($files as $file) { + + if (@getimagesize($file)) { + if (!importPhoto(basename($file), $albumID)) return false; + $i++; + } + + } + + if ($i===0) return "Warning: Folder empty!"; + return true; + +} + +?> \ No newline at end of file diff --git a/php/update.php b/php/update.php deleted file mode 100644 index e4fdadd..0000000 --- a/php/update.php +++ /dev/null @@ -1,17 +0,0 @@ -query("SELECT `public` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `public` TINYINT( 1 ) NOT NULL DEFAULT '0'"); - if(!$database->query("SELECT `password` FROM `lychee_albums`;")) $database->query("ALTER TABLE `lychee_albums` ADD `password` VARCHAR( 100 ) NULL DEFAULT NULL"); - $database->query("UPDATE `lychee_photos` SET url = replace(url, 'uploads/big/', ''), thumbUrl = replace(thumbUrl, 'uploads/thumb/', '')"); - echo "\nUpdate complete!"; -} else { - echo "\nCould not Update!"; -} - -?> \ No newline at end of file diff --git a/plugins/check.php b/plugins/check.php new file mode 100644 index 0000000..eb51a5f --- /dev/null +++ b/plugins/check.php @@ -0,0 +1,65 @@ + \ No newline at end of file diff --git a/readme.md b/readme.md index ef6891f..7702ed8 100644 --- a/readme.md +++ b/readme.md @@ -2,71 +2,66 @@ #### A great looking and easy-to-use Photo-Management-System. -![Lychee](http://l.electerious.com/uploads/big/13582806160093.png) -![Lychee](http://l.electerious.com/uploads/big/13582805615704.png) +![Lychee](http://l.electerious.com/uploads/big/136b4779d133a94666d5f0d151b8ea2f.png) +![Lychee](http://l.electerious.com/uploads/big/580f1300f884c330fa34b652decb0571.png) -Lychee is a free, easy to use and great looking photo-management-system you can run on your server to manage and share photos. Just download the source and follow the instructions to install Lychee wherever you want. +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. ## Installation -To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. Follow the instructions to install Lychee on your server. [Installation »](https://github.com/electerious/Lychee/wiki/Installation) +To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database. Follow the instructions to install Lychee on your server. [Installation »](docs/md/Installation.md) -## Settings +## How to use -Settings are located inside the `php/config.php`. All settings are optional and doesn't need to be changed. [Settings »](https://github.com/electerious/Lychee/wiki/Settings) +You can use Lychee right after the installation. Here are some advanced features to get the most out of it. -## How to use +### Settings -After the configuration, navigate your browser to the place where Lychee is located. Everything should work now. +Sign in and click the gear on the top left corner to change your settings. If you want to edit them manually: MySQL details are stored in `php/config.php`. Other options and settings are stored directly in the database. [Settings »](docs/md/Settings.md) -#### FTP Upload +### Update -You can upload photos directly with every FTP client into Lychee. This feature helps you to share single images quickly with others. [FTP Upload »](https://github.com/electerious/Lychee/wiki/FTP-Upload) +1. Replace all files, excluding `uploads/` +2. Open Lychee and enter your database details -#### Keyboard Shortcuts +### FTP Upload -This shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](https://github.com/electerious/Lychee/wiki/Keyboard-Shortcuts) +You can import photos from your server or upload photos directly with every FTP client into Lychee. [FTP Upload »](docs/md/FTP Upload.md) -#### Twitter Cards +### Keyboard Shortcuts -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). +These shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](docs/md/Keyboard Shortcuts.md) -## Browser Support +### Twitter Cards -Lychee supports the latest versions of Google Chrome, Apple Safari, Mozilla Firefox and Opera. Photos you share with others can be viewed from every browser. For the best experience we are recommending to use Google Chrome or Apple Safari. +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). -## Update +## Troubleshooting -####From version 1.0/1.1/1.2 to 1.3: -1. Replace all files, excluding `uploads/` -2. Open `php/config.php` and reconfigure your installation -3. Open `php/update.php` in your browser +Take a look at the [FAQ](docs/md/faq.md) if you have problems. ## Extensions | Name | Description | Link | |:-----------|:------------|:------------| -| lycheesync | Command line interface tool to sync lychee with any directory containing photos | https://github.com/GustavePate/lycheesync | - -## Troubleshooting - -If Lychee is not working properly, try to open `php/check.php`. This file will take a look at your configuration and displays all errors it can find. Everything should work if you can see the message "Lychee is ready!". - -If you experience problems uploading large amounts of photos, you might want to change the PHP parameters in `.htaccess` (if you are using the PHP Apache module) or in `.user.ini` (if you are using PHP >= 5.3 with CGI or FastCGI). +| lycheesync | Sync Lychee with any directory containing photos | https://github.com/GustavePate/lycheesync | -## About +## Developer +- [electerious](https://github.com/electerious) / [Tobias Reich](http://electerious.com) -Lychee is made by [Tobias Reich](http://electerious.com) (HTML, CSS, JS, Design, Website Design and Development) with the help of [Philipp Maurer](http://phinal.net) (PHP, MySQL). +## Contributors +- [phinal](https://github.com/phinal) / [Philipp Maurer](http://phinal.net) +- [cdauth](https://github.com/cdauth) ##License (MIT License) -Copyright (C) 2013 [Tobias Reich](http://electerious.com) -Copyright (C) 2013 [Philipp Maurer](http://phinal.net) +Copyright (C) 2014 [Tobias Reich](http://electerious.com) +Copyright (C) 2013 [Philipp Maurer](http://phinal.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.SE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/uploads/big/index.html b/uploads/big/index.html old mode 100644 new mode 100755 diff --git a/uploads/import/index.html b/uploads/import/index.html old mode 100644 new mode 100755 diff --git a/uploads/thumb/index.html b/uploads/thumb/index.html old mode 100644 new mode 100755 diff --git a/view.php b/view.php old mode 100755 new mode 100644 index 7d121fe..1a08813 --- a/view.php +++ b/view.php @@ -9,10 +9,10 @@ - - - - + + + + @@ -25,19 +25,22 @@ define("LYCHEE", true); require("php/config.php"); - require("php/functions.php"); + require("php/modules/db.php"); + require("php/modules/misc.php"); + + $database = dbConnect(); - echo facebookHeader($_GET['p']); + echo openGraphHeader($_GET['p']); } ?> - + -
+
@@ -48,16 +51,16 @@
-
+
- - - + + + -> \ No newline at end of file + \ No newline at end of file