Skip to content

Commit

Permalink
Merge branch '4.0-dev' into j4nodeinterface
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeutz committed Jan 4, 2019
2 parents 160966f + 56affaf commit ecd260b
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 197 deletions.
Expand Up @@ -4,7 +4,7 @@
name="itemtype"
type="itemtype"
filtermode="selector"
onchange="jQuery('select[id^=\'filter_\']').val('');jQuery('select[id^=\'list_\']').val('');this.form.submit();"
onchange="Joomla.resetFilters(this)"
>
<option value="">COM_ASSOCIATIONS_FILTER_SELECT_ITEM_TYPE</option>
</field>
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_banners/tmpl/tracks/default.php
Expand Up @@ -96,10 +96,10 @@
'width' => '300px',
'modalWidth' => '40',
'footer' => '<a class="btn" data-dismiss="modal" type="button"'
. ' onclick="jQuery(\'#downloadModal iframe\').contents().find(\'#closeBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#downloadModal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('COM_BANNERS_CANCEL') . '</a>'
. '<button class="btn btn-success" type="button"'
. ' onclick="jQuery(\'#downloadModal iframe\').contents().find(\'#exportBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#downloadModal\', buttonSelector: \'#exportBtn\'})">'
. Text::_('COM_BANNERS_TRACKS_EXPORT') . '</button>',
)
); ?>
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_csp/tmpl/reports/default.php
Expand Up @@ -46,11 +46,11 @@
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button type="button" class="btn" data-dismiss="modal"'
. ' onclick="jQuery(\'#plugin' . $this->httpHeadersId . 'Modal iframe\').contents().find(\'#closeBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->httpHeadersId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="jQuery(\'#plugin' . $this->httpHeadersId . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
. '<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->httpHeadersId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" onclick="jQuery(\'#plugin' . $this->httpHeadersId . 'Modal iframe\').contents().find(\'#applyBtn\').click(); return false;">'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->httpHeadersId . 'Modal\', buttonSelector: \'#applyBtn\'})">'
. Text::_("JAPPLY") . '</button>'
)
); ?>
Expand Down
Expand Up @@ -3,7 +3,7 @@
<field
name="client_id"
type="list"
onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
onchange="Joomla.resetFilters(this)"
filtermode="selector"
>
<option value="0">JSITE</option>
Expand Down
12 changes: 6 additions & 6 deletions administrator/components/com_menus/tmpl/menus/default.php
Expand Up @@ -182,13 +182,13 @@
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a type="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#closeBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleEdit' . $module->id . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<button type="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleEdit' . $module->id . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#applyBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleEdit' . $module->id . 'Modal\', buttonSelector: \'#applyBtn\'})">'
. Text::_('JAPPLY') . '</button>',
)
); ?>
Expand All @@ -211,13 +211,13 @@
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a type="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleAddModal iframe\').contents().find(\'#closeBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleAddModal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<button type="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleAddModal iframe\').contents().find(\'#saveBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleAddModal\', buttonSelector: \'#saveBtn\'})">'
. Text::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleAddModal iframe\').contents().find(\'#applyBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#moduleAddModal\', buttonSelector: \'#applyBtn\'})">'
. Text::_('JAPPLY') . '</button>',
)
); ?>
Expand Down
Expand Up @@ -131,7 +131,7 @@ protected function addToolbar()
. Text::_('JCANCEL')
. '</button>'
. '<button class="btn btn-success" type="button" data-dismiss="modal" aria-hidden="true"'
. ' onclick="jQuery(\'#modal-cog iframe\').contents().find(\'#saveBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#modal-cog\', buttonSelector: \'#saveBtn\'})">'
. Text::_('JSAVE')
. '</button>'
);
Expand Down
Expand Up @@ -8,7 +8,7 @@
label=""
filtermode="selector"
layout="default"
onchange="jQuery('#filter_position, #filter_module, #filter_language').val('');this.form.submit();"
onchange="Joomla.resetFilters(this)"
>
<option value="0">JSITE</option>
<option value="1">JADMINISTRATOR</option>
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_redirect/tmpl/links/default.php
Expand Up @@ -41,11 +41,11 @@
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button type="button" class="btn" data-dismiss="modal" aria-hidden="true"'
. ' onclick="jQuery(\'#plugin' . $this->redirectPluginId . 'Modal iframe\').contents().find(\'#closeBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true" onclick="jQuery(\'#plugin' . $this->redirectPluginId . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
. '<button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" aria-hidden="true" onclick="jQuery(\'#plugin' . $this->redirectPluginId . 'Modal iframe\').contents().find(\'#applyBtn\').click(); return false;">'
. '<button type="button" class="btn btn-success" aria-hidden="true" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
)
); ?>
Expand Down
Expand Up @@ -4,7 +4,7 @@
name="client_id"
type="list"
filtermode="selector"
onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
onchange="Joomla.resetFilters(this)"
>
<option value="0">JSITE</option>
<option value="1">JADMINISTRATOR</option>
Expand Down
Expand Up @@ -4,7 +4,7 @@
name="client_id"
type="list"
filtermode="selector"
onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
onchange="Joomla.resetFilters(this)"
>
<option value="0">JSITE</option>
<option value="1">JADMINISTRATOR</option>
Expand Down
6 changes: 3 additions & 3 deletions administrator/language/en-GB/en-GB.com_csp.ini
Expand Up @@ -7,7 +7,7 @@ COM_CSP="Content Security Policy"
COM_CSP_CONFIGURATION="Content Security Policy: Options"
COM_CSP_EDIT_PLUGIN_SETTINGS="Edit Plugin Settings"
COM_CSP_FILTER_SEARCH_DESC="Search in the table fields. Prefix with ID: to search by ID."
COM_CSP_FILTER_SEARCH_LABEL="Search CSP Reports"
COM_CSP_FILTER_SEARCH_LABEL="Search Content Security Policy Reports"
COM_CSP_HEADING_DOCUMENT_URI="URL"
COM_CSP_HEADING_BLOCKED_URI="Blocked Element"
COM_CSP_HEADING_DIRECTIVE="Directive"
Expand All @@ -31,6 +31,6 @@ COM_CSP_N_ITEMS_TRASHED_1="%d report trashed."
COM_CSP_N_ITEMS_UNPUBLISHED="%d reports unpublished."
COM_CSP_N_ITEMS_UNPUBLISHED_1="%d report unpublished."
COM_CSP_PLUGIN_MODAL_DISABLED="The %s is disabled. It needs to be enabled for this component to work."
COM_CSP_REPORTS="CSP Reports"
COM_CSP_REPORTS="Content Security Policy Reports"
COM_CSP_SYSTEM_PLUGIN="HTTP Headers System Plugin"
COM_CSP_TABLE_CAPTION="Table of CSP Reports"
COM_CSP_TABLE_CAPTION="Table of Content Security Policy Reports"
1 change: 1 addition & 0 deletions build/build.php
Expand Up @@ -68,6 +68,7 @@ function clean_checkout(string $dir)
system('find . -name phpunit.*.xml | xargs rm -rf -');
system('find . -name phpunit.xml.dist | xargs rm -rf -');
system('find . -name README.md | xargs rm -rf -');
system('find . -name SECURITY.md | xargs rm -rf -');

echo "Cleaning vendors.\n";

Expand Down
Expand Up @@ -43,7 +43,7 @@
warning: [
`<div class="message-alert">
${Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE').replace('%s', `<span class="badge badge-pill badge-danger">${updateInfoList.length}</span>`)}
<button type="button" class="btn btn-sm btn-primary" onclick="document.location=${options.url}">
<button type="button" class="btn btn-sm btn-primary" onclick="document.location='${options.url}'">
${Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON')}
</button>
</div>`,
Expand Down
63 changes: 63 additions & 0 deletions build/media_src/system/js/core.es6.js
Expand Up @@ -1139,6 +1139,69 @@ window.Joomla.Modal = window.Joomla.Modal || {
}
}
};

/**
* Method that resets the filter inputs and submits the relative form
*
* @param {HTMLElement} The element that initiates the call
* @returns {void}
* @since 4.0
*/
Joomla.resetFilters = (element) => {
const { form } = element;

if (!form) {
throw new Error('Element must be inside a form!');
}

const elementsArray = [].slice.call(form.elements);

if (elementsArray.length) {
const newElementsArray = [];
elementsArray.forEach((elem) => {
// Skip the token, the task, the boxchecked and the calling element
if (elem.getAttribute('name') === 'task'
|| elem.getAttribute('name') === 'boxchecked'
|| (elem.value === '1' && /^[0-9A-F]{32}$/i.test(elem.name))
|| elem === element) {
return;
}

newElementsArray.push(elem);
});

// Reset all filters
newElementsArray.forEach((elem) => {
elem.value = '';
});

form.submit();
}
};

/*
* Method to invoke a click on button inside an iframe
*
* @param {object} options Object with the css selector for the parent element of an iframe
* and the selector of the button in the iframe that will be clicked
* @returns {boolean}
* @since 4.0
*/
Joomla.iframeButtonClick = (options = { iframeSelector: '', buttonSelector: '' }) => {
if (!options.iframeSelector || !options.buttonSelector) {
throw new Error('Selector is missing');
}

const iframe = document.querySelector(`${options.iframeSelector} > iframe`);
if (iframe) {
const button = iframe.contentWindow.document.querySelector(options.buttonSelector);
if (button) {
button.click();
}
}

return false;
};
})(Joomla, document);

/**
Expand Down
2 changes: 1 addition & 1 deletion components/com_newsfeeds/tmpl/newsfeed/default.php
Expand Up @@ -21,7 +21,7 @@
<?php echo $this->msg; ?>
<?php else : ?>
<?php $lang = Factory::getLanguage(); ?>
<?php $myrtl = $this->newsfeed->rtl; ?>
<?php $myrtl = $this->item->rtl; ?>
<?php $direction = ' '; ?>
<?php $isRtl = $lang->isRtl(); ?>
<?php if ($isRtl && $myrtl == 0) : ?>
Expand Down
2 changes: 1 addition & 1 deletion layouts/joomla/toolbar/modal.php
Expand Up @@ -43,7 +43,7 @@
. ' onclick="window.parent.Joomla.Modal.getCurrent().close();">'
. Text::_('COM_BANNERS_CANCEL') . '</a>'
. '<button class="btn btn-success" type="button"'
. ' onclick="jQuery(\'#modal_downloadModal iframe\').contents().find(\'#exportBtn\').click();">'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#modal_downloadModal\', buttonSelector: \'#exportBtn\'})">'
. Text::_('COM_BANNERS_TRACKS_EXPORT') . '</button>',
]
);
Expand Down
5 changes: 5 additions & 0 deletions libraries/src/Service/Provider/Database.php
Expand Up @@ -90,6 +90,11 @@ function (Container $container)
'prefix' => $conf->get('dbprefix'),
];

if (JDEBUG)
{
$options['monitor'] = new \Joomla\Database\Monitor\DebugMonitor;
}

try
{
$db = DatabaseDriver::getInstance($options);
Expand Down
8 changes: 4 additions & 4 deletions plugins/system/debug/DataCollector/QueryCollector.php
Expand Up @@ -12,8 +12,8 @@
use DebugBar\DataCollector\AssetProvider;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\Database\Monitor\DebugMonitor;
use Joomla\Plugin\System\Debug\AbstractDataCollector;
use Joomla\Plugin\System\Debug\DebugMonitor;
use Joomla\Registry\Registry;

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ public function collect(): array
'xdebug_link' => $this->getXdebugLinkTemplate(),
'root_path' => JPATH_ROOT
],
'count' => \count($this->queryMonitor->getLog()),
'count' => \count($this->queryMonitor->getLogs()),
];
}

Expand Down Expand Up @@ -179,13 +179,13 @@ public function getAssets(): array
private function getStatements(): array
{
$statements = [];
$log = $this->queryMonitor->getLog();
$logs = $this->queryMonitor->getLogs();
$timings = $this->queryMonitor->getTimings();
$memoryLogs = $this->queryMonitor->getMemoryLogs();
$stacks = $this->queryMonitor->getCallStacks();
$collectStacks = $this->params->get('query_traces');

foreach ($log as $id => $item)
foreach ($logs as $id => $item)
{
$queryTime = 0;
$queryMemory = 0;
Expand Down

0 comments on commit ecd260b

Please sign in to comment.