Page 3 of 3

Re: call jquery through https in backend

Posted: Tue Jul 30, 2013 7:33 pm
by Bla
Timbalu wrote: Well the bad thing about this is, that doing it this way (assigning real booleans) is processed different with Smarty 2 (==) and Smarty 3 (===), since the last can now fully read real boolean vars. To stay compatible this would need to pass = 'true' string values and re-ask them in the template by == 'true'.
Well, this {if $jquery_needed} should do also...
all three posibilities do not work, the jQuery-CDN is always embedded.

I now did a

Code: Select all

if (!$serendipity['capabilities']['jquery']) {…
in serendipity_event_spamblock_bayes.php to get rid of the second jQuery.

Re: call jquery through https in backend

Posted: Tue Jul 30, 2013 8:14 pm
by Timbalu
Well, I wouldn't have posted that here without some tests..., first and second did do! The third was just a suggestion.

Re: call jquery through https in backend

Posted: Wed Jul 31, 2013 6:56 am
by Bla
So something is different here. Do you know where and when the jquery-capabilities are tested/set?

Re: call jquery through https in backend

Posted: Wed Jul 31, 2013 8:22 am
by Timbalu
...in include/plugin_api.inc.php.
Please refere this problem and fix, to the plugin author, which is Onli.

Re: call jquery through https in backend

Posted: Sat Aug 03, 2013 11:59 am
by onli
Hi
If that code is from me I don't remember it. I thought that whole "react to jquery in the core" was inserted by Garvin to all plugins?

Anyway, can someone give me a patch? Replace which line exactly with

Code: Select all

if (!$serendipity['capabilities']['jquery']) {
?

Regards

Re: call jquery through https in backend

Posted: Sat Aug 03, 2013 12:51 pm
by Timbalu
onli wrote:I thought that whole "react to jquery in the core" was inserted by Garvin to all plugins?
No. The core sets $serendipity['capabilities']['jquery'] = true; as global context, before it includes the template/jquery.js in the serendipity_plugin_api_frontend_header().
It only executes, if current template/plugin does not have its own jquery.js file. The execution can be disabled, if a template's config.inc.php or a plugin sets $serendipity['capabilities']['jquery'] = false.

So now, in the case of bayes, depending on which jquery includement you want to have priority, you will need to do this in the *_bayes.php file in the 'backend_header' or 'backend_configure' hook like this

Code: Select all

    if (!$serendipity['capabilities']['jquery']) {
        include and echo the cdn call...
    }
(purging the code blah posted) or, if wanting to have this smartified and serve both Smarty worlds, by $jquery_needed = 'false/true'; in bayes and {if $jquery_needed == 'true'} in the tpl file. This still needs to be checked by some different situation runs, like Blah and me already pointed out, having different results.