Custom UI by Max issue with Mac remote path

Next
 From:  chippwalters
7054.1 
Hi.
I really like the custom UI. I've set it up per instructions and installed a custom path in the ObjLibrary.cfg.htm file:
code:
Object Library;/Users/chipp/Dropbox/Moi/ObjectsDONTMOVE

This works fine except the previews don't work. In otherwords I can use the tool to save objects to remote folder, as well as load objects from remote folder, but the PNG preview does not display (it did when the cfg file pointed to the default location).

The PNG preview DOES EXIST in the folder and looks correct when opened.

Here's what I see:



FWIW, I did try all sorts of permutations of the path name: putting double "//" before and/or after as well as putting it in quotes.

Next, I looked into the ObjLibrary.menu.htm file and added at the correct location:
code:
document.write (iconname);

and it showed

(note the last backslash)

I was able to change the last backslash thinking THAT was the issue:
code:
iconname = iconname.replace("\\","/");
but that didn't work.

I then tried to HARD CODE the display of an image just to see if I could even get a local path image to display:
code:
document.write ('<div class="preview"><img class="icon" src="file:///Users/chipp/Dropbox/Moi/ObjectsDONTMOVE/Cube.png"></div>');


Still no image displayed. Any ideas on what else I can do to ObjLibrary.cfg.htm to get the images to preview correctly?

EDITED: 20 Nov 2014 by CHIPPWALTERS


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7054.2 In reply to 7054.1 
Hi Chipp - the web browser engine that MoI has embedded in it for the UI display probably does not know about UNIX paths and so that's probably what you are running into there.

The regular MoI UI does not use file:// paths at all and instead uses a special moi:// protocol which knows to load things from directories within MoI's own application package.

The system that MoI uses for running Windows code on the Mac can use a pretend z: drive to access things on the UNIX file system, you might try putting in a file:// path using a z: drive like this:

file:///z:/Users/chipp/Dropbox/Moi/ObjectsDONTMOVE

Does it work like that?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  chippwalters
7054.3 

Yup!


That's the ticket. So for the record,, to get this to work on Macs with custom paths, one would need to change in ObjLibrary.menu.htm (in drive_c/moi/ui/customui/mods/) the following line:
code:
if ( moi.filesystem.fileExists (iconname) ) { document.write ('<div class="preview"><img class="icon" src="'+ iconname.split("\\").join('/') +'?'+randomID+'"></div>'); }

to:
code:
if ( moi.filesystem.fileExists (iconname) ) { document.write ('<div class="preview"><img class="icon" src="file:///z:'+ iconname.split("\\").join('/') +'?'+randomID+'"></div>'); }

(note the addition of "file:///z")
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All