Mod: Cool JSFX-Element Fading for Thumbnails

E-Razor
E-Razor's picture

Joined: 2005-01-07
Posts: 18
Posted: Tue, 2005-02-08 15:02

Yeah, element-fading for your thumbs, see http://www.jsfx.com for examples.

Go to your gallery2-dir:

cd gallery

Copy the matrix-folder to jsfxmatrix:

cp layouts/matrix/ layouts/jsfxmatrix/

Now enter the jsfx-dir:

cd  layouts/jsfxmatrix/

Apply the patch... that changes *matrix to jsfxmatrix and adds some <script>-tags to our html-templates:

patch -p1 < matrix2jsfxmatrix.patch

btw, you can change the values for fading if you want, and well, maybe there is someone whos smart enough to add these values somewhere in the gallery as a setting.

@layouts/jsfxmatrix/templates/head.tpl
<script LANGUAGE="JavaScript">
    JSFX.FadeElemMinOpacity = 70;
    JSFX.FadeElemAutoUp      = 5;
    JSFX.FadeElemAutoDown   = 10;
</script>

Download the jsfx-script:

wget http://www.jsfx.com/development/elemfader/javascript/JSFX_ElemFader.js

Ok, we've to tell the jsfx-script what elements to use, thats happening by using class="elemFader", fortunately our thumbnails don't have a class yet, i've used the parameter in layouts/jsfxmatrix/templates/albumBody.tpl:97, but we've to use it too.
So it's necessary to add something to the imageframe-module:

@modules/imageframe/templates/ImageFrame.tpl:40
class="$class" id="IFid`$IF_count`"}{/if}{if

Could be great if the developers would add that class to the cvs too!

I think thats all...
If everything works, you should be able to select jsfxMatrix somewhere near the Album-Layout.

I wish you much fun with that new toy ;-)

AttachmentSize
matrix2jsfxmatrix.patch.txt2.84 KB
 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Thu, 2005-02-10 03:08

Is there a way to apply this patch using windows?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-02-10 06:22

it's not that long.. you could apply it by hand..

 
E-Razor
E-Razor's picture

Joined: 2005-01-07
Posts: 18
Posted: Thu, 2005-02-10 11:53

i've added a highlighted version... i think thats a bit better for manual patching...

 
crazyknicksfan
crazyknicksfan's picture

Joined: 2003-01-09
Posts: 32
Posted: Wed, 2005-04-20 21:06

I'd like to try adding this mod to my G2, but I don't know how to edit the tpl files manually. I try to open up the tpl files with notepad, but all I get is a bunch of mushed up code. What files should I edit and how should I do it in order to get the images to fade? Any tips or suggestions would be appreciated. Thanks.

-Andrew

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-04-20 21:58

try wordpad to edit tpl

 
crazyknicksfan
crazyknicksfan's picture

Joined: 2003-01-09
Posts: 32
Posted: Thu, 2005-04-21 16:34

I attempted to edit everything manually but there were some problems.
I was unable to make these changes in albumBody.tpl:

95c97,98
< ImageFrame_pre=$smarty.capture.link ImageFrame_post="</a>"}
---
> class="elemFader"
> ImageFrame_pre=$smarty.capture.link ImageFrame_post="</a>""}

102a106
> </div>

What should I do? I can't find the first ImageFrame_pre line in the file anywhere and for the other one (</div>), I have no idea what I'm suppose to change or cut out. Any ideas?

There is also the problem with the ImageFrame file:

@modules/imageframe/templates/ImageFrame.tpl:40
class="$class" id="IFid`$IF_count`"}{/if}{if

Where am I supposed to put this? It does not appear to fit in line 40...

Please reply with any suggestions. Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-04-21 17:57

that part of the diff is obsolete.. just a guess, but look for giThumbnail and add elemFader after it.. so you get:
class="%CLASS% giThumbnail elemFader"
in one place, and:
class="giThumbnail elemFader"
in another.

 
crazyknicksfan
crazyknicksfan's picture

Joined: 2003-01-09
Posts: 32
Posted: Fri, 2005-04-22 00:28

Hey mindless,

Thanks for the tips, but it still doesn't seem to work...grrr.
Well, maybe it is just too outdated to implement into the current G2 version. Were you or anyone else able to get it to work before? Maybe it will be added as a module in a future version... :wink:

 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Fri, 2005-04-22 03:13

Sorry to sound stupid but I understood up to the part where he says "apply the patch patch -p1 < matrix2jsfxmatrix.patch".

How do you actually apply it? Copy the code into a template somewhere? Use something like PPF-O-Matic, what? :oops:

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-04-22 03:30

the patch is old so it won't apply to the current codebase.. you may be able to figure out how to apply the changes manually by looking at the diffs posted above.

 
d3vlabs

Joined: 2005-05-10
Posts: 100
Posted: Tue, 2005-05-10 21:25

Apply the patch... that changes *matrix to jsfxmatrix and adds some <script>-tags to our html-templates:
Code:

patch -p1 < matrix2jsfxmatrix.patch

i'm stuck there. if I had shell axx to my server, I'm pretty sure I would figure it out. But all I have is web tools: cpanel/phpmyadmin/filebrowser is what I'm working with. Can you please post patched version or a pre-made matrixjsfx folder with patched files that we could just appload? I'm sure lots of people would greatly appreciate that. Thanks for your time.

 
jortgies

Joined: 2005-08-12
Posts: 1
Posted: Fri, 2005-08-12 03:20

I created a working patch (as for v2.0-beta-4), have fun with it.

 
deezNutz
deezNutz's picture

Joined: 2005-07-06
Posts: 26
Posted: Sun, 2005-09-18 17:24
jortgies wrote:
I created a working patch (as for v2.0-beta-4), have fun with it.

Where can I find this new version that works with new theme system?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2005-09-19 02:42

If you follow his directions in the first post and just use the last attachment "matrix2jsfxmatrix.patch.txt" then everything should work fine. I'm assuming you have shell access or access to a Linux type box that has patch. If not you should be able to apply the changes by hand, it's really only a couple of line in album.tpl, theme.tpl and theme.inc.

 
jpeadro

Joined: 2003-12-24
Posts: 198
Posted: Mon, 2005-10-10 18:37

Should I follow this patch http://gallery.menalto.com/files/matrix2jsfxmatrix.patch_804.txt manually to add the fade functionality to the Classic theme?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2005-10-10 19:59

You should be able to. If I was applying those changes to a theme other than Matrix, I'd just look very closely at each line in the theme to find a corresponding line that was changed in the patch.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jpeadro

Joined: 2003-12-24
Posts: 198
Posted: Mon, 2005-10-10 20:52

I am manually trying to add this patch http://gallery.menalto.com/files/matrix2jsfxmatrix.patch.txt to my classic theme and am wondering where this section goes:
"> <script LANGUAGE="JavaScript">
> JSFX.fadeElemAuto();
> </script>
65c67
< {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
---
> {include file="gallery:layouts/jsfxmatrix/templates/itemNavigator.tpl"}
70c72
< <table id="gbThumbMatrix">
---
> <table id="gbThumbjsfxMatrix">
95c97,98
< ImageFrame_pre=$smarty.capture.link ImageFrame_post="</a>"}
---
> class="elemFader"
> ImageFrame_pre=$smarty.capture.link ImageFrame_post="</a>""}
102a106
> </div>
195c199
< {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
---
> {include file="gallery:layouts/jsfxmatrix/templates/itemNavigator.tpl"}
diff -r layouts/matrix/templates/head.tpl layouts/jsfxmatrix/templates/head.tpl
10a11,17
> <script LANGUAGE="JavaScript" SRC="{$layout.layoutUrl}/JSFX_ElemFader.js" TYPE="text/javascript"></SCRIPT>
> <script LANGUAGE="JavaScript">
> JSFX.FadeElemMinOpacity = 70;
> JSFX.FadeElemAutoUp = 5;
> JSFX.FadeElemAutoDown = 10;
> </script>
>
diff -r layouts/matrix/templates/singleBody.tpl layouts/jsfxmatrix/templates/singleBody.tpl
11c11
< {include file="gallery:layouts/matrix/templates/pathbar.tpl"}
---
> {include file="gallery:layouts/jsfxmatrix/templates/pathbar.tpl"}
96c96
< {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
---
> {include file="gallery:layouts/jsfxmatrix/templates/itemNavigator.tpl"}
130c130
< {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
---
> {include file="gallery:layouts/jsfxmatrix/templates/itemNavigator.tpl"}
"

Thanks,
Jeff

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2005-10-14 07:21

Sorry, I guess I didn't answer your previous question clearly. Yes you want to use http://gallery.menalto.com/files/matrix2jsfxmatrix.patch_804.txt The one you're trying to use is for the old layout/theme system

The patch jortgies created, http://gallery.menalto.com/files/matrix2jsfxmatrix.patch_804.txt works with the current theme system.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
neo314

Joined: 2005-07-31
Posts: 28
Posted: Sun, 2006-04-02 12:27

Does this patch still work on code 2.1. I cant seem to get it to patch. I keep getting the following errors

can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Only in jsfxmatrix/: JSFX_ElemFader.js
|diff -rB matrix/templates/album.tpl jsfxmatrix/templates/album.tpl
--------------------------

Can anyone give me some pointers

Thanks

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-04-02 15:56

you need to apply the patch manually, none of the line numbers will match up anymore.