Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-16 14:25:24

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Moving jQuery to an EXTERNAL folder

I’m not sure what Textpattern uses jQuery for, but I use it around my front-end website. However wouldn’t it be much better outside of the textpattern folder? In say a /scripts/ directory, the same as you have your /files/ and /images/


~ Cameron

Offline

#2 2009-07-16 15:57:17

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Moving jQuery to an EXTERNAL folder

It’s used by the admin side which is why it’s in the textpattern folder.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2009-07-16 16:06:21

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Moving jQuery to an EXTERNAL folder

I use a symlink to have jquery.js available in both places: the textpattern folder and my usual scripts folder.


Code is topiary

Offline

#4 2009-07-16 16:54:43

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Moving jQuery to an EXTERNAL folder

a symlink?


~ Cameron

Offline

#5 2009-07-16 16:59:57

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Moving jQuery to an EXTERNAL folder


Code is topiary

Offline

#6 2009-07-16 18:24:52

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Moving jQuery to an EXTERNAL folder

Why can’t you just have jquery.js in both folders, J?


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#7 2009-07-16 18:26:12

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Moving jQuery to an EXTERNAL folder

You can; I just prefer having only one file to keep up to date.


Code is topiary

Offline

#8 2009-07-17 07:55:41

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Moving jQuery to an EXTERNAL folder

If you don’t want textpattern path to appear in source of your site, you can use apache’s mod_rewrite for redirecting /scripts/jquery.js to /textpattern/jquery.js. At least, if I had such problem, i would use this way


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#9 2009-07-17 11:38:41

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Moving jQuery to an EXTERNAL folder

Ah – thanks for that, J.

I thought there might be some sort of technical reason for not duplicating the file.


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#10 2009-08-12 01:00:56

Maria2009
New Member
Registered: 2009-08-08
Posts: 1

Re: Moving jQuery to an EXTERNAL folder

keith wrote:

Ah – thanks for that, J.

I thought there might be some sort of technical reason for not duplicating the file.

thanks for your suggestion

Last edited by Maria2009 (2009-08-12 01:01:08)

Offline

#11 2009-08-12 01:46:34

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Moving jQuery to an EXTERNAL folder

Or you can let Google server you jquery— aam_if_host allows you to link to textpattern’s copy during development, and Google’s copy when deployed:

<script type="text/javascript"↵
	src="<txp:aam_if_host name="examplesite.dev"><txp:site_url/>textpattern/jquery.js↵
	<txp:else/>↵
	http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js↵
	</txp:aam_if_host>" charset="utf-8"></script>

Last edited by johnstephens (2009-08-12 01:55:16)

Offline

#12 2009-08-12 08:03:17

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: Moving jQuery to an EXTERNAL folder


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

Board footer

Powered by FluxBB