Added minify of JS to the compiler area, also improved the infusion area to make more use of the getCustomScriptBuilder method
This commit is contained in:
@ -186,6 +186,32 @@ class ComponentbuilderViewCompiler extends JViewLegacy
|
||||
// add to form
|
||||
$form[] = $debuglinenr;
|
||||
|
||||
// get the minify radio field
|
||||
$minify = JFormHelper::loadFieldType('radio',true);
|
||||
// start minify xml
|
||||
$minifyXML = new SimpleXMLElement('<field/>');
|
||||
// minify attributes
|
||||
$minifyAttributes = array(
|
||||
'type' => 'radio',
|
||||
'name' => 'minify',
|
||||
'label' => 'COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT',
|
||||
'class' => 'btn-group btn-group-yesno',
|
||||
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT',
|
||||
'default' => '2');
|
||||
// load the minify attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($minifyXML, $minifyAttributes);
|
||||
// start the minify options
|
||||
$minifyOptions = array(
|
||||
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
|
||||
'1' => 'COM_COMPONENTBUILDER_YES',
|
||||
'0' => 'COM_COMPONENTBUILDER_NO');
|
||||
// load the minify options
|
||||
ComponentbuilderHelper::xmlAddOptions($minifyXML, $minifyOptions);
|
||||
// setup the minify radio field
|
||||
$minify->setup($minifyXML,2);
|
||||
// add to form
|
||||
$form[] = $minify;
|
||||
|
||||
// get the component list field
|
||||
$component = JFormHelper::loadFieldType('list',true);
|
||||
// start component xml
|
||||
|
@ -98,7 +98,7 @@ if ($this->saveOrder)
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
// joomla_components footer script
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
jQuery('<div id="loading"></div>')
|
||||
|
@ -96,4 +96,27 @@ if ($this->saveOrder)
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// language_translations footer script
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
jQuery('<div id="loading"></div>')
|
||||
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
|
||||
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
|
||||
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
|
||||
.css("width", outerDiv.width())
|
||||
.css("height", outerDiv.height())
|
||||
.css("position", "fixed")
|
||||
.css("opacity", "0.80")
|
||||
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
|
||||
.css("filter", "alpha(opacity = 80)")
|
||||
.css("display", "none")
|
||||
.appendTo(outerDiv);
|
||||
|
||||
// when the export button is clicked
|
||||
jQuery('#toolbar').on('click',"button.button-download", function(e){
|
||||
jQuery('#loading').show();
|
||||
});
|
||||
|
||||
</script>
|
@ -96,4 +96,27 @@ if ($this->saveOrder)
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// languages footer script
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
jQuery('<div id="loading"></div>')
|
||||
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
|
||||
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
|
||||
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
|
||||
.css("width", outerDiv.width())
|
||||
.css("height", outerDiv.height())
|
||||
.css("position", "fixed")
|
||||
.css("opacity", "0.80")
|
||||
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
|
||||
.css("filter", "alpha(opacity = 80)")
|
||||
.css("display", "none")
|
||||
.appendTo(outerDiv);
|
||||
|
||||
// when the build button is clicked
|
||||
jQuery('#toolbar').on('click',"button.button-joomla", function(e){
|
||||
jQuery('#loading').show();
|
||||
});
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user