call jquery through https in backend

Found a bug? Tell us!!
Bla
Regular
Posts: 25
Joined: Sat Feb 03, 2007 7:42 pm
Location: Germany
Contact:

Re: call jquery through https in backend

Post 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.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: call jquery through https in backend

Post by Timbalu »

Well, I wouldn't have posted that here without some tests..., first and second did do! The third was just a suggestion.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Bla
Regular
Posts: 25
Joined: Sat Feb 03, 2007 7:42 pm
Location: Germany
Contact:

Re: call jquery through https in backend

Post by Bla »

So something is different here. Do you know where and when the jquery-capabilities are tested/set?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: call jquery through https in backend

Post by Timbalu »

...in include/plugin_api.inc.php.
Please refere this problem and fix, to the plugin author, which is Onli.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: call jquery through https in backend

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: call jquery through https in backend

Post 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.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply