Git Product home page Git Product logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Of option 1 and 2, I would prefer option 1. Option 2 feels too likely to break.

Could the license text be added in the PHP code instead of external .txt files? 
This
would seem cleaner to me, each license is just a few lines long, and could just 
be
another option field in the file settings array?

I would advocate keeping the copyright statement together with the original 
work, for
2 reasons:
1) If the user saves the webpage and moves it, then any non-linked resources 
would be
lost.
2) Several licenses require that the copyright notice must be left intact, as 
one
example the modern BSD license says "Redistributions of source code must retain 
the
above copyright notice, this list of conditions and the following disclaimer."

Original comment by [email protected] on 2 May 2008 at 6:53

from minify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Outputting content before calling Minify::serve() will generally not work since
serve() sends headers and encodes content (so you'd have mixed encoding 
garbage).

If you *really* want to keep the comments in the PHP code, you can use a
Minify_Source and directly give it the content:

new Minify_Source(array(
  'id' => 'jsComments' // arbitrary, but required
  ,'content' => '/* put comments here */'
  ,'minifier' => ''
  ,'lastModified' => filemtime(__FILE__) // allows caching
))

Option 3: An option to prepend a multi-line comment that lists the files 
compressed:

/* This file contains compressed versions of these source files:
http://example.com/js/jquery.js 
http://example.com/js/dojo.js
http://example.com/js/user.js 
Please see the above files for copyright/license information. */

I'm still not crazy about it. I think this should be manually done via Option 2,
rather than a bunch more Minify code.

Original comment by [email protected] on 2 May 2008 at 8:17

from minify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Option 3 looks good to me. :-)

Original comment by [email protected] on 2 May 2008 at 10:01

from minify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Taking cue from the YUI Compressor, I've added a "preserveComments" option 
(default
true) to Minify_Javascript in r79. This preserves multi-line comments that 
begin with
"/*!".

This requires minimal user modification to the sources, and is a pretty simple 
system
with predictable output. 

TODO: revise Minify_CSS to have the same option instead of sniffing for 
"copyright".

Original comment by [email protected] on 7 May 2008 at 8:21

  • Changed state: Started

from minify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Minify_Javascript now has the "preserveComments" option, and, by default, 
preserves
multi-line comments that begin with "/*!".

Original comment by [email protected] on 14 May 2008 at 4:18

  • Changed state: Fixed

from minify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.