chg: [internal] Optimise genericPicker

pull/7910/head
Jakub Onderka 2021-10-30 21:16:09 +02:00
parent 61a8320b4f
commit da81d0ebc4
6 changed files with 446 additions and 445 deletions

View File

@ -1 +1 @@
<div class="apply_css_arrow" style="padding-left: 5px; font-size: smaller;"><i><?php echo h($infoContextual);?></i></div>
<div class="apply_css_arrow"><i><?= h($infoContextual) ?></i></div>

View File

@ -1,4 +1,3 @@
<?php if (!is_array($infoExtra)): ?>
<?php if (strlen($infoExtra) < 50 && !(isset($forceIcon) && $forceIcon)): ?>
<i style="float:right; font-size: smaller;margin-right: 5px;"><?php echo h($infoExtra); ?></i>

View File

@ -9,7 +9,6 @@ if (is_array($name)) {
<span href="#" class="tagComplete" style="background-color:<?php echo h($background_color); ?>; color:<?php echo h($color); ?>">
<?php echo h($name) ?>
</span>
<?php
} else {
echo h($name);

View File

@ -1 +1 @@
<it class="<?php echo sprintf('%s %s', $this->FontAwesome->findNamespace(str_replace('fa-', '', $preIcon)), h($preIcon)) ?>"></it>
<it class="<?= $this->FontAwesome->findNamespace(str_replace('fa-', '', $preIcon)) . ' ' . h($preIcon) ?>"></it>

View File

@ -4,445 +4,443 @@ App::uses('AppHelper', 'View/Helper');
/*
* Simple helper untangling the mess that the introduction of fas / fab namespaces for icons brought in FA5+
*/
class FontAwesomeHelper extends AppHelper {
public function getClass($icon) {
return $this->findNamespace($icon) . ' fa-' . $icon;
}
public function findNamespace($icon)
{
$fab_icons = array(
'500px',
'accessible-icon',
'accusoft',
'acquisitions-incorporated',
'adn',
'adobe',
'adversal',
'affiliatetheme',
'airbnb',
'algolia',
'alipay',
'amazon',
'amazon-pay',
'amilia',
'android',
'angellist',
'angrycreative',
'angular',
'app-store',
'app-store-ios',
'apper',
'apple',
'apple-pay',
'artstation',
'asymmetrik',
'atlassian',
'audible',
'autoprefixer',
'avianex',
'aviato',
'aws',
'bandcamp',
'battle-net',
'behance',
'behance-square',
'bimobject',
'bitbucket',
'bitcoin',
'bity',
'black-tie',
'blackberry',
'blogger',
'blogger-b',
'bluetooth',
'bluetooth-b',
'bootstrap',
'btc',
'buffer',
'buromobelexperte',
'canadian-maple-leaf',
'cc-amazon-pay',
'cc-amex',
'cc-apple-pay',
'cc-diners-club',
'cc-discover',
'cc-jcb',
'cc-mastercard',
'cc-paypal',
'cc-stripe',
'cc-visa',
'centercode',
'centos',
'chrome',
'chromecast',
'cloudscale',
'cloudsmith',
'cloudversify',
'codepen',
'codiepie',
'confluence',
'connectdevelop',
'contao',
'cpanel',
'creative-commons',
'creative-commons-by',
'creative-commons-nc',
'creative-commons-nc-eu',
'creative-commons-nc-jp',
'creative-commons-nd',
'creative-commons-pd',
'creative-commons-pd-alt',
'creative-commons-remix',
'creative-commons-sa',
'creative-commons-sampling',
'creative-commons-sampling-plus',
'creative-commons-share',
'creative-commons-zero',
'critical-role',
'css3',
'css3-alt',
'cuttlefish',
'd-and-d',
'd-and-d-beyond',
'dashcube',
'delicious',
'deploydog',
'deskpro',
'dev',
'deviantart',
'dhl',
'diaspora',
'digg',
'digital-ocean',
'discord',
'discourse',
'dochub',
'docker',
'draft2digital',
'dribbble',
'dribbble-square',
'dropbox',
'drupal',
'dyalog',
'earlybirds',
'ebay',
'edge',
'elementor',
'ello',
'ember',
'empire',
'envira',
'erlang',
'ethereum',
'etsy',
'evernote',
'expeditedssl',
'facebook',
'facebook-f',
'facebook-messenger',
'facebook-square',
'fantasy-flight-games',
'fedex',
'fedora',
'figma',
'firefox',
'first-order',
'first-order-alt',
'firstdraft',
'flickr',
'flipboard',
'fly',
'font-awesome',
'font-awesome-alt',
'font-awesome-flag',
'fonticons',
'fonticons-fi',
'fort-awesome',
'fort-awesome-alt',
'forumbee',
'foursquare',
'free-code-camp',
'freebsd',
'fulcrum',
'galactic-republic',
'galactic-senate',
'get-pocket',
'gg',
'gg-circle',
'git',
'git-square',
'github',
'github-alt',
'github-square',
'gitkraken',
'gitlab',
'gitter',
'glide',
'glide-g',
'gofore',
'goodreads',
'goodreads-g',
'google',
'google-drive',
'google-play',
'google-plus',
'google-plus-g',
'google-plus-square',
'google-wallet',
'gratipay',
'grav',
'gripfire',
'grunt',
'gulp',
'hacker-news',
'hacker-news-square',
'hackerrank',
'hips',
'hire-a-helper',
'hooli',
'hornbill',
'hotjar',
'houzz',
'html5',
'hubspot',
'imdb',
'instagram',
'intercom',
'internet-explorer',
'invision',
'ioxhost',
'itch-io',
'itunes',
'itunes-note',
'java',
'jedi-order',
'jenkins',
'jira',
'joget',
'joomla',
'js',
'js-square',
'jsfiddle',
'kaggle',
'keybase',
'keycdn',
'kickstarter',
'kickstarter-k',
'korvue',
'laravel',
'lastfm',
'lastfm-square',
'leanpub',
'less',
'line',
'linkedin',
'linkedin-in',
'linode',
'linux',
'lyft',
'magento',
'mailchimp',
'mandalorian',
'markdown',
'mastodon',
'maxcdn',
'medapps',
'medium',
'medium-m',
'medrt',
'meetup',
'megaport',
'mendeley',
'microsoft',
'mix',
'mixcloud',
'mizuni',
'modx',
'monero',
'napster',
'neos',
'nimblr',
'nintendo-switch',
'node',
'node-js',
'npm',
'ns8',
'nutritionix',
'odnoklassniki',
'odnoklassniki-square',
'old-republic',
'opencart',
'openid',
'opera',
'optin-monster',
'osi',
'page4',
'pagelines',
'palfed',
'patreon',
'paypal',
'penny-arcade',
'periscope',
'phabricator',
'phoenix-framework',
'phoenix-squadron',
'php',
'pied-piper',
'pied-piper-alt',
'pied-piper-hat',
'pied-piper-pp',
'pinterest',
'pinterest-p',
'pinterest-square',
'playstation',
'product-hunt',
'pushed',
'python',
'qq',
'quinscape',
'quora',
'r-project',
'raspberry-pi',
'ravelry',
'react',
'reacteurope',
'readme',
'rebel',
'red-river',
'reddit',
'reddit-alien',
'reddit-square',
'redhat',
'renren',
'replyd',
'researchgate',
'resolving',
'rev',
'rocketchat',
'rockrms',
'safari',
'salesforce',
'sass',
'schlix',
'scribd',
'searchengin',
'sellcast',
'sellsy',
'servicestack',
'shirtsinbulk',
'shopware',
'simplybuilt',
'sistrix',
'sith',
'sketch',
'skyatlas',
'skype',
'slack',
'slack-hash',
'slideshare',
'snapchat',
'snapchat-ghost',
'snapchat-square',
'soundcloud',
'sourcetree',
'speakap',
'speaker-deck',
'spotify',
'squarespace',
'stack-exchange',
'stack-overflow',
'staylinked',
'steam',
'steam-square',
'steam-symbol',
'sticker-mule',
'strava',
'stripe',
'stripe-s',
'studiovinari',
'stumbleupon',
'stumbleupon-circle',
'superpowers',
'supple',
'suse',
'symfony',
'teamspeak',
'telegram',
'telegram-plane',
'tencent-weibo',
'the-red-yeti',
'themeco',
'themeisle',
'think-peaks',
'trade-federation',
'trello',
'tripadvisor',
'tumblr',
'tumblr-square',
'twitch',
'twitter',
'twitter-square',
'typo3',
'uber',
'ubuntu',
'uikit',
'uniregistry',
'untappd',
'ups',
'usb',
'usps',
'ussunnah',
'vaadin',
'viacoin',
'viadeo',
'viadeo-square',
'viber',
'vimeo',
'vimeo-square',
'vimeo-v',
'vine',
'vk',
'vnv',
'vuejs',
'waze',
'weebly',
'weibo',
'weixin',
'whatsapp',
'whatsapp-square',
'whmcs',
'wikipedia-w',
'windows',
'wix',
'wizards-of-the-coast',
'wolf-pack-battalion',
'wordpress',
'wordpress-simple',
'wpbeginner',
'wpexplorer',
'wpforms',
'wpressr',
'xbox',
'xing',
'xing-square',
'y-combinator',
'yahoo',
'yammer',
'yandex',
'yandex-international',
'yarn',
'yelp',
'yoast',
'youtube',
'youtube-square',
'zhihu'
);
if (in_array($icon, $fab_icons)) {
return 'fab';
} else {
return 'fas';
}
}
class FontAwesomeHelper extends AppHelper
{
const FAB_ICONS = array(
'500px' => true,
'accessible-icon' => true,
'accusoft' => true,
'acquisitions-incorporated' => true,
'adn' => true,
'adobe' => true,
'adversal' => true,
'affiliatetheme' => true,
'airbnb' => true,
'algolia' => true,
'alipay' => true,
'amazon' => true,
'amazon-pay' => true,
'amilia' => true,
'android' => true,
'angellist' => true,
'angrycreative' => true,
'angular' => true,
'app-store' => true,
'app-store-ios' => true,
'apper' => true,
'apple' => true,
'apple-pay' => true,
'artstation' => true,
'asymmetrik' => true,
'atlassian' => true,
'audible' => true,
'autoprefixer' => true,
'avianex' => true,
'aviato' => true,
'aws' => true,
'bandcamp' => true,
'battle-net' => true,
'behance' => true,
'behance-square' => true,
'bimobject' => true,
'bitbucket' => true,
'bitcoin' => true,
'bity' => true,
'black-tie' => true,
'blackberry' => true,
'blogger' => true,
'blogger-b' => true,
'bluetooth' => true,
'bluetooth-b' => true,
'bootstrap' => true,
'btc' => true,
'buffer' => true,
'buromobelexperte' => true,
'canadian-maple-leaf' => true,
'cc-amazon-pay' => true,
'cc-amex' => true,
'cc-apple-pay' => true,
'cc-diners-club' => true,
'cc-discover' => true,
'cc-jcb' => true,
'cc-mastercard' => true,
'cc-paypal' => true,
'cc-stripe' => true,
'cc-visa' => true,
'centercode' => true,
'centos' => true,
'chrome' => true,
'chromecast' => true,
'cloudscale' => true,
'cloudsmith' => true,
'cloudversify' => true,
'codepen' => true,
'codiepie' => true,
'confluence' => true,
'connectdevelop' => true,
'contao' => true,
'cpanel' => true,
'creative-commons' => true,
'creative-commons-by' => true,
'creative-commons-nc' => true,
'creative-commons-nc-eu' => true,
'creative-commons-nc-jp' => true,
'creative-commons-nd' => true,
'creative-commons-pd' => true,
'creative-commons-pd-alt' => true,
'creative-commons-remix' => true,
'creative-commons-sa' => true,
'creative-commons-sampling' => true,
'creative-commons-sampling-plus' => true,
'creative-commons-share' => true,
'creative-commons-zero' => true,
'critical-role' => true,
'css3' => true,
'css3-alt' => true,
'cuttlefish' => true,
'd-and-d' => true,
'd-and-d-beyond' => true,
'dashcube' => true,
'delicious' => true,
'deploydog' => true,
'deskpro' => true,
'dev' => true,
'deviantart' => true,
'dhl' => true,
'diaspora' => true,
'digg' => true,
'digital-ocean' => true,
'discord' => true,
'discourse' => true,
'dochub' => true,
'docker' => true,
'draft2digital' => true,
'dribbble' => true,
'dribbble-square' => true,
'dropbox' => true,
'drupal' => true,
'dyalog' => true,
'earlybirds' => true,
'ebay' => true,
'edge' => true,
'elementor' => true,
'ello' => true,
'ember' => true,
'empire' => true,
'envira' => true,
'erlang' => true,
'ethereum' => true,
'etsy' => true,
'evernote' => true,
'expeditedssl' => true,
'facebook' => true,
'facebook-f' => true,
'facebook-messenger' => true,
'facebook-square' => true,
'fantasy-flight-games' => true,
'fedex' => true,
'fedora' => true,
'figma' => true,
'firefox' => true,
'first-order' => true,
'first-order-alt' => true,
'firstdraft' => true,
'flickr' => true,
'flipboard' => true,
'fly' => true,
'font-awesome' => true,
'font-awesome-alt' => true,
'font-awesome-flag' => true,
'fonticons' => true,
'fonticons-fi' => true,
'fort-awesome' => true,
'fort-awesome-alt' => true,
'forumbee' => true,
'foursquare' => true,
'free-code-camp' => true,
'freebsd' => true,
'fulcrum' => true,
'galactic-republic' => true,
'galactic-senate' => true,
'get-pocket' => true,
'gg' => true,
'gg-circle' => true,
'git' => true,
'git-square' => true,
'github' => true,
'github-alt' => true,
'github-square' => true,
'gitkraken' => true,
'gitlab' => true,
'gitter' => true,
'glide' => true,
'glide-g' => true,
'gofore' => true,
'goodreads' => true,
'goodreads-g' => true,
'google' => true,
'google-drive' => true,
'google-play' => true,
'google-plus' => true,
'google-plus-g' => true,
'google-plus-square' => true,
'google-wallet' => true,
'gratipay' => true,
'grav' => true,
'gripfire' => true,
'grunt' => true,
'gulp' => true,
'hacker-news' => true,
'hacker-news-square' => true,
'hackerrank' => true,
'hips' => true,
'hire-a-helper' => true,
'hooli' => true,
'hornbill' => true,
'hotjar' => true,
'houzz' => true,
'html5' => true,
'hubspot' => true,
'imdb' => true,
'instagram' => true,
'intercom' => true,
'internet-explorer' => true,
'invision' => true,
'ioxhost' => true,
'itch-io' => true,
'itunes' => true,
'itunes-note' => true,
'java' => true,
'jedi-order' => true,
'jenkins' => true,
'jira' => true,
'joget' => true,
'joomla' => true,
'js' => true,
'js-square' => true,
'jsfiddle' => true,
'kaggle' => true,
'keybase' => true,
'keycdn' => true,
'kickstarter' => true,
'kickstarter-k' => true,
'korvue' => true,
'laravel' => true,
'lastfm' => true,
'lastfm-square' => true,
'leanpub' => true,
'less' => true,
'line' => true,
'linkedin' => true,
'linkedin-in' => true,
'linode' => true,
'linux' => true,
'lyft' => true,
'magento' => true,
'mailchimp' => true,
'mandalorian' => true,
'markdown' => true,
'mastodon' => true,
'maxcdn' => true,
'medapps' => true,
'medium' => true,
'medium-m' => true,
'medrt' => true,
'meetup' => true,
'megaport' => true,
'mendeley' => true,
'microsoft' => true,
'mix' => true,
'mixcloud' => true,
'mizuni' => true,
'modx' => true,
'monero' => true,
'napster' => true,
'neos' => true,
'nimblr' => true,
'nintendo-switch' => true,
'node' => true,
'node-js' => true,
'npm' => true,
'ns8' => true,
'nutritionix' => true,
'odnoklassniki' => true,
'odnoklassniki-square' => true,
'old-republic' => true,
'opencart' => true,
'openid' => true,
'opera' => true,
'optin-monster' => true,
'osi' => true,
'page4' => true,
'pagelines' => true,
'palfed' => true,
'patreon' => true,
'paypal' => true,
'penny-arcade' => true,
'periscope' => true,
'phabricator' => true,
'phoenix-framework' => true,
'phoenix-squadron' => true,
'php' => true,
'pied-piper' => true,
'pied-piper-alt' => true,
'pied-piper-hat' => true,
'pied-piper-pp' => true,
'pinterest' => true,
'pinterest-p' => true,
'pinterest-square' => true,
'playstation' => true,
'product-hunt' => true,
'pushed' => true,
'python' => true,
'qq' => true,
'quinscape' => true,
'quora' => true,
'r-project' => true,
'raspberry-pi' => true,
'ravelry' => true,
'react' => true,
'reacteurope' => true,
'readme' => true,
'rebel' => true,
'red-river' => true,
'reddit' => true,
'reddit-alien' => true,
'reddit-square' => true,
'redhat' => true,
'renren' => true,
'replyd' => true,
'researchgate' => true,
'resolving' => true,
'rev' => true,
'rocketchat' => true,
'rockrms' => true,
'safari' => true,
'salesforce' => true,
'sass' => true,
'schlix' => true,
'scribd' => true,
'searchengin' => true,
'sellcast' => true,
'sellsy' => true,
'servicestack' => true,
'shirtsinbulk' => true,
'shopware' => true,
'simplybuilt' => true,
'sistrix' => true,
'sith' => true,
'sketch' => true,
'skyatlas' => true,
'skype' => true,
'slack' => true,
'slack-hash' => true,
'slideshare' => true,
'snapchat' => true,
'snapchat-ghost' => true,
'snapchat-square' => true,
'soundcloud' => true,
'sourcetree' => true,
'speakap' => true,
'speaker-deck' => true,
'spotify' => true,
'squarespace' => true,
'stack-exchange' => true,
'stack-overflow' => true,
'staylinked' => true,
'steam' => true,
'steam-square' => true,
'steam-symbol' => true,
'sticker-mule' => true,
'strava' => true,
'stripe' => true,
'stripe-s' => true,
'studiovinari' => true,
'stumbleupon' => true,
'stumbleupon-circle' => true,
'superpowers' => true,
'supple' => true,
'suse' => true,
'symfony' => true,
'teamspeak' => true,
'telegram' => true,
'telegram-plane' => true,
'tencent-weibo' => true,
'the-red-yeti' => true,
'themeco' => true,
'themeisle' => true,
'think-peaks' => true,
'trade-federation' => true,
'trello' => true,
'tripadvisor' => true,
'tumblr' => true,
'tumblr-square' => true,
'twitch' => true,
'twitter' => true,
'twitter-square' => true,
'typo3' => true,
'uber' => true,
'ubuntu' => true,
'uikit' => true,
'uniregistry' => true,
'untappd' => true,
'ups' => true,
'usb' => true,
'usps' => true,
'ussunnah' => true,
'vaadin' => true,
'viacoin' => true,
'viadeo' => true,
'viadeo-square' => true,
'viber' => true,
'vimeo' => true,
'vimeo-square' => true,
'vimeo-v' => true,
'vine' => true,
'vk' => true,
'vnv' => true,
'vuejs' => true,
'waze' => true,
'weebly' => true,
'weibo' => true,
'weixin' => true,
'whatsapp' => true,
'whatsapp-square' => true,
'whmcs' => true,
'wikipedia-w' => true,
'windows' => true,
'wix' => true,
'wizards-of-the-coast' => true,
'wolf-pack-battalion' => true,
'wordpress' => true,
'wordpress-simple' => true,
'wpbeginner' => true,
'wpexplorer' => true,
'wpforms' => true,
'wpressr' => true,
'xbox' => true,
'xing' => true,
'xing-square' => true,
'y-combinator' => true,
'yahoo' => true,
'yammer' => true,
'yandex' => true,
'yandex-international' => true,
'yarn' => true,
'yelp' => true,
'yoast' => true,
'youtube' => true,
'youtube-square' => true,
'zhihu' => true,
);
public function getClass($icon)
{
return $this->findNamespace($icon) . ' fa-' . $icon;
}
public function findNamespace($icon)
{
return isset(self::FAB_ICONS[$icon]) ? 'fab' : 'fas';
}
}

View File

@ -1188,6 +1188,11 @@ li .generic-picker-item-element-check {
margin-right: 8px;
}
.generic_picker .apply_css_arrow {
padding-left: 5px;
font-size: smaller;
}
.apply_css_arrow:before {
content: '';
margin-right: 5px;