Created
March 24, 2010 20:08
-
-
Save SupermanScott/342721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//fetches all JS src and concats them | |
// md5() the above | |
// On click / form submit add ID from above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$js_page_id = $_POST['js_page_id']; | |
$files_in_parent = cache_get($js_page_id, 'cache'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hook_preprocess_page() { | |
foreach (drupal_add_js() as $type => $data) { | |
if ($type == 'file') { | |
foreach $data as $path => $info { | |
$paths .= base_path() . $path; | |
$js_files[] = $info; | |
} | |
} | |
} | |
$js_page_id = md5($paths); | |
cache_set($js_page_id, $js_files); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment