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
Dragondz wrote:
Is the plugin parsed (can we include txp tag inside javascript file) ?
Hi Rabah
The simple answer is no. Textpattern tags (along with PHP) are server-side – and JavaScript is client-side.
This post might help.
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Is there an easy way to migrate scripts from stm_javascript?
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
MattD wrote:
Is there an easy way to migrate scripts from stm_javascript?
Was asking myself the same question; then I saw this in Simon’s first post
stm_javascript
If stm_javascript is installed and activated you will see two JavaScript tabs in Presentation – one named ‘Javascript’ (stm_javascript – with lowercase ‘s’) and another ‘JavaScript’ (spf_js – uppercase ‘S’).
You can copy and paste scripts from stm_javascript to spf_js – and then disable stm_javascript. It’s not advisable to run both plugins simultaneously.
Last edited by joebaich (2012-05-07 19:13:47)
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
MattD wrote:
Is there an easy way to migrate scripts from stm_javascript?
Hi Matt
The easiest way is to activate both plugins — then you’ll have 2 tabs in Presentation called Javascript (stm_javascript) and JavaScript (spf_js) — and copy and paste from one to the other. Then de-activate stm_javascript.
stm_javascript uses a ‘rogue’ database table name (with a txp prefix rather than a plugin author prefix) and base64 encodes the scripts (which is no longer needed) and so made it trickier to write a simple import/export function.
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon,
I’ve hit on a minor bug.
I created a new javascript which I want to delete. On clicking the delete button, the script is deleted from the js folder but it still remains in the txp db and it is still visible in the admin interface.
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
Deleting a script works fine on the several setups I’ve tested it on .. so I can’t reproduce your problem.
What’s your setup (Textpattern version, PHP version, plugin verison)?
And what happens if you edit the script you can’t delete, re-save it and then try to delete it?
Thanks,
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon,
If I edit the script and save it, the static file is recreated. If i delete the script from the txp interface, the static file is deleted but the entry is still visible in the txp interface and the db.
the diagnostics might be of help:
Textpattern version: 4.4.1 (r3575)
Last update: 2012-04-30 08:01:16/2012-04-30 07:56:10
PHP version: 5.3.5
GD Image Library: bundled (2.0.34 compatible); supported formats: GIF, JPG, PNG.
Server TZ: America/Los_Angeles
Server local time: 2012-05-18 21:58:49
DST enabled?: 0
Automatically adjust DST setting?: 0
Time zone: Asia/Nicosia (7200)
MySQL: 5.1.39-log
Locale: en_GB.UTF-8
Server: Apache
PHP server API: cgi-fcgi
RFC 2616 headers: 0
Server OS: Linux 3.2.15-grsec-grsec-2.9-rc1
Active plugins: zem_contact_lang-4.0.3.6, zem_contact_reborn-4.0.3.20, zem_redirect-1.2.1, glx_if-0.7, rss_admin_db_manager-4.3, mem_postmaster-1.0.7, adi_notes-1.1.1, spf_js-0.2, upm_img_popper-1.3.7, rvm_css-0.9.1, wet_babble-0.2, mem_postmaster_library-1.0.4, bot_privs-0.3.2, bot_write_tab_customize-0.7.1, rah_textile_bar-0.7, smd_where_used-0.30, rah_change_passwords-0.8
Admin-side theme: remora 4.4.1
.htaccess file contents:
------------------------
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
------------------------
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
The code in the delete function is pretty much the same as that in rvm_css (and txp_css).
Could you please check the following:
- is the problem specific to one script (i.e. can you create, edit and delete a ‘test’ script successfully)?
- can you create, edit and delete stylesheets successfully?
- what’s the name you gave to the script you can’t delete?
Thanks,
Simon
Last edited by spiffin (2012-05-19 15:11:48)
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
spiffin wrote:
Hi Simon
- is the problem specific to one script (i.e. can you create, edit and delete a ‘test’ script successfully)?
Yes
- can you create, edit and delete stylesheets successfully?
Yes
- what the name you gave to the script you can’t delete?
You might have something here. The name of the script is jquery.cycle. The dot might be the one which causes problem
Last edited by colak (2012-05-19 11:24:30)
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
New version 0.3 fixes delete issues with dots in filenames (thanks Yiannis).
(Yiannis: if you re-save your jquery.cycle script – and then try and delete it – it should work.)
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
That was very fast. The new version fixes the problem. Thanks!
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
Version 0.4 released – now with Minify support.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
#@spf_js
#@language it-it
spf_javascript => JavaScript
spf_js_dir => JavaScript directory
spf_script_name => Nome dello script
spf_edit_script => Stai modificando lo script
spf_copy_script => …o copia lo script con nome
spf_all_scripts => Tutti gli script
spf_create_new_script => Crea nuovo script
spf_script_created => Script <strong>{name}</strong> creato.
spf_script_exists => Lo script <strong>{name}</strong> esiste già.
spf_script_name_required => Per favore inserisci un nome per lo script
spf_script_updated => Script <strong>{name}</strong> aggiornato.
spf_script_deleted => Script <strong>{name}</strong> cancellato.
spf_cannot_delete_default_script => Lo script <strong>default</strong> non può essere cancellato.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
MarcoK wrote:
#@language it-it
Thanks Marco – Italian Textpack added.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
spiffin a écrit:
Dragondz wrote:
Is the plugin parsed (can we include txp tag inside javascript file) ?
Hi Rabah
The simple answer is no. Textpattern tags (along with PHP) are server-side – and JavaScript is client-side.
This post might help.
Simon
Hi Simon
Ok then the only way to use txp tag inside javascript is to embed the code directly into the page or form, but not on javascript tab.
Offline