1
0

This should make jquery.js of a theme no longer be included for the default backend.

Custom backends would now use jquery_backend.js if they really wanted to provide their own.

References #166
This commit is contained in:
Garvin Hicking
2014-05-22 11:59:50 +02:00
parent e8bae220e6
commit 0e008d0885
2 changed files with 12 additions and 2 deletions

View File

@ -4,6 +4,15 @@
Version 2.0-beta3 () Version 2.0-beta3 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Due to distinction of backend and frontend themes, each theme
that provides a custom jquery.js now only does so for the
frontend. The backend now listens to a:
$serendipity['capabilities']['jquery_backend'] = false;
variable, and the file needs to be jquery_backend.js that
a backend theme would reference to.
* Changed 2k11's config.inc.php file to provide a more stable * Changed 2k11's config.inc.php file to provide a more stable
call of event hooks so that other templates can also hook call of event hooks so that other templates can also hook
their own events. their own events.

View File

@ -16,6 +16,7 @@ include_once S9Y_INCLUDE_PATH . 'include/functions.inc.php';
* or during runtime, * or during runtime,
*/ */
$serendipity['capabilities']['jquery'] = true; $serendipity['capabilities']['jquery'] = true;
$serendipity['capabilities']['jquery_backend'] = true;
$serendipity['core_events']['frontend_header']['jquery'] = 'serendipity_plugin_api_frontend_header'; $serendipity['core_events']['frontend_header']['jquery'] = 'serendipity_plugin_api_frontend_header';
$serendipity['core_events']['backend_header']['jquery'] = 'serendipity_plugin_api_backend_header'; $serendipity['core_events']['backend_header']['jquery'] = 'serendipity_plugin_api_backend_header';
@ -44,8 +45,8 @@ function serendipity_plugin_api_backend_header($event_name, &$bag, &$eventData,
// jquery can be disabled if a template's config.inc.php or a plugin sets // jquery can be disabled if a template's config.inc.php or a plugin sets
// $serendipity['capabilities']['jquery'] = false // $serendipity['capabilities']['jquery'] = false
$check = serendipity_getTemplateFile('jquery.js'); $check = serendipity_getTemplateFile('jquery_backend.js');
if (!$check && $serendipity['capabilities']['jquery']) { if (!$check && $serendipity['capabilities']['jquery_backend']) {
?> ?>
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script> <script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script>
<?php <?php