1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*
- 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);
- }
|