Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-25 15:46:55

Mackie
New Member
From: Hungary
Registered: 2006-04-01
Posts: 4

Scriptaculous + Live Search plugin

I would like to add a Scriptaculous effect the Live Search plugin. / javascript:Effect.Combo(‘LSResult’) /

The only problem is, I don’t know Javascript, and so far my “guesses” as of where to put it have failed – only about 10 px of the results window is appearing, and rolls up and down a bit, but doesn’t actually open any further.

Offline

#2 2006-06-28 00:32:30

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: Scriptaculous + Live Search plugin

I’m planning to write a new live search plugin from scratch, using Scriptaculous and the Prototype framework for better cross-browser AJAX handling and effects. Stay tuned.


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#3 2006-06-28 01:57:00

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Scriptaculous + Live Search plugin

I would like to add a script to my article pages, that scrolls the page down to the target anchors of the TOC list source anchors.
Does Prototype provide something like that within the library ?
I just scanned their demo pages, but yet didn’t find any example.

It seems to be quite popular those days.

regards, marios

Last edited by marios (2006-06-28 01:59:41)


⌃ ⇧ < ⌃ ⇧ >

Offline

#4 2006-06-28 02:51:23

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Scriptaculous + Live Search plugin

marios

You don’t have to use prototype to do that. Take a look at txp-plugins.netcarving.com.

Is that the kind of functionality you are looking for?

Last edited by net-carver (2006-06-28 07:43:08)


Steve

Offline

#5 2006-06-28 06:11:49

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Scriptaculous + Live Search plugin

I think it’s down, but anyway I already implemented it, it works fine, I just have to insert the back to top links.
I needed this, because the articles are very long, and I can not implement pagination on that article forms for some other reason.

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#6 2006-06-28 07:44:38

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Scriptaculous + Live Search plugin

Μάριος

sorry, bad link. Corrected now.

(Hope I spelled it correctly:)

Last edited by net-carver (2006-06-28 07:45:28)


Steve

Offline

#7 2006-06-29 00:27:29

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Scriptaculous + Live Search plugin

net-carver wrote:

*Μάριος

(Hope I spelled it correctly:)

yes, correct, it’s working fine with prototype.js,
BTW.: I left a mail regarding a plugin

regards, marios

Last edited by marios (2006-06-29 00:28:06)


⌃ ⇧ < ⌃ ⇧ >

Offline

#8 2006-06-30 00:12:00

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: Scriptaculous + Live Search plugin

Hi Marios,

Actually prototype.js provides a method to do that: Element.scrollTo

but the code is really simple, so you don’t need to import this big library just for that function. Here’s the code:
<pre><code>
scrollTo: function(element) { element = $(element); var x = element.x ? element.x : element.offsetLeft, y = element.y ? element.y : element.offsetTop; window.scrollTo(x, y);
}
</code></pre>

As for my plugin, it’s nearly finished and works well. I still must tune the bells and whistles. The Javascript code is clean and simple thanks to Prototype and Scriptaculous. This is really useful since coding Javascript in general and Ajax in particular is usually something horrible especially when you target more than one browser (particularly IE).


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#9 2006-06-30 00:39:37

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Scriptaculous + Live Search plugin

cbeyls wrote:

Hi Marios,

Actually prototype.js provides a method to do that: Element.scrollTo

but the code is really simple, so you don’t need to import this big library just for that function. Here’s the code:
<pre><code>
scrollTo: function(element) { element = $(element); var x = element.x ? element.x : element.offsetLeft, y = element.y ? element.y : element.offsetTop; window.scrollTo(x, y);
}
</code></pre>

Hey, thanks a lot, I’ve already implemented it, although it doesn’t work on opera.
The scroll to function that I use references the light version of the library.
So I had just put it on altogether, just in case I want to use the other functions as well.

I just can’t figure out, why it doesn’t work on opera, since it has special code for opera included.
(i might test yours as well, once I get the chance)

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#10 2006-06-30 11:55:21

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: Scriptaculous + Live Search plugin

Well, how did you implemented it? My code is from the latest version of prototype.
I don’t know if it works in the current Opera, but actually I found an older article describing what is probably the cause of your problem with Opera. So, try the prototype code first with Opera and if it doesn’t work, then use the script provided with the article. If the prototype code doesn’t work in Opera, then I may consider submitting a patch to the prototype dev team.


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

Board footer

Powered by FluxBB