36 Commits

Author SHA1 Message Date
shadlaws
e8752f60b8 Remove extension from cache busters of non-combined JS/CSS links (follows 2078). 2013-07-09 11:19:20 +02:00
Daniel Muller
2d20af76f9 #2078 Missing file type extension on combined css/js 2013-07-06 13:08:51 +08:00
shadlaws
a1b5cf2e8d #2051 - Revise how Gallery_View returns combined JS and CSS.
Changed Gallery_View's JS and CSS combining to:
- have get_combined() combine all groups if called without arguments.
- ensure the "core" group is combined first.
- always put links where get_combined() is called, even if combining is disabled (otherwise the order isn't preserved).
- add key as cache buster when combining is disabled.
- make "LOOKING FOR YOUR CSS/JAVASCRIPT..." comments in get_combined(), not in the theme itself.
Also, revised xss_data.txt golden file (line number changes only).
2013-03-12 15:00:59 +01:00
Bharat Mediratta
dece6dc5a5 Create gallery::allow_css_and_js_combining() which lets you disable combining CSS/JS
by touching var/DONT_COMBINE.  Fixes #1989.
2013-02-02 23:39:16 -05:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
79a2e3f1a7 Use a stdClass wrapper around the data in the before_combine and
after_combine events so that event handlers can modify the data.
Fixes #1789.
2011-10-03 21:47:18 -07:00
Bharat Mediratta
5cf38ed816 Stop using Pagination() and instead use $theme->pager() in views.
Move the pager() function up to Gallery_View and replace
themes/admin_wind/views/pager.html.php (Pagination based) with a
modified version from the wind theme in
themes/admin_wind/views/paginator.html.php.  Fixes #1718.
2011-04-26 09:48:21 -07:00
Bharat Mediratta
fa4fb20f80 If we've cleared out the last group in a combine_queue for a given
type, unset the combine_queue for that type entirely.  This way future
calls to css() and script() emit an element until there's a new call
to start_combining().  Fixes 1685.
2011-04-23 06:50:47 -07:00
Bharat Mediratta
5bc0da3652 Create before_combine and after_combine events to allow modules and themes to
interact with the combine list ahead of time, and to be able to do things like
minification after it's combined.  Fixes #1653.
2011-04-21 14:33:08 -07:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
376f09c4e1 Reorganize the url() function out from in the middle of the script/css combining functions. 2011-01-15 12:47:15 -08:00
Bharat Mediratta
5ac49d497f Create new APIs for allowing themers to control what CSS/JS get
combined and when.  Backwards compatible in that old themes will work,
but their CSS/JS will no longer be combined unless they make some
changes.  Fixes #1600.
2011-01-10 22:20:12 -08:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Tim Almdal
ee9c921397 Don't use realpath when calculating the relative paths of embedded references in css files. This fixes ticket #910 2009-11-21 09:36:12 -08:00
Tim Almdal
b2a9bf43af Change gallery::find_file to not assume that the absolute path is relative to the document root. Instead ignore all th path parts until one of application, modules, themes, or libs is found. Fixes ticket #827 2009-10-01 12:44:18 -07:00
Bharat Mediratta
a0a62a0992 Do a pass on the gallery::find_file and Gallery_View::{script,css} PHPdoc. 2009-09-28 19:30:34 -07:00
Tim Almdal
28624bb8f1 Update the PHPDoc for gallery::find_file and convert Gallery_View::script/css to use gallery::find_file 2009-09-28 09:04:44 -07:00
Bharat Mediratta
dbeadc1407 Use the Kohana cascading filesystem to locate resources loaded by the
theme.  Because the theme comes first, this means that themes can
override any module resources, at the cost that we no longer have
namespacing for JS and CSS files.

The only file getting used outside of this model is
themes/default/screen.css which is used in the admin theme.  I fixed
that by copying screen.css into admin_default and renaming its
screen.css to admin_screen.css.  I also copied over all the images
that it was referencing.

Fixes tickets #48 and #539.

Theme API changes:
- theme_script(), theme_url() and theme_css() are no longer needed
- script(), url() and css() now refer to the first matching asset in
  the module load path, where gallery3/lib is at the end of the path
2009-07-22 14:27:57 -07:00
Bharat Mediratta
d692002bcf Don't show the combined CSS/JS elements if we didn't combine anything.
Fixes ticket #554.
2009-07-17 18:24:31 -07:00
Bharat Mediratta
6200955003 Don't bother making gzencoded version of combined CSS/JS if zlib.output_compression=On 2009-07-17 18:19:43 -07:00
Kevin Nehls
85b0f58029 move fix for backslashes on windows outside of loop per bharat's suggestion
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-16 21:36:51 +08:00
Kevin Nehls
5cb2f42628 Fix backslashes in relative URLs of combined css files.
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-16 21:36:50 +08:00
Bharat Mediratta
a674170bf7 2 fixes:
1) Include the url in the cache key so that if the Gallery moves, we
   don't use old cached entries.

2) Use the relative path to files in the comments that we embed in our
   files so that we don't leak local paths.
2009-07-01 22:55:43 -07:00
Tim Almdal
6e80330e19 Remove the testing code to force rebuilding the cache. 2009-06-29 21:16:42 -07:00
Bharat Mediratta
95b900d4f4 Fix some bugs in the combined JS/CSS code (most of which I introduced
in my last refactor):

1) Actually combine the JS (I was only combining the CSS)
2) Add line breaks between the files and comment them so that we can
   find a specific file inside the blob.
3) Add an HTML comment to help developers figure out why they can't
   find their CSS/JS.
2009-06-29 19:11:59 -07:00
Bharat Mediratta
325203e1ca Add a media type using the most common media type from our CSS. This
doesn't fix the problem that we need to support multiple media types
(the original code had superfish using just "screen", and some other
deviations).

There's no code yet to support multiple media types, but it would not
be too difficult to create buckets based on media.
2009-06-29 18:27:29 -07:00
Bharat Mediratta
fa8ca2f7ad Refactor combine_xxx() functions together into combine_files() and use
html functions to generate the resulting elements.  Add phpdoc.
2009-06-29 18:12:53 -07:00
Tim Almdal
86596f9595 Merge branch 'master' of git@github.com:gallery/gallery3 2009-06-29 15:04:15 -07:00
Tim Almdal
34c76c0906 A Combined javascript seems to work.
1) CSS files are added to the combined version by use of $theme->css() or $theme->css_theme() methods
2) url references in the css are converted to full paths as opposed to relative
3) @import statements in the css are resolved as well.
4) need to move the [if IE] statements into the css files so the will be honored in the browser. currently the ie fix css are always included.
2009-06-29 12:32:11 -07:00
Bharat Mediratta
16d4922e3a Remove unused $theme_relative arg from theme_script(). 2009-06-29 09:07:29 -07:00
Tim Almdal
6ec293dfe7 *Note* work in progress.
Implement the combined css functionality.  Local url references and replace with absolute urls instead of relative.
2009-06-29 08:24:42 -07:00
Tim Almdal
10b4eda6f0 Merge branch 'master' of git@github.com:gallery/gallery3
Conflicts:
	modules/gallery/libraries/Theme_View.php
	themes/admin_default/views/admin.html.php
2009-06-29 06:44:05 -07:00
Bharat Mediratta
6e8a8c53e6 Rename $theme->url() to $theme->theme_url() for consistency wiht
$theme->theme_script().
2009-06-28 19:49:48 -07:00
Bharat Mediratta
c4f991bb7d Clean up the combined javascript change and refactor out the
Gallery_View base class from Theme_View and Admin_View.

1) Move all the theme specific jquery stuff from gallery_theme::head()
and admin_head() into the theme files.  Use $theme->script() as
appropriate.

2) Get rid of the extra boolean on $theme->url() that we were using so
that we could call $theme->script($theme->url(...)) -- add
$theme->theme_script() instead (poorly named, but still clearer than
what we had before)

3) Fix the bug that combined scripts didn't work at all in the admin
theme.

4) Get rid of $theme->display() in favor of new View(...)
2009-06-28 19:45:11 -07:00