Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Rabah
I’m wondering if rah_external and spf_javascript could work together for your needs.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Yiannis
I make a test: create an spf_js:
var toto = <txp:category />
and create a rah_externat_output named css:
<txp:spf_js />
and then embed it using:
<txp:rah_external_output name=“css”/>
that not worked, the code inserted.
But if using rah_external_output alone and putting a snippet:
<script>
var toto = <txp:category name=“produits”/>
</script>
that works, but the js is embedded in html!
I dont think we can parse txp:tags inside spf_js because it stores the js in a flat file to improve speed load, i think i must continue putting thos kind of code directly inside html.
Cheers
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon
I am trying to install this plugin in a subdomain on txp4.5 but it just does not recognise the js directory.
After installation, I visit the advanced preferences where the existing js directory is not detected.
When I enable the plugin I get a modal window stating internal error "Table 'my_db.prefixspf_js' doesn't exist" and after clicking OK I get I’m sorry. I’m afraid I can’t do that. I think spf_js is no safe operation at this time.
I checked the db and spf_js table is not created.
This is the first time I am installing this plugin in a subdomain. Should you need a login to the site to check what is happening please let me know.
Last edited by colak (2012-09-09 15:26:04)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hello Yiannis
I’ve just installed a clean copy of Textpattern 4.5.1 on a local subdomain and installed spf_js with no problems whatsoever.
I’m assuming your site is on a Unix server with PHP 5?
I suggest you check your file privileges, database privileges and check your logs (PHP and MySQL error logs).
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
hi Simon
It seems that the problem is fixed now. I did not mention that the installation was not only in a subdomain but also in a “prefixed” db. I reinstalled txp without the prefix and your plugin worked just fine.
Having said that, there is a display problem in the remora theme, mentioned here
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Thanks – I’m aware of the styling issues and an update will be coming soon.
I’m away from home until next week so it’ll be a week or two.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Version 0.5 released for Textpattern >= 4.5.1
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon,
I have a problem with new version: 0.5
I have tried instal into a new TXP installation and the plugin not create the prefs field.
So, it show the default script but not save or alter it and I can’t create a new script.
I solved installing version 0.4 and then update to 0.5.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
MarcoK wrote:
I have tried instal into a new TXP installation and the plugin not create the prefs field.
Hi Marco
Thanks for spotting that .. a new version will be out very soon.
EDIT: fixed version (v0.51) out now.
Simon
Last edited by spiffin (2012-11-07 20:42:44)
Offline
#40 2014-12-01 22:09:02
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
I’m having a difficult time getting spf_js to work on my site. As I’ve mentioned in other threads, this is my first time working with more than bare html and css sites, so forgive me if I’m being a bit dense, missing something obvious.
I’m currently developing on my server in a subdirectory (www.mydomainname.com/test) while I work on the site upgrade. The Textpattern installation/directory is in the “test” subdirectory. When the Github page for the plugin states:
“Create a directory for the static JavaScript files in the root of your textpattern installation. You should make sure that PHP is able to write to that directory.”
That means I would put the “js” directory in the “test” directory, correct? Because, for the purposes of developing this upgrade, “test” is the root, right? Or do I put the “js” directory in the “textpattern” directory within the “test” directory?
When the Github page instructions say:
“Visit the Advanced Preferences (Admin > Preferences > Advanced) and make sure the “JavaScript directory” preference contains the directory you created in step 1 (by default ‘js’). “
That means I would put “www.mydomainname.com/test/js” as the path in the Javascript entry under Advanced Preferences, correct?
Thanks for helping me understand.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hello
1. Put the ‘js’ directory in your root directory – in your case inside the ‘test’ directory.
2. Under Advanced Prefs just enter ‘js’ (it’s in relation to your root directory).
Simon
Offline
#42 2014-12-01 23:22:30
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
Thanks. Ok, that’s what I thought. I’d put the “js” directory inside of “test”, and had left the “javascript” path in the advanced setting at it’s default “js”. I made sure the plugin was installed and activated. But it doesn’t seem to be working.
I’ve installed and activated the spf_js plugin. I created a form, “js_link” which simply outputs <txp:spf_js />, and then included the tag <txp:output_form form="js_link"> on each page, so that I could quickly change the javascript link if need be.
To see if the javascript was functioning, I included this basic function to the default javascript file.
function popup() {
alert("Hello World")
}
And added this to my default txp page.
<input type="button" onclick="popup()" value="Click Me!">
When I checked the site in the browser, the “Click Me!” button was of course created, but I’m not getting any popup. I can’t seem to figure out what the problem is.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
You don’t need to create a form etc.
Once you’ve added your javascript to the default javascript just add <txp:spf_js /> to the relevant page template.
If you’re still having trouble, can you go to Admin > Diagnostics and tell me what is says for Document root and $path_to_site?
Last edited by spiffin (2014-12-02 00:16:44)
Offline
#44 2014-12-02 21:02:03
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
I understand that I don’t need to create a form for the link, but was worried that I wouldn’t get the plugin to work properly, and Figured it would be easier to change a form than to change the link on several different pages if I end up trying to deal with the javascript manually.
According to diagnostics:
Document root: /home/43/94/8309443/web
$path_to_site: /home/43/94/8309443/web/test
Thanks for trying to help me figure this out.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hmm .. all looks fine to me.
I set up a quick local install of Textpattern in a sub-directory to test and it works fine.
If you look at the page source can you see the javascript?
Offline