Issue #1286Opened July 15, 2018by Barahten0 reactions

[Questions]: Download default assets in manager on init

Question

  1. I'm trying to implement an example as in a demo, namely: when clicking on a background image installation, a window pops up offering you to download files or select from already downloaded ones. Uploading to the server I successfully implemented, the files are loaded, saved in the desired folder, after they appear in the list of assets on the right, which you can click and apply to the background. But when updating the page and repeating all the above manipulations, the asset manager (the one on the left is empty).

As an example, by default, assets are specified as in the demo example (that is, pre-defined pictures with placehold.it), but again, the asset manager is always empty when opening.

The console displays a gjs-nl-asset with a list of specific images, but there are none in the resource list.

  1. When opening the asset manager on the left, there is always a single semi-transparent image that I did not ask or load. How to remove it

  2. For example, if you try to set a background image for "body", when you click on the icon with the plus of adding a background image, the message pops up in the console of the form htttp: //mysite.com/none, with the status 404 (Not Found) grapes.min.js:11 , so I understand that there is an attempt that download and what is not clear

I ask for help. Спасибо, Артур

Answers (3)

artfJuly 15, 20180 reactions

Hi @Barahten please try to provide a live demo for your issues, just can't help you without seeing how you set up the editor.

BarahtenJuly 15, 20180 reactions

@artf, work on real server http://gjs.barahten.com/ Pen - https://codepen.io/barahten/pen/QBygdY

The script works a little strangely. On the local server it works by uploading files to the folder but does not work on adding to the manager, either after downloading, or after brutally adding through the code, at the same time on a real combat server everything works correctly except for p.3

artfJuly 18, 20180 reactions

Regarding the first point

But when updating the page and repeating all the above manipulations, the asset manager (the one on the left is empty).

First of all, update the library, 0.12.17 is too much outdated actually

BTW, just to give you an overview of how stuff supposed to work. At the beginning, your assets are loaded from what you have defined in config.assetManager.assets but if you have configured the StorageManager and you're fetching a JSON object like this { 'gjs-assets': [{ src: '' }, ...], ... } (gjs- is a default value from config.storageManager.id) your assets will be replaced by gjs-assets array, so take care of this flow.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.