Topic: afKeepScroll

Update

-----------------------------------------------
supports 0.7.2 -> download link: afkpscroll.7z
-----------------------------------------------

Repository link updated too.

Old post

Due to the conversation in the Auto scroll down to last position post I decided to try and help a little.

This script it's meant to keep the scroll position of the textareas (not the page) found in page_parts, snippets, layouts and file editing pages. It's not the same script as the one posted as a temporal solution in that topic, this was built from scratch.

Keeps the scroll value only if you click the Save and Apply button by creating a cookie with the current textarea id and if any, the scroll value.

If you click any of the Main links buttons (Pages, Snippet, Layouts, Files, Users, Administration tabs) or the Save button the cookie(s) gets deleted.

It may not be compatible with any code syntax highlighter(creates iframe), but works with markdown and textile filter. If you're using sartas resizer plugin, then this one looses its meaning.

Drag the folder found in the zip file to your plugins folder and enable it through the Administration.

Tested in Firefox, Chrome, Opera, Safari and IE7(though it may not work correctly in ie).

Any input, complaint or anything else, please do it in this post.

Thanks to David for all his help.

Last edited by andrewmman (2011-01-06 22:50)

Thumbs up

2

Re: afKeepScroll

andrewmman wrote:

Due to the conversation in the Auto scroll down to last position post I decided to try and help a little. ...

You've helped a lot! This is going into all my Wolf sites! big_smile

Just added it to the Respository, too.

Thanks!!

Re: afKeepScroll

Very usefull plugin indeed, thanks for that.

Re: afKeepScroll

Thanks, it helps a lot.

"When you want something, all the universe conspires in helping you to achieve it." - The Alchemist

5

Re: afKeepScroll

Thank you andrewmman for helping with my (our) problem.

Maybe this in not a complete solution but really usefull.

--
Piotr

Re: afKeepScroll

Just for kicks / out of my interest... has anyone tested this in combination with a syntax highlighting plugin? Would be an awesome combination. smile

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

Re: afKeepScroll

tikky what do you mean by not a complete solution?

Thumbs up

8

Re: afKeepScroll

andrewmman: I mean, that is not working with Firefox. Am I right?


Martijn wrote:

Just for kicks / out of my interest... has anyone tested this in combination with a syntax highlighting plugin? Would be an awesome combination.

I've tested on Firefox and Chrome, but unfortunatelly without success sad

Last edited by tikky (2010-08-25 13:34)

--
Piotr

9

Re: afKeepScroll

tikky wrote:

andrewmman: I mean, that is not working with Firefox. Am I right?

The current plugin works great for me in all browsers tested (FF 3.5.6, Seamonkey 2.0.6, Opera 10.something, Chrome 5.something, IE7), and on Mac OSX (10.5), WinXP/SP3, and Linux/Ubuntu 9.04. (That's all I could find at the moment. wink )

10

Re: afKeepScroll

andrewmman:

Sorry man, one more test - everything is working fine.
Thank you once again.

--
Piotr

Re: afKeepScroll

I just found it weird that it didn't work on firefox been my test browser all along, that's all. I think we could move on to v0.0.2 and support at least martijn's TinyMCE implementation. Though I think this plugin will only be necessary for Wolf 0.60.

Thumbs up

Re: afKeepScroll

From my quick glance at this thing, I think its small enough that I'd be happy to put it in the core. There is however one downside to that:

You might get conflicts with some plugins.

So we *could* (not saying we should) also just keep it a plugin? (though I guess we could add some code and an option to the admin -> settings screen to turn it off.

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

Re: afKeepScroll

mvdkleijn wrote:

You might get conflicts with some plugins.

So we *could* (not saying we should) also just keep it a plugin? (though I guess we could add some code and an option to the admin -> settings screen to turn it off.

Would you mind specifying an example so I can check it out?

About the code to enable or disable it's use, would it be enough to set something like a checkbox to enable/disable it's use in pages, snippets, layouts or files as in general. I mean if you disable it for pages, no textarea in page_parts editing would implement this feature. Better yet it won't even load the script at all.

I see in the nightly build Wolf may implement the jquery cookie plugin, it's in the head tag but doesn't come in the javascritps folder, is that so? I'm saying this because I could change the script so it uses the jquery cookie one.

Thumbs up

Re: afKeepScroll

andrewmman wrote:

Would you mind specifying an example so I can check it out?

An example of where it might generate conflicts? Sure. smile

My main reasoning was that if you put it in the core (not saying we shouldn't, its small enough) it would always be on. So any plugin that would manipulate the textareas *might* conflict with this feature. Examples could be: TinyMCE, Codemirror, Codepress, FCK editor, Tuupola's Asset plugin.

In order for us to prevent, or at least be able to easily resolve any conflicts, you'd have to be able to turn off the functionality. That means either: adding an on/off switch to the admin section OR keeping it as a plugin so you can turn it on/off that way.

Not sure what the wisest choice here is. Not sure that it really matters that much anyway. smile

andrewmman wrote:

About the code to enable or disable it's use, would it be enough to set something like a checkbox to enable/disable it's use in pages, snippets, layouts or files as in general. I mean if you disable it for pages, no textarea in page_parts editing would implement this feature. Better yet it won't even load the script at all.

I see in the nightly build Wolf may implement the jquery cookie plugin, it's in the head tag but doesn't come in the javascritps folder, is that so? I'm saying this because I could change the script so it uses the jquery cookie one.

Hmm.. the jquery cookie plugin. I think that's old code that wasn't cleaned up. The nightlies are a bit in disarray as I'm slowly working towards finally finishing that damn jquery migration. smile (a lot of the bigger stuff is just about done though. Working out the bugs now)

Edit: Just had an afterthought. Keeping it as a plugin has another advantage. It'd be easier (however slightly) to update it and remove/fix conflicts? Well, maybe not.. guess it'd be easy enough to change a single file in the core.

Last edited by mvdkleijn (2010-09-07 23:40)

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

Re: afKeepScroll

up!

Just to let you know the plugin has been updated so it works with v 0.7.x.

Download link in the first post.

Last edited by andrewmman (2011-01-03 02:49)

Thumbs up

16

Re: afKeepScroll

andrewmman wrote:

Just to let you know the plugin has been updated so it works with v 0.7.x.

Yeah! big_smile I am so used to this plugin now, I would have a hard time doing wthout it -- thanks for the update!