Search

I would like to see a field that resembles Aaron’s Reflection Field, only that the input xPath would be a node containing JavaScript, and the value stored would be a compressed version of this, using the JavaScriptPacker Class, by Dean Edwards, ported to PHP by Nicolas Martin.

I have no idea how to do this myself, I have all the files needed for the compression, and I was wondering if anyone would like to do this?

Also, on the same note, I’m having to add CDATA wrappers to the JavaScript before it’s stored via the textarea. I’m thinking that for compression purposes, they would have to be removed for compression and reapplied afterwards. Therefore, my thoughts are to have a JavaScript text area which automatically adds the CDATA wrappers? So that the user would only ever have to add pure Javascript to the textarea. This field would have to have a mysql datatype of longtext or mediumtext IMHO.

What are anyones thoughts, or whether anyone would like to build this extension with both fields, as I say, I don’t know how to do it, and wouldn’t know even with pointers in the right direction…

I’ve made an extension for the textarea, JavaScript Textarea.

My thoughts are that this could be further modified to return either uncompressed, or compressed JavaScript, I would definitely need some help doing that bit!

Normally compression is set up globally in the virtual configuration or in the main .htaccess file. Here is an .htaccess example — you might need some changes depending on your host (i.e Apache version):

# setup compression w/ mod_deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details