Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Update other stuff on the page after ajax navigation
marcd
#1 Posted : Monday, 28 February 2011 7:02:19 AM(UTC)
marcd

Rank: Advanced Member

Joined: 13/02/2009(UTC)
Posts: 53
Location: Zurich, Switzerland

Hi Roger,

As you may remember I added some facebook-integration to my GSP installation by adding some FB-code to the aspx. So far so good. You can see this in action at the following URL:

http://www.marcduerst.co.../default.aspx?moid=5335

Now if one navigate to the next or previous image GSP does an ajax reload to show the next/previous image. Fine. But my outer page does not get an notice of that and therefore does not get the FB-comments for the correct image.

Do you have any smart idea how to hook into the GSP ajax stuff and update other things like the FB-comments? ...I am not really the ASP.NET AJAX master... ;-)

Cheers,
Marc
Roger Martin
#2 Posted : Monday, 28 February 2011 8:23:19 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

The next and previous buttons trigger javascript functions showNextMediaObject() and showPrevMediaObject(). They are defined in mediaobjectview.debug.js (debug version) and mediaobjectview.js (minified version). Can you add a line of code to these that call your own javascript?

If that seems daunting, the only other thing I can think of is to modify those functions to force the browser to do a full page load for the updated media object. You can use code like this:

window.location = getPermalink(moid);

For example, you could add this line this near the end of showNextMediaObject() and showPrevMediaObject() - maybe just before the if block that calls refreshMetadata(). I haven't tested this...
Roger Martin
Creator and Lead Developer of Gallery Server Pro
marcd
#3 Posted : Tuesday, 1 March 2011 1:14:53 AM(UTC)
marcd

Rank: Advanced Member

Joined: 13/02/2009(UTC)
Posts: 53
Location: Zurich, Switzerland

Hi Roger,

Wow - thanks for nice help again - really appreciate it!

As I see it, I loose upgradabillity with this. Don't get me wrong: I don't see any other way how to do this as well - at least not yet. Maybe I'll give it a try but first should upgrade to the latest version (2.4). Have to think about it a little more - I guess ;-)

Oh, just got an idea:

What if one could add some HTML fragments in the GSP-backend config. Maybe some memo fields like "HTML before Media Object", "HTML after Media Object", "HTML before Album", "HTML after album". In these configuration slots an admin can (optionally) insert any stuff he likes to get rendered by GSP at the given point.

The blog-software BlogEngine.net use this approach to let admins customs html to the blog (eg. google analytics scripts etc.). I think this would increase the extensibillity of GSP in a great way and should not be too tricky to implement. No validation of these snippets needs to be done by GSP as only admins could enter them in the backend.

What do you think about this?

Cheers,
Marc
Roger Martin
#4 Posted : Tuesday, 1 March 2011 8:23:45 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Interesting idea, but I imagine this kind of feature would be used by only 5% of users. And it would likely confuse some portion of the other 95%. For the time being, I need to focus on enhancements that everyone appreciates, like editable metadata, tagging, revamped upload experience, and others...
Roger Martin
Creator and Lead Developer of Gallery Server Pro
marcd
#5 Posted : Wednesday, 2 March 2011 1:12:41 AM(UTC)
marcd

Rank: Advanced Member

Joined: 13/02/2009(UTC)
Posts: 53
Location: Zurich, Switzerland

Roger Martin wrote:
Interesting idea, but I imagine this kind of feature would be used by only 5% of users. And it would likely confuse some portion of the other 95%. For the time being, I need to focus on enhancements that everyone appreciates, like editable metadata, tagging, revamped upload experience, and others...


Sure.

What if I give it a try and send you my code/changes/patches? Is it possible that these enhancements will make their way back into the main branch so I don't loose the upgrade-ability?

Cheers, Marc
Roger Martin
#6 Posted : Wednesday, 2 March 2011 8:36:58 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

I will consider it, but I can't say for sure until I see the implementation.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
marcd
#7 Posted : Thursday, 3 March 2011 1:12:42 AM(UTC)
marcd

Rank: Advanced Member

Joined: 13/02/2009(UTC)
Posts: 53
Location: Zurich, Switzerland

Roger Martin wrote:
I will consider it, but I can't say for sure until I see the implementation.


Thanks.
Maybe I'll give it a try but it may take a while ;-)
The admin-part could be stored in something like an "Advanced" section in the admin-panel so normal users don't get confused about it.
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.