Archived
Introduce js_backend hook
Will help when JS shall only be emitted in the frontend/backend, as with the CSS
This commit is contained in:
@@ -968,10 +968,13 @@ function serendipity_smarty_init($vars = array()) {
|
||||
}
|
||||
|
||||
if (!isset($serendipity['smarty_vars']['head_link_script'])) {
|
||||
$serendipity['smarty_vars']['head_link_script'] = serendipity_rewriteURL('serendipity.js');
|
||||
if (IN_serendipity_admin === true) {
|
||||
$serendipity['smarty_vars']['head_link_script'] = serendipity_rewriteURL('serendipity_admin.js');
|
||||
} else {
|
||||
$serendipity['smarty_vars']['head_link_script'] = serendipity_rewriteURL('serendipity.js');
|
||||
}
|
||||
|
||||
// When templates are switched, append a specific version string to make sure the browser does not cache the CSS
|
||||
if (strstr($serendipity['smarty_vars']['head_link_stylesheet'], '?')) {
|
||||
if (strstr($serendipity['smarty_vars']['head_link_script'], '?')) {
|
||||
$serendipity['smarty_vars']['head_link_script'] .= '&v=' . $serendipity['last_template_change'];
|
||||
} else {
|
||||
$serendipity['smarty_vars']['head_link_script'] .= '?v=' . $serendipity['last_template_change'];
|
||||
|
||||
Reference in New Issue
Block a user