From d991eef2c97ad351f54ae106cec4181a13cc2d89 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 23 Jul 2014 21:58:41 +0200 Subject: [PATCH] User can set the import-path #187 --- assets/js/upload.js | 17 +++++++++++------ assets/min/main.js | 10 +++++----- php/access/Admin.php | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/assets/js/upload.js b/assets/js/upload.js index e447241..66c8c94 100755 --- a/assets/js/upload.js +++ b/assets/js/upload.js @@ -198,7 +198,7 @@ upload = { } upload.show("Importing URL", files, function() { - $(".upload_message .rows .row:nth-child(1) .status").html("Importing"); + $(".upload_message .rows .row .status").html("Importing"); }); params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID; @@ -229,21 +229,26 @@ upload = { var albumID = album.getID(), params, buttons, - files = []; + files = [], + path; if (albumID===false) albumID = 0; buttons = [ ["Import", function() { + path = $(".message input.text").val(); + files[0] = { - name: "uploads/import/", + name: path, supported: true }; - upload.show("Importing from server", files); + upload.show("Importing from server", files, function() { + $(".upload_message .rows .row .status").html("Importing"); + }); - params = "importServer&albumID=" + albumID; + params = "importServer&albumID=" + albumID + "&path=" + escape(encodeURI(path)); lychee.api(params, function(data) { upload.close(); @@ -266,7 +271,7 @@ upload = { ["Cancel", function() {}] ]; - modal.show("Import from Server", "This action will import all photos and albums which are located in 'uploads/import/' of your Lychee installation.", buttons); + modal.show("Import from Server", "This action will import all photos and albums which are located in the following directory: ", buttons); }, diff --git a/assets/min/main.js b/assets/min/main.js index 76dcd45..fc4c7d1 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("