Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.0-dev-CE-fix-editor-none
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Dec 9, 2018
2 parents dce596f + 51e47b0 commit 6d89c4c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 45 deletions.
18 changes: 18 additions & 0 deletions build/media/legacy/joomla.asset.json
Expand Up @@ -12,6 +12,24 @@
"js": [
"media/legacy/js/jquery-noconflict.min.js"
]
},
"jquery.ui.core": {
"name": "jquery.ui.core",
"dependencies": [
"jquery"
],
"js": [
"media/vendor/jquery-ui/js/jquery.ui.core.js"
]
},
"jquery.ui.sortable": {
"name": "jquery.ui.sortable",
"dependencies": [
"jquery.ui.core"
],
"js": [
"media/vendor/jquery-ui/js/jquery.ui.sortable.js"
]
}
}
}
3 changes: 3 additions & 0 deletions build/media_src/system/joomla.asset.json
Expand Up @@ -35,6 +35,9 @@
],
"js": [
"media/system/js/searchtools.min.js"
],
"css": [
"system/searchtools.css"
]
},
"showon": {
Expand Down
3 changes: 3 additions & 0 deletions layouts/joomla/form/field/combo.php
Expand Up @@ -44,6 +44,9 @@

HTMLHelper::_('behavior.combobox');

$attr = '';

// Initialize some field attributes.
$attr .= !empty($class) ? ' class="awesomplete form-control ' . $class . '"' : ' class="awesomplete form-control"';
$attr .= !empty($size) ? ' size="' . $size . '"' : '';
$attr .= !empty($readonly) ? ' readonly' : '';
Expand Down
50 changes: 11 additions & 39 deletions libraries/cms/html/jquery.php
Expand Up @@ -39,37 +39,26 @@ abstract class JHtmlJquery
* @return void
*
* @since 3.0
*
* @deprecated 5.0 Use Joomla\CMS\WebAsset\WebAssetRegistry::enableAsset();
*/
public static function framework($noConflict = true, $debug = null, $migrate = false)
{
// Only load once
if (!empty(static::$loaded[__METHOD__]))
{
return;
}

// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = (boolean) Factory::getApplication()->get('debug');
}

HTMLHelper::_('script', 'vendor/jquery/jquery.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug));
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->enableAsset('jquery');

// Check if we are loading in noConflict
if ($noConflict)
{
HTMLHelper::_('script', 'legacy/jquery-noconflict.min.js', array('version' => 'auto', 'relative' => true));
$wa->enableAsset('jquery-noconflict');
}

// Check if we are loading Migrate
if ($migrate)
{
HTMLHelper::_('script', 'vendor/jquery-migrate/jquery-migrate.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug));
$wa->enableAsset('jquery-migrate');
}

static::$loaded[__METHOD__] = true;

return;
}

Expand All @@ -84,38 +73,21 @@ public static function framework($noConflict = true, $debug = null, $migrate = f
* @return void
*
* @since 3.0
*
* @deprecated 5.0 Use Joomla\CMS\WebAsset\WebAssetRegistry::enableAsset();
*/
public static function ui(array $components = array('core'), $debug = null)
{
// Set an array containing the supported jQuery UI components handled by this method
$supported = array('core', 'sortable');

// Include jQuery
static::framework();

// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = JDEBUG;
}
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();

// Load each of the requested components
foreach ($components as $component)
{
// Only attempt to load the component if it's supported in core and hasn't already been loaded
if (in_array($component, $supported) && empty(static::$loaded[__METHOD__][$component]))
if (in_array($component, $supported))
{
HTMLHelper::_(
'script',
'vendor/jquery-ui/jquery.ui.' . $component . '.min.js',
array(
'version' => 'auto',
'relative' => true,
'detectDebug' => $debug,
)
);

static::$loaded[__METHOD__][$component] = true;
$wa->enableAsset('jquery.ui.' . $component);
}
}

Expand Down
4 changes: 1 addition & 3 deletions libraries/cms/html/searchtools.php
Expand Up @@ -51,9 +51,7 @@ public static function form($selector = '.js-stools-form', $options = array())
$options = static::optionsToRegistry($options);

// Load the script && css files
HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'system/searchtools.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('stylesheet', 'system/searchtools.css', array('version' => 'auto', 'relative' => true));
Factory::getApplication()->getDocument()->getWebAssetManager()->enableAsset('searchtools');

Factory::getDocument()->addScriptOptions('searchtools', $options);

Expand Down
6 changes: 3 additions & 3 deletions plugins/system/debug/debug.php
Expand Up @@ -587,7 +587,7 @@ private function collectLogs(): self
case 'deprecated':
if (!$logDeprecated && !$logDeprecatedCore)
{
continue;
break;
}
$file = $entry->callStack[2]['file'] ?? '';
$line = $entry->callStack[2]['line'] ?? '';
Expand All @@ -608,13 +608,13 @@ private function collectLogs(): self
{
if (!$logDeprecatedCore)
{
continue;
break;
}
$category .= '-core';
}
elseif (!$logDeprecated)
{
continue;
break;
}

$message = [
Expand Down

0 comments on commit 6d89c4c

Please sign in to comment.