New icons/borrowing interface in latest subversion nightly builds

4 views
Skip to first unread message

Matt Ryan

unread,
Dec 5, 2009, 5:13:59 PM12/5/09
to reason-d...@googlegroups.com
Hi, folks --

The new icons and borrowing interface are available in the latest
nightly builds.

You can see a blog post the describes the changes here:
http://apps.carleton.edu/opensource/reason/developers/changes/?story_id=590176

I hope to soon document how you can add icons for local types, and to
update the documentation that refers to the now-obsolete left-side
borrowing menu.

Matt

Charles Fulton

unread,
Dec 7, 2009, 2:07:26 PM12/7/09
to reason-d...@googlegroups.com
Matt,

Great work on this! I've just added an icon for a local type just by
creating a 16x16 png, giving the file the same name as the unique type
name, and dropping it in www/ui_images/types. Is there anything else
to watch for?

Charles
> --
>
> You received this message because you are subscribed to the Google Groups "Reason Discussion" group.
> To post to this group, send email to reason-d...@googlegroups.com.
> To unsubscribe from this group, send email to reason-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/reason-discussion?hl=en.
>
>
>

Matt Ryan

unread,
Dec 7, 2009, 3:12:35 PM12/7/09
to reason-d...@googlegroups.com
Glad you asked; I've been meaning to do a writeup on custom type icons.

You've roughly done the right thing -- create a 16x16 png named as
type_unique_name.png.

There is a more "proper" way to do it, though. Basically, along with
this UI change we've introduced a new concept to Reason -- a local
Reason www directory -- that we recommend using for this purpose.

The idea is that you can set up a local directory of web-available
files that overlays Reason's core web-available files. It works in
essentially the same way the core/local code split does: a requested
file will be served up from the local directory if the file exists
there; otherwise things fall through to the core directory.

To set this up. you can just re-run the Reason setup script; it should
create the appropriate .htaccess file and create a directory at
reason_4.0/www/local/. If you prefer, as we at Carleton do, to manage
your local files outside reason_package, you can drop a symlink (or,
in Windows, a junction) at reason_4.0/www/local/ to wherever you'd
like to manage your local web-available files.

Once you have that set up, put your image(s) in
reason_4.0/www/local/ui_images/types/ and you'll see your images show
up. It's a little more complex but it helps keep the core assets and
the local assets distinct from each other, and even gives you the
option of replacing core files with local ones if you think that's
important.

Also of note: the type icons are semitransparent pngs, so if you have
anyone using ie6 the icons will look a bit "off" to them. There is a
way to make things look nicer for them, and we may put that in place
at some point, but if nobody complains I'm not rushing to do it. :)

Matt

Charles Fulton

unread,
Dec 7, 2009, 4:39:14 PM12/7/09
to reason-d...@googlegroups.com
This doesn't quite work as expected--it sees that there's a local
file, but doesn't load it. I looked at reason_get_type_icon_url() and
it tests for the presence of either a local or core file but on a true
value loads the core file. I fixed this somewhat inelegantly by
creating a second, separate test for the local file. Diff attached.

Charles
util_load_local_file.patch

Nathan White

unread,
Dec 7, 2009, 5:17:36 PM12/7/09
to reason-d...@googlegroups.com
The patch shouldn't be necessary. Your setup.php file should write an
.htaccess rule into your www folder that does the work of loading the
type icon from www/local/ if it exists

If the .htaccess rule works correctly, a request for:

www.mysite.com/reason/images/foo.jpg

will be served from:

www.mysite.com/reason/local/images/foo.jpg (if it exists)

or from:

www.mysite.com/reason/images/foo.jpg (if it exists)

or result in a 404.

Check to make sure you ran the setup script again
(reason_package/reason_4.0/www/setup.php) and that it created an
.htaccess file in reason_package/reason_4.0/www/.htaccess that looks
something like this:

RewriteEngine On
RewriteRule ^(.*)$ $1
RewriteCond /path/to/reason_package/reason_4.0/www/local/$1 -F
RewriteRule ^(.*)$ ./local/$1

The idea is that links shouldn't care about or link directly to the
www/local/ folder, but when apache serves an image, page, script, etc
from the www folder, www/local/ will be checked first and the resource
served if it exists.

Nate

Charles Fulton

unread,
Dec 8, 2009, 6:52:36 AM12/8/09
to reason-d...@googlegroups.com
That's what I've got (more or less) in the .htaccess file but it's
still not working. Here's the exact contents:

RewriteEngine On
RewriteRule ^(.*)$ $1
RewriteCond D:\reason_package/reason_4.0/www/local/$1 -F
RewriteRule ^(.*)$ ./local/$1

I tried deleting it and having setup re-create it, with the same
result. I also tried removing the "./" from the last line in case
Windows didn't like that but it had no effect.

Charles

Nathan White

unread,
Dec 8, 2009, 12:42:59 PM12/8/09
to reason-d...@googlegroups.com
I'm going to do some testing on a windows install and see if I can
puzzle this out. Out of curiousity, did you create an NTFS junction at
www/local or is it just a typical directory?

Thx,

Nate

Charles Fulton

unread,
Dec 8, 2009, 12:59:43 PM12/8/09
to reason-d...@googlegroups.com
It's a typical directory. I didn't see a problem, at least for now,
keeping it within the webroot.

Charles

Charles Fulton

unread,
Dec 8, 2009, 5:50:20 PM12/8/09
to reason-d...@googlegroups.com
I've tracked down the issue--the backslash after the drive letter
needs to be escaped. Once that's done everything is fine.

Charles

Nathan White

unread,
Dec 9, 2009, 3:07:57 PM12/9/09
to reason-d...@googlegroups.com
Hi Charles - Playing around with XAMPP I've found I had to make two changes:

RewriteRule ^(.*)$ $1
RewriteCond C:/xampp/reason_package/reason_4.0/www/local/$1 -f
RewriteRule ^(.*)$ ./local/$1

I had to change the file exists check in the RewriteCond statement
from -F to -f (this is faster anyway), and I'm using a forward slash
instead of a backslash after the drive letter C. Escaping the
backslash works is equally effective. I'll be making these changes in
the setup script that sets up the local www folder.

Thanks for finding the backslash issue.

Nate
Reply all
Reply to author
Forward
0 new messages