File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -4929,6 +4929,10 @@ function drupal_build_js_cache($files) {
4929
4929
$ contents .= file_get_contents ($ path ) . "; \n" ;
4930
4930
}
4931
4931
}
4932
+
4933
+ // Allow modules to act on the js_cche before writing to disk.
4934
+ drupal_alter ('js_cache ' , $ contents );
4935
+
4932
4936
// Prefix filename to prevent blocking by firewalls which reject files
4933
4937
// starting with "ad*".
4934
4938
$ filename = 'js_ ' . drupal_hash_base64 ($ contents ) . '.js ' ;
Original file line number Diff line number Diff line change @@ -744,6 +744,26 @@ function hook_js_alter(&$javascript) {
744
744
$ javascript ['misc/jquery.js ' ]['data ' ] = drupal_get_path ('module ' , 'jquery_update ' ) . '/jquery.js ' ;
745
745
}
746
746
747
+ /**
748
+ * Perform necessary alterations to the concatenated JavaScript before it is
749
+ * presented on the page.
750
+ *
751
+ * @param $contents
752
+ * A string of the concatenated JavaScript.
753
+ *
754
+ * @see drupal_build_js_cache()
755
+ */
756
+ function hook_js_cache_alter (&$ contents ) {
757
+ $ header = <<<HEADER
758
+ /**
759
+ * Powered by Pressflow
760
+ * http://pressflow.org
761
+ */
762
+ HEADER ;
763
+
764
+ $ contents = $ header . "\n" . $ contents ;
765
+ }
766
+
747
767
/**
748
768
* Registers JavaScript/CSS libraries associated with a module.
749
769
*
You can’t perform that action at this time.
0 commit comments