/* Photo.js Author: tobychui This is a complete rewrite of the legacy Photo module for ArozOS */ let photoList = []; function sideBarObject(){ return { tags: [], } } function folderObject() { return { // data pathWildcard: "user:/Photo/*.jpg", images: [], folders: [], // init init() { this.getFolderInfo() }, updateRenderingPath(newWidlcard){ this.pathWildcard = newWidlcard; this.getFolderInfo(); }, getFolderInfo() { fetch(ao_root + "system/ajgi/interface?script=Photo/backend/listFolder.js", { method: 'POST', cache: 'no-cache', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "folder": this.pathWildcard }) }).then(resp => { resp.json().then(data => { console.log(data); this.folders = data[0]; this.images = data[1]; }); }); } } } function showImage(object){ var fd = JSON.parse(decodeURIComponent($(object).attr("filedata"))); console.log(fd); }