Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-05 07:10:46

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

stm_javascript and 4.0.6

I wanted to post this in the author support forum but there seems to be no thread for stm_javascript

Bloke wrote

stm_javascript doesn’t show the Javascript tab under Presentation, and already has an add_privs line (mind you, the chances of it clashing with the core due to its violation of the “don’t pollute global namespace” rule is likely)

Can someone find a solution for the 4.0.6 release?

Last edited by colak (2008-02-05 07:54:40)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2008-02-05 08:07:36

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: stm_javascript and 4.0.6

add this as well:

add_privs('handle_backend_javascript', '1,2');

Offline

#3 2008-02-05 11:19:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: stm_javascript and 4.0.6

Hi steve. Many thanks…
Where do I add it?

The plugin code starts with

if (@txpinterface == 'admin') {	
	add_privs('javascript', '1,2');
	register_tab("presentation", "js", "Javascript");
	register_callback("handle_backend_javascript", "js");
}else{
	if(gps('js')){
		return_js(gps('js'));	
	}
}

should I change that to the one below?

if (@txpinterface == 'admin') {	
	add_privs('handle_backend_javascript', '1,2');
	register_tab("presentation", "js", "Javascript");
	register_callback("handle_backend_javascript", "js");
}else{
	if(gps('js')){
		return_js(gps('js'));	
	}
}

Last edited by colak (2008-02-05 11:19:42)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-02-06 15:46:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: stm_javascript and 4.0.6

Found some time and upgraded 3 installs to 406.

neme.org went fine -and so did neme-imca.org but for neme.org/main/ stm_javascript just disappeared from the presentation tab in spite of the fact that I have committed the amendment above.

Any help on this would be appreciated.

> correction the javascript tab is not visible in any installs

Last edited by colak (2008-02-06 15:56:08)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2008-02-06 15:53:03

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: stm_javascript and 4.0.6

hmm maybe that handle_backend_javascript isn’t needed.

try this:

if (txpinterface == 'admin') {	
	add_privs('javascript', '1,2');
	add_privs('js', '1,2');
	register_tab("presentation", "js", "Javascript");
	register_callback("handle_backend_javascript", "js");
}else{
	if(gps('js')){
		return_js(gps('js'));	
	}
}

Offline

#6 2008-02-06 16:08:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: stm_javascript and 4.0.6

Steve I have to say that you were much faster posting the solution than I expected. I was editing my previous post just to find your reply after submitting it.

Your solution worked! the link is not visible in the pull down menu but no worries. An extra click never hurt anyone. Thanks so much for your help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2008-02-06 16:11:31

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: stm_javascript and 4.0.6

np!

while you’re in the plugin tab, it shouldn’t be available in the pulldowns. but while you’re in any other tab, it should be there (at least on my test 4.0.6 installation)

Offline

#8 2008-02-06 16:23:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: stm_javascript and 4.0.6

iblastoff wrote:

np!
while you’re in the plugin tab, it shouldn’t be available in the pulldowns. but while you’re in any other tab, it should be there (at least on my test 4.0.6 installation)

You are right. I am now in the write tab and it is there.

>Edit: Here is the amended plugin code for anyone who might need it.

YTo5OntzOjQ6Im5hbWUiO3M6MTQ6InN0bV9qYXZhc2NyaXB0IjtzOjY6ImF1dGhvciI7czoxNzoiU3RhbmlzbGF2IE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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCglmdW5jdGlvbiBqc19kZWxldGUoKXsNCgkJJG5hbWUgPSBwcygnbmFtZScpOw0KDQoJCWlmICgkbmFtZSAhPSAnZGVmYXVsdCcpDQoJCXsNCgkJCXNhZmVfZGVsZXRlKCRHTE9CQUxTWydqc19wcmVmaXgnXSwgIm5hbWUgPSAnIi5kb1NsYXNoKCRuYW1lKS4iJyIpOw0KDQoJCQlqc19lZGl0KA0KCQkJCWdUeHQoJ2pzX2RlbGV0ZWQnLCBhcnJheSgne25hbWV9JyA9PiAkbmFtZSkpDQoJCQkpOw0KCQl9DQoNCgkJZWxzZQ0KCQl7DQoJCQllY2hvIGdUeHQoJ2Nhbm5vdF9kZWxldGVfZGVmYXVsdF9qcycpLicuJzsNCgkJfQ0KCX0NCiI7czo0OiJ0eXBlIjtzOjE6IjEiO3M6MzoibWQ1IjtzOjMyOiI5MzMwMzJhODQxYjM5NzdhMDM1YWFmMTAzMGJhM2YwNiI7fQ==

Last edited by colak (2008-02-07 16:35:01)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2008-03-14 10:31:14

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: stm_javascript and 4.0.6

I noticed that in Steve’s code the “@” before “txpinterface” disappeared. I’m not a coder: is the same?

Offline

#10 2008-03-14 11:24:47

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: stm_javascript and 4.0.6

This plugin should be like rvm_css as currently slows pages loads on the public side considerably.

Offline

#11 2008-03-14 11:50:13

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: stm_javascript and 4.0.6

candyman, the @ suppresses a PHP warning if txpinterface is not defined, but since it always is in situations where this plugin is used, there’s no need for it.

Robin, I agree. Not just that, but it should be rewritten to avoid name space pollution.

Offline

Board footer

Powered by FluxBB