1
Will_H
Lets simplify this ajax thing.
  • 2007/3/4 0:38

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Ajax is becoming more and more in demand. So I want to do some addons to header.php

It seems that certain functions should be integrated into the XOOPS core. For now, lets just make it easier for those of us too impatient to wait for this to occur.

With this simple hack I want to call these scripts with a smarty tag.

Here's what I did

in header.php

Find:
$xoopsTpl->assign('xoops_js''.XOOPS_URL.'/include/xoops.js">');


Add After
$xoopsTpl->assign('xoops_prototype''.XOOPS_URL.'/include/prototype.js">');
$xoopsTpl->assign('xoops_scriptaculous''.XOOPS_URL.'/include/scriptaculous.js?load=effects">');


By default scriptaculous.js loads the other .js files "dragdrop, effects, etc" as long as they are in the same directory.

Be sure to upload all of the .js files to your XOOPS_root/includes directory.

Now, instead of using this in my theme.html
<script type="text/javascript" src="<{$xoops_imageurl}>scripts/scriptaculous.js">script>


I use
<{$xoops_scriptaculous}>
<{
$xoops_prototype}>


If I view the page source the scripts are being called properly... but the functionality is not there.

Any ideas?

2
snow77
Re: Lets simplify this ajax thing.
  • 2007/3/4 0:56

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


Yes.

For now it's XOOPS "default theme template issue" not a core issue.

It's up to us, the theme designers, what we define as standard in the "head" and "body".

If you, along with kris_fr who was done much efforts, and others, along with me who are doing theme functioning structures... we should open a some kind of "XOOPS theme template" kind of forum ..and start simplifying and structuring the functioning part, focused apart from the designing part.

3
snow77
Re: Lets simplify this ajax thing.
  • 2007/3/4 1:01

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


what can be proposed as head?
what can be proposed as body?

what can be proposed as alternate additions? (since we can't add a million include scripts in the head)

what documentation can be done?

4
nekro
Re: Lets simplify this ajax thing.
  • 2007/3/4 2:25

  • nekro

  • Quite a regular

  • Posts: 213

  • Since: 2005/11/9


In XOOPS 2.0.16 you can use the new theme Object and for example in the header.php is:
$xoTheme->addScript'/include/xoops.js', array( 'type' => 'text/javascript' ) );


You can also use that for scriptaculous too... in any page ... not necesary yo be included in header.php ...

Luck

5
Will_H
Re: Lets simplify this ajax thing.
  • 2007/3/4 14:31

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


@snow: I'm not sure I follow... The beauty behind scriptaculous is that it loads all of the additional scripts so you only have to call it+prototype. Perhaps it does not belong in the core.

I just feel that XOOPS should evolve with the web. The web isn't going to come back down to XOOPS standards. Somehow I think you believe the same, as I see you as one of the front runners in developing the XOOPS wireframe template.

@nekro: AH! I'll give that a swing.

The reason that I am trying to call it from header.php is because it is used in every single page. Seemed like the most logical place to define a smarty tag.

Thanks for your help

6
Bill_L
How can I call the scriptaculous.js from the header.php
  • 2007/3/4 14:43

  • Bill_L

  • Just popping in

  • Posts: 14

  • Since: 2007/3/1 1


Quote:

snow77 wrote:
Yes.

For now it's XOOPS "default theme template issue" not a core issue.


I think Wills post above is not to encompass every ajax script. It looks like he was asking a specific question! In which he was trying to call the scriptaculous.js from the head for a project that he is working on.



Thanks for keeping the post on topic.

7
Will_H
Re: Lets simplify this ajax thing.
  • 2007/3/4 15:01

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Well yes, exactly Bill.

In doing so it seems that I have brung up a new topic.

I think that it is inevitable that these scripts as well as many more are going to be more and more frequent in the coming years. Especially in regards to integration with XOOPS.

While to us, it may seem like childs play to simply drop this into a scripts folder and call it from the theme. To a novice it would be like playing spiderman on the empire state building.

Not only this, but this would enable Theme, and module designers to lessen the amount of files in each and every download. After all it is my bandwidth that is being consumed with each and every theme I release.

So not only am I sharing my work for free, but I am paying for each and every download.

So whats the harm in looking into saving myself some money in the long run?

8
Will_H
Re: Lets simplify this ajax thing.
  • 2007/3/6 12:13

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


no comments?

mmmkay.

Login

Who's Online

250 user(s) are online (188 user(s) are browsing Support Forums)


Members: 0


Guests: 250


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits