85 Posts
yuberlin
9 years ago
Topic

I thougt Mootools ist not necessary any more when working with SEBLOD. But when using Frontend Form, these scripts are still needed (justTextfields and fieldx images):

- mootools-core.js
- core.js
- mootools-more.js
- modal.js

And why is bootstrap.min.js loaded when using custom frontend templates?

Please SEBLOD, work on this. I dont want to load 300-500kb with script just to send a submit button. Please add options to activate/deactive script loading.

Im on a Template with foundation at the moment and these bunch of dependecies is really annoying. So this is just SEBLOD for a simple Frontend form:

jquery.min.js
jquery-noconflict.js
jquery-migrate.min.js
cck.core-3.3.0.min.js
mootools-core.js
core.js
mootools-more.js
modal.js
jquery.ui.min.js
cck.validation-3.2.0.min.js
bootstrap.min.js
frontediting.js

+ inline Javascript.

This is 1MB Javascript.! Really?

Get a Book for SEBLOD
572 Posts
_jrmo
9 years ago
0
Level 1

yuberlin,

There are so many things wrong with your post that I'm struggling to know where to start in addressing it, here it goes:

  • Firstly, we have forum rules here. Please read them and then act on them. Your message should start with a greeting, and end with a salutation.
  • Secondly, this forum is a community forum for users to help each other. Not for you to demand things of the SEBLOD team. SEBLOD is on GitHub now, if you want to work on removing some JS dependency, feel free to submit your code.
  • Thirdly, you are wrong. Some of these scripts are obviously neccesary (like a Field X needs JS to work.. it's as simple as that). modal.js should not be loaded unless your images are linked with a modal window. So if you don't want it loaded you can remove it. Validation can be switched off in the Global Configurations > SEBLOD. This will remove the validation.min.js file AND jquery UI. 
  • Fourth, Mootools isn't neccesary, but Joomla still loads it. See here to remove: http://forum.joomla.org/viewtopic.php?f=706&t=813835
  • Fifth, bootstrap.js is loaded by Joomla. Again, see the above method to unload it.
  • Finally, maybe instead of having a rant next time. Just politely ask if someone from the community can help you in removing unnecessary javascripts from your front end. You'd be surprised how quickly you'll get answered.

Cheers,

_jrmo

85 Posts
yuberlin
9 years ago
1
Level 1

Thanks for your answer...

Mootools isn't neccesary

Thanks for your answer. Actually i cant get fieldX to work without these files: mootools-core.js, mootools-more.js and modal.js.

I tried different templates but without these files the fieldX functions are not working (add, delete, sort). That crazy because i can see that these functions are jQuery. Is this a JS conflict maybe?

9 years ago
0
Level 2

Hello everyone!

As far as I understand in Joomla 3.3 (probably in 3.x in general) you can safely turn off mootools by using some plugin like Mootools Enabler/Disabler. 

Joomla declares that mootools usage is depreciated since 3.x and supported for backward compatibility.

And IF your template doesn't use mootools - no issues. 
Native joomla forms front-end validation (like registration form, for instance) WILL work as expected, after mootools are switched off..
BUT Seblod form validation will stop to work as expected with unloaded mootools.

So, we can't say that mootools is Joomla issue..and Seblod doesn't need it, unfortunately.

Probably somebody have some experience in switching off mootools successfully and keeping Seblod forms validation working, please share your experiences..

Thank you!

Kind regards,

Sergey

85 Posts
yuberlin
9 years ago
1
Level 1

So what i found out now is that Joomla form submission for the frontend needs at least:
- mootools-core.js
- core.js

Using fieldX in Frontend forms, requires addional:
- mootools-more.js
- modal.js

Otherwise the JS functions are not working. Are these JS Files necessary for fieldX or is it just a JS error?


For disabling bootstrap.min.js in the frontend (its loaded by different Joomla modules/plugins) you need a small plugin with this code:

class plgSystemRemoveBootstrap extends JPlugin
{
public function onBeforeCompileHead()
{
// Application Object
$app = JFactory::getApplication();

// Frontend
if( $app instanceof JApplicationSite )
{
$doc = JFactory::getDocument();
// Remove default bootstrap
unset($doc->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']);
}
}
}


(Source: http://stackoverflow.com/questions/19168731/joomla-3-1-remove-bootstrap)

This is tested with custom frontend template seb_minima/site.

572 Posts
_jrmo
9 years ago
0
Level 2

Yuberlin,

Thanks so much for contributing back your findings! It's great to see when people learn something and share it back with the community.

Another way to override bootstrap.js in your template (probably not really the best way) is to upload a blank file called "bootstrap.js" in your

templates/template_name/js/jui/

directory. This will just load a blank .js file instead of the one that ships with Joomla core. The same process can be applied to jquery.min.js if you want to use a different version of jquery in your site.

85 Posts
yuberlin
9 years ago
1
Level 1

Actually its not a good idea to remove bootstrap.js because its loaded everywhere. As soon as a user is logged in, the default tooltip function is loaded. This functions needs bootstrap.js and breaks all following javascript due to js error ("tooltip is not a function"). 

In my opinion, joomla developers shouldn't rely on frontend frameworks like bootstrap so deep in the core. At the moment there is no clean way to get rid of bootstrap. As a frontend developer i like clean seperation of function and form. Bootstrap is form (frontend) and shouldnt be in the joomla core. Thats different with mootools because these js functions are used for function (like saving), not for frontend presentation. 

85 Posts
yuberlin
9 years ago
0
Level 2

So you are right...best way at the moment is to put a blank bootstrap.min.js in "/yourtemplate/js/jui/"

8 years ago
0
Level 1

Hi 

When you use mootool disabler Plugin then we can discover than some css and js disseppear in the frontend . 

remove javascript links file are

  • cck-core-3.5.0.min.js
  • caption.js
  • core.js
  • mootools-more.js
  • mootools-core.js

remove css links file are

  • cck.css
  • cckcontent.css 

So without study futher seblod / Joomla ; i think  seblod use for run is some case mootools libraries ( original question) .

regard's

test on joomla 3.4.1 Seblod 3.6.0

Get a Book for SEBLOD