Javascript/ajax in style/template (submition question)

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Scam Warning
Locked
User avatar
Jesper Møller
Registered User
Posts: 239
Joined: Wed Jul 05, 2006 1:00 pm
Location: Copenhagen Denmark
Name: Jesper G.O. Møller
Contact:

Javascript/ajax in style/template (submition question)

Post by Jesper Møller » Sat May 01, 2010 10:56 pm

I have tryd to search the forumto find the answer, but with no luck. so i hope someone can help me with this question about style submission

What is the rules for javascript im styles/template ?

In the "The Styles Submission Policy (How to Submit a Style)" it says that
Files from other styles or from an external website (i.e. linking to images in another style's directory, or linking to an image on your personal website). The only exception to this is for submissions that do not have their own template set included (these can then reference prosilver's template files).
Dos this also apply for AJAX Libraries like jquery an Prototype scripts from google (like http://ajax.googleapis.com/ajax/libs/jq ... ery.min.js)?
Or shud i download the libs and put them in the template folder ??
"Education is learning what you didn't even know you didn't know!"

"True knowledge exists in knowing that you know nothing."

User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 8348
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by _Vinny_ » Sun May 02, 2010 12:41 am

    • phpBB 3.0's styling system is broken into three components:

      1. Templates (.html and .js files that determine the page structure, layout, and functions).
      2. Themes (.css files that determine color schemes, fonts, etc).
      3. Imagesets (.gif, .jpg, or .png image files that are used throughout a style).
http://www.phpbb.com/community/viewtopi ... 3&t=988545

User avatar
Jesper Møller
Registered User
Posts: 239
Joined: Wed Jul 05, 2006 1:00 pm
Location: Copenhagen Denmark
Name: Jesper G.O. Møller
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Jesper Møller » Sun May 02, 2010 12:54 am

Yes ... iknow

But what about a link in the head to it insted of having hte file in the template
like:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jq ... "></script

That is the recomende way (by jquery) and it will also make loading faster since many already has been on pages that use those script libarys and therfor has them in th cache

I understand policy abouth extarnal links to i.e. images or files.
But when it comes to the big scriptlibs like googleapis or yahooapis i dont think tha policy makes sens :?:
"Education is learning what you didn't even know you didn't know!"

"True knowledge exists in knowing that you know nothing."

User avatar
Sierron
Registered User
Posts: 241
Joined: Fri Apr 30, 2010 10:22 am
Location: Germany
Name: Artur
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Sierron » Sun May 02, 2010 1:23 am

Jesper Møller wrote:That is the recomende way (by jquery) and it will also make loading faster since many already has been on pages that use those script libarys and therfor has them in th cache
Wait, they say, its the recommend way? If this is really so and everyone use it, then it would load longer, than in an board - too much loading of that file .. perhaps. But why is it so hard to put the script in the folder of the style?

I think the policy say it clear. That's what I think... :)
Multilanguage TimeSplitters Site

If you need support, I suggest you to use the Support Request Template for your questions on this board. If you have some serious problems, the Support Toolkit can fix it (depends on the problem).

User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 8348
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by _Vinny_ » Sun May 02, 2010 1:45 am

This is the preference of each.

Remote or folder template, both are correct.

User avatar
Jesper Møller
Registered User
Posts: 239
Joined: Wed Jul 05, 2006 1:00 pm
Location: Copenhagen Denmark
Name: Jesper G.O. Møller
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Jesper Møller » Sun May 02, 2010 1:53 am

Sierron wrote:Wait, they say, its the recommend way? If this is really so and everyone use it, then it would load longer, than in an board - too much loading of that file .. perhaps.
One of the main points of Google hosting the jQuery library is so that it is cached in a single place.

Consider the following scenario:
User visits site A
Site A has jQuery on the same domain, so the file is downloaded by the browser
User visits site B
Site B has jQuery on the same domain, so the file is downloaded by the browser a second time.

Now if we all fetched jQuery from the Google servers, the scenario goes like this:
User visits site A
Site A loads jQuery from Google, so it's downloaded by the browser
User visits site B
Site B loads jQuery from Google, but the browser already downloaded it and cached it, so fetching the file again is instantaneous.

See http://encosia.com/2008/12/10/3-reasons ... y-for-you/ for more
Sierron wrote:But why is it so hard to put the script in the folder of the style?
Its not ... but its even easyer to change the link in the template to a newer version of the script (if neede) than to replace the script (when replacing you still need to change the link to the script because it has a new name
Sierron wrote:I think the policy say it clear. That's what I think... :)
Well ... you know ... no rules without execptions ;)
And i think it woud be great if one can take advange of those strong script libs and of the hosting of them
"Education is learning what you didn't even know you didn't know!"

"True knowledge exists in knowing that you know nothing."

User avatar
Sierron
Registered User
Posts: 241
Joined: Fri Apr 30, 2010 10:22 am
Location: Germany
Name: Artur
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Sierron » Sun May 09, 2010 2:03 am

Jesper Møller wrote:One of the main points of Google hosting the jQuery library is so that it is cached in a single place.
Well I don't trust Google. Google here, Google where ... in some time it's everywhere. Logging is also a thing ...
Multilanguage TimeSplitters Site

If you need support, I suggest you to use the Support Request Template for your questions on this board. If you have some serious problems, the Support Toolkit can fix it (depends on the problem).

User avatar
Jesper Møller
Registered User
Posts: 239
Joined: Wed Jul 05, 2006 1:00 pm
Location: Copenhagen Denmark
Name: Jesper G.O. Møller
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Jesper Møller » Sun May 09, 2010 2:24 am

Sierron wrote:Well I don't trust Google. Google here, Google where ... in some time it's everywhere.
Ohh .. like Microsoft you meen :shock:
Sierron wrote:Logging is also a thing ...
And you dont think that HostEurope GmbH is logging ? ;)

Im not saying once SHUD use scribt libs... only saying that i woud like to have the posebility to chose it if i want it :)
"Education is learning what you didn't even know you didn't know!"

"True knowledge exists in knowing that you know nothing."

User avatar
Sierron
Registered User
Posts: 241
Joined: Fri Apr 30, 2010 10:22 am
Location: Germany
Name: Artur
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Sierron » Sun May 09, 2010 2:01 pm

Jesper Møller wrote:And you dont think that HostEurope GmbH is logging ?
Sure they do, but HostEurope is my Hoster. Is Google your hoster? ;)
Jesper Møller wrote:Ohh .. like Microsoft you meen
Because they are google, youtube and such. They buy other companies and expand and expand...
Jesper Møller wrote:Im not saying once SHUD use scribt libs... only saying that i woud like to have the posebility to chose it if i want it
We will have to see, what the people from phpBB says :)
Multilanguage TimeSplitters Site

If you need support, I suggest you to use the Support Request Template for your questions on this board. If you have some serious problems, the Support Toolkit can fix it (depends on the problem).

User avatar
Jesper Møller
Registered User
Posts: 239
Joined: Wed Jul 05, 2006 1:00 pm
Location: Copenhagen Denmark
Name: Jesper G.O. Møller
Contact:

Re: Javascript/ajax in style/template (submition question)

Post by Jesper Møller » Sun May 09, 2010 2:16 pm

Is Google your hoster?
For some of my sites yes (Like My blog) ;)
Because they are google, youtube and such. They buy other companies and expand and expand...
Well ... thats the nature of buisnes :|
We will have to see, what the people from phpBB say
Yes... i hope to hear somthing
"Education is learning what you didn't even know you didn't know!"

"True knowledge exists in knowing that you know nothing."

Locked

Return to “[3.0.x] Styles Support & Discussion”