diff --git a/assets/js/album.js b/assets/js/album.js index 37c69bd..f0f60b8 100644 --- a/assets/js/album.js +++ b/assets/js/album.js @@ -287,11 +287,12 @@ album = { var params, password = "", - listed = false; + listed = false, + downloadable = false; if (!visible.message()&&album.json.public==0) { - modal.show("Share Album", "This album will be shared with the following properties:

Visible

Listed to visitors of your Lychee.

Password protected

Only accessible with a valid password.

", [["Share Album", function() { album.setPublic(album.getID(), e) }], ["Cancel", function() {}]], -160); + modal.show("Share Album", "This album will be shared with the following properties:

Visible

Listed to visitors of your Lychee.

Downloadable

Visitors of your Lychee can download this album.

Password protected

Only accessible with a valid password.

", [["Share Album", function() { album.setPublic(album.getID(), e) }], ["Cancel", function() {}]], -170); $(".message .choice input[name='password']").on("change", function() { @@ -315,10 +316,11 @@ album = { } if ($(".message .choice input[name='listed']:checked").val()==="listed") listed = true; + if ($(".message .choice input[name='downloadable']:checked").val()==="downloadable") downloadable = true; } - params = "setAlbumPublic&albumID=" + albumID + "&password=" + password + "&visible=" + listed; + params = "setAlbumPublic&albumID=" + albumID + "&password=" + password + "&visible=" + listed + "&downloadable=" + downloadable; if (visible.album()) { diff --git a/assets/js/build.js b/assets/js/build.js index 00e9527..dbe50ed 100644 --- a/assets/js/build.js +++ b/assets/js/build.js @@ -309,13 +309,13 @@ build = { switch (photoJSON.public) { case "0": - public = "Private"; + public = "No"; break; case "1": - public = "Public"; + public = "Yes"; break; case "2": - public = "Public (Album)"; + public = "Yes (Album)"; break; default: public = "-"; @@ -354,7 +354,7 @@ build = { infos = infos.concat([ ["", "Share"], - ["Visibility", public] + ["Public", public] ]); $.each(infos, function(index) { @@ -401,8 +401,9 @@ build = { if (!albumJSON) return ""; var infobox = "", - public, - password, + public = "-", + password = "-", + downloadable = "-", editTitleHTML, editDescriptionHTML, infos; @@ -412,13 +413,10 @@ build = { switch (albumJSON.public) { case "0": - public = "Private"; + public = "No"; break; case "1": - public = "Public"; - break; - default: - public = "-"; + public = "Yes"; break; } @@ -429,8 +427,14 @@ build = { case true: password = "Yes"; break; - default: - password = "-"; + } + + switch (albumJSON.downloadable) { + case "0": + downloadable = "No"; + break; + case "1": + downloadable = "Yes"; break; } @@ -445,7 +449,8 @@ build = { ["Created", albumJSON.sysdate], ["Images", albumJSON.num], ["", "Share"], - ["Visibility", public], + ["Public", public], + ["Downloadable", downloadable], ["Password", password] ]; diff --git a/assets/js/contextMenu.js b/assets/js/contextMenu.js index 155a964..8e0c528 100644 --- a/assets/js/contextMenu.js +++ b/assets/js/contextMenu.js @@ -223,10 +223,8 @@ contextMenu = { function() { photo.getArchive(photoID) } ]; - items = [ - [" Full Photo", 0], - [" Download", 1] - ]; + items = [[" Full Photo", 0]]; + if ((album.json&&album.json.downloadable&&album.json.downloadable==="1"&&lychee.publicMode)||!lychee.publicMode) items.push([" Download", 1]); contextMenu.show(items, mouse_x, mouse_y, "right"); diff --git a/assets/js/lychee.js b/assets/js/lychee.js index f898100..4e66af5 100644 --- a/assets/js/lychee.js +++ b/assets/js/lychee.js @@ -8,8 +8,8 @@ var lychee = { title: "", - version: "2.6", - version_code: "020600", + version: "2.6.1", + version_code: "020601", api_path: "php/api.php", update_path: "http://lychee.electerious.com/version/index.php", @@ -157,8 +157,11 @@ var lychee = { goto: function(url) { - if (url===undefined) url = ""; - document.location.hash = url; + if (url===undefined) url = "#"; + else url = "#" + url; + + history.pushState(null, null, url); + lychee.load(); }, diff --git a/assets/js/view.js b/assets/js/view.js index 99daca0..42e210d 100644 --- a/assets/js/view.js +++ b/assets/js/view.js @@ -64,6 +64,7 @@ view = { $("#tools_albums, #tools_photo").hide(); $("#tools_album").show(); album.json.content === false ? $("#button_archive").hide() : $("#button_archive").show(); + if (lychee.publicMode&&album.json.downloadable==="0") $("#button_archive").hide(); if (albumID==="s"||albumID==="f"||albumID==="r") { $("#button_info_album, #button_trash_album, #button_share_album").hide(); } else if (albumID==="0") { @@ -237,12 +238,6 @@ view = { }, - description: function() { - - $("#infobox .attr_description").html(album.json.description + " " + build.editIcon("edit_description_album")); - - }, - content: { init: function() { @@ -307,6 +302,12 @@ view = { }, + description: function() { + + $("#infobox .attr_description").html(album.json.description + " " + build.editIcon("edit_description_album")); + + }, + num: function() { $("#infobox .attr_images").html(album.json.num); diff --git a/assets/min/main.js b/assets/min/main.js index 6a6cd0a..a167628 100644 --- a/assets/min/main.js +++ b/assets/min/main.js @@ -1,6 +1,6 @@ -function mobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(J.isFunction(t))return J.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return J.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return J.filter(t,e,n);t=J.filter(t,e)}return J.grep(e,function(e){return z.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t=ft[e]={};return J.each(e.match(ht)||[],function(e,n){t[n]=!0}),t}function r(){Q.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1),J.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+Math.random()}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(wt,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:yt.test(n)?J.parseJSON(n):n}catch(i){}bt.set(e,t,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return Q.activeElement}catch(e){}}function p(e,t){return J.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Lt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,o=e.length;o>n;n++)vt.set(e[n],"globalEval",!t||vt.get(t[n],"globalEval"))}function g(e,t){var n,o,i,a,r,s,l,u;if(1===t.nodeType){if(vt.hasData(e)&&(a=vt.access(e),r=vt.set(t,a),u=a.events)){delete r.handle,r.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}bt.hasData(e)&&(s=bt.access(e),l=J.extend({},s),bt.set(t,l))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}function b(e,t){var n=t.nodeName.toLowerCase();"input"===n&&kt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(t,n){var o,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");return i.detach(),a}function w(e){var t=Q,n=Rt[e];return n||(n=y(e,t),"none"!==n&&n||(qt=(qt||J("