Click image to enlarge+discussion

right, that would require js customizations. certainly possible to do with inclusions, though I can't guarantee without looking that any given library would work out of the box. important thing would be to make sure the triggers are set to work even on dom objects reloaded by ajax.

--Ethan McCutchen.....2013-10-28 22:12:49 +0000

But code can only work on certain kinds of cards, right? HTML? So if I made a new Cardtype, I'd have to set its default to HTML instead of Basic so that it wouldn't erase the javascript?

--Lora Friedenthal.....2013-10-30 03:04:47 +0000

I think Shadowbox should work? It has a mode that they say you can use if your page has ajax. There are a few ways to use it. One is by adding an attribute to the link markup. But could you mix something like that with an inclusion? The other method is to define a class that would automatically work with Shadowbox. So I guess if images are already all associated with a particular class, that might work?

--Lora Friedenthal.....2013-10-30 03:26:23 +0000

http://www.shadowbox-js.com/usage.html for reference

--Lora Friedenthal.....2013-10-30 03:26:59 +0000

Ethan, any ideas on this?

--Lora Friedenthal.....2013-11-08 19:47:02 +0000

I don't have time to dig into those docs. all cards included in content view (or any dynamic view) have several useful associated classes.

--Ethan McCutchen.....2013-11-08 21:35:07 +0000

Okay. That gives me a trail to follow.

--Lora Friedenthal.....2013-11-08 21:38:50 +0000

Well, uploading a .js as a file renames the file, so I'm not sure if I should expect it to work if I've changed the name of the script. Can I make Wagn not rename things? Also, the best I could see, the class would be card-slot.content-view.card-content.ALL.TYPE-image ? But can you actually stop there? Because the whole thing specifically references the particular image I use inspect element on. But the portion that says TYPE-image looks to be the only difference between an included image and an included basic card or card of another type.

--Lora Friedenthal.....2013-11-11 19:14:50 +0000

renames it how?

--Ethan McCutchen.....2013-11-11 19:21:05 +0000

you get to choose the name of the card, but the card itself can't have ".js" as part of the name. That's just one format. But in principle you should be able to render it with a .js extension (and the original name).

--Ethan McCutchen.....2013-11-11 19:22:10 +0000

So I uploaded shadowbox.js as a File. I named the card shadowbox. The download link from that card tells me that the file is http://teenwolfwiki.com/wagn/files/shadowbox-16518.js

--Lora Friedenthal.....2013-11-11 19:27:23 +0000

http://teenwolfwiki.com/wagn/shadowbox.js would work, but the optimized url will be faster.

 

see http://wagn.org/files

 

Wagn isn't renaming willy nilly. The optimized names mean that you can break browser caches with each new version but still get all the performance benefits of browser caching. The non-optimized names mean simple urls will always point to the same card, regardless of how many revisions there are, but if you don't change the name, you can't be sure you're breaking the browser cache.

 

Technically, it's not actually storing the file with any of these names; the file name itself is numerical (id based) so that the files don't need to be moved if the card is renamed.

--Ethan McCutchen.....2013-11-11 19:33:39 +0000

It's not storing it with any of these names... Would that mean that when I'm trying to link to these scripts and CSS in the header of a page, it isn't going to be there because the actual file on the server isn't called what I think it's called?

--Lora Friedenthal.....2013-11-11 19:41:39 +0000

no. if the url works, it works.

 

The reason for all this magic is that Wagn supports actual permission checks on files. The name is processed by Wagn, Wagn checks permission, and then passes the file to the server. You can't get directly to the real file name without going through the permission check.

 

Since we process the names like any wagn card, you could actually go to shadowbox.js, SHADOWBOX.js, Shadowboxes.js, or shadoxbox!@!.js, and they will all work.

--Ethan McCutchen.....2013-11-11 19:47:51 +0000

Should I need to specify the files/ subdirectory or no?

--Lora Friedenthal.....2013-11-11 19:55:22 +0000

Hrm. Looks like this is all moot anyway. Shadowbox's CSS breaks the skin.

--Lora Friedenthal.....2013-11-11 20:08:15 +0000

The most common way to implement this type of thing seems to be by adding an extra attribute into the link that you add to the image that leads to the larger size. Might this be something you'd consider adding to Wagn as built-in? It seems like something that would be just another attribute to the inclusion, like adding margins, only you'd be automatically applying a link to the image inclusion and passing along the attribute that the javascript is looking for (rel="shadowbox[Album]" typically)

--Lora Friedenthal.....2013-11-15 19:11:23 +0000

Different sizes are supported in the URLs. The pattern is /files/ (filename)[-(size name)]-(version number)[.(extension as uploaded)  Wagn supports a small number of size names that can also appear as inclusion options (i.e. {{image name|size;large}}. Without the optional size, the /files/... pattern seems to give the original file size (either 'full' or 'original').

 

There is a file uploaded for a background on my wagn that you can see this with too. In the *css card, it is: http://gerry.wagn.org/files/bg-10964.jpg which give the same as http://gerry.wagn.org/files/bg-full-10964.jpg, or you can go to http://gerry.wagn.org/files/bg-large-10964.jpg for a different size.

 

The mapping from the external URL to the stored filename is done in the application (ruby), so as Ethan says, if the URL works, it works.

--Gerry Gleason.....2013-11-17 13:59:04 +0000

it's a fine feature idea, but we've got a major backlog of those. We can create an idea card for it, but I don't see it getting bumped ahead of all the vital stuff on our roadmap without funding.

--Ethan McCutchen.....2013-11-17 23:21:43 +0000

Cool.

--Lora Friedenthal.....2013-11-17 23:24:35 +0000

little more context: we're making a big push to get to 2.0 so we can promote the API and recruit mod developers. This is exactly the kind of thing someone should be able make a quick mod for. But in the meantime, the Grass Commons team's focus is on adding capacity, not adding features.

--Ethan McCutchen.....2013-11-17 23:31:10 +0000

I understand. I wish I could be of more help.

--Lora Friedenthal.....2013-11-17 23:32:57 +0000

I understand. I wish I could be of more help.

--Lora Friedenthal.....2013-11-17 23:32:59 +0000