maqetta/maqetta — Issue #1260: Background dialog: file picker and URL mapping
Author: JonFerraiolo
Created: 2011-11-28 16:42:21+00:00
State: open
Labels: Priority Med, Visual Editor

The new Background dialog needs two fixes:

1. (For when image type is "image") implement the "Choose..." button to bring up a file picker and then stuff the result back into the dialog.

Right now there is no 'onclick' handler for that button. One way to add an onclick handler would be to add something like this after BackgroundDialog.js:128:

```
this.connect(this."fileDialogButton", 'onClick', dojo.hitch(this,function(){
// Launch file picker
}));
```

If the user chooses a file from the file picker, then I'm pretty sure all you need to do is set ```this.bgddata.url``` to the URL (without url() or quotes around the value - other existing logic takes care of that) and then call ```this._onFieldChanged();``` which will magically update everything else in the dialog.

2. The preview image currently doesn't show ```background-image:url(whatever)``` because ```whatever``` is a URL relative to the current HTML file in the user's workspace, but the background dialog is part of the Maqetta application, which has a different base URL. Somehow or other the url() that is stuffed into the Background dialog's preview image needs to have some URL munging.