Keyword

[SOLVED] Striping off javascript declaration

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago - 9 years 11 months ago #128197 by Felipe Abranches
[SOLVED] Striping off javascript declaration was created by Felipe Abranches
Hi community,

In the sourcecode of a page in my site, I've the script declaration
jQuery(function($) {
        SqueezeBox.initialize({});
        SqueezeBox.assign($('a.modal').get(), {
                parse: 'rel'
        });
});

It's from K2?
I've disabled all "modal" needs from Joomla e K2, but this code still...

If its from K2, in future releases, could it have a code check for the need of this code?
And some one could help me with a quick solution, as a code on the template to stripp off this script, or even the file location where I could make a "if" check?

Thanks in advance.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #128198 by Lefteris
Replied by Lefteris on topic Re: Striping off javascript declaration
Hi. This is the core Joomla! modal declaration. It might be from K2 but it also might be loaded by an other extension. The code that produces this is:
JHTML::_('behavior.modal');

Currently K2 uses this code only in front-end editing where modal is required.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128199 by Felipe Abranches
Replied by Felipe Abranches on topic Re: Striping off javascript declaration
Thanks Lefteris,

I search for but didn't found the "JHTML::_('behavior.modal');" in site/component/com_k2.
Reasons why I think its there in somewhere:
  • the Jquery function "SqueezeBox" only appears in K2 Itens pages. Not in K2 Categories, not in K2 Tags, not in "com_contact" page, not in my Homepage
  • In local enviroment, I've sidisabled ALL MODULES, resting only the component in page, and navigate through the URL directly, and the Jquery function "SqueezeBox" was still there, therefore, it isn't a module that coincidently appears in this pages

As I've said, I've disabled all "modal" needs from Joomla e K2...
Could be a K2 funtcion that unaware calls "JHTML::_('behavior.modal');"?
Is there an "Joomla JHTML::_('behavior.modal') unload" that I could put in my "item.php" override file?

Thanks again!

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #128200 by Lefteris
Replied by Lefteris on topic Re: Striping off javascript declaration
K2 loads this in it's system plugin and in the K2 user module. It is loaded only when user is logged in because it is required. I suggest that you don't edit K2 files. You cannot disable it. It's a part of the core CMS and many extensions ( as K2 ) need it in order to work.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128201 by Felipe Abranches
Replied by Felipe Abranches on topic Re: Striping off javascript declaration
Found it in K2 System Plugin
Log in  or Create an account to join the conversation.

More
9 years 11 months ago #128202 by Lefteris
Replied by Lefteris on topic Re: Striping off javascript declaration
It is not loaded in every item view. It is loaded only when user is logged in because it is required for front-end editing. The variable K2_JOOMLA_MODAL_REQUIRED is defined when there is an extra field of type link and is setup to open in a modal window. The file that does that is components/com_k2/models/item.php .

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128203 by Felipe Abranches
Replied by Felipe Abranches on topic Re: Striping off javascript declaration
Thanks for the answers.
Just desagree on the fact that the image Item has a modal feature, and the "if" logic in K2 system plugin checks if it's a K2 Item reguards anything else
Log in  or Create an account to join the conversation.

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128204 by Felipe Abranches
Replied by Felipe Abranches on topic Re: Striping off javascript declaration
being clearer

Just desagree on the fact that the image Item has a modal feature

Independent of user's login

K2 will adopt Bootstrap in an future release?

Bootstrap Modal, I mean

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #128205 by Lefteris
Replied by Lefteris on topic Re: Striping off javascript declaration
Yes the modal is loaded by K2 in all item views and when front-end editing is required. Our goal for the next version of K2 is to work even when bootstrap is not loaded. So probably it will not use the Bootstrap modal but it will also not load the core modal.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Felipe Abranches
  • Felipe Abranches's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128206 by Felipe Abranches
Replied by Felipe Abranches on topic Re: Striping off javascript declaration
Ok Lefteris!
Thanks for all the information, Its was very clarifying!

Please Log in or Create an account to join the conversation.