Skip to content

Commit

Permalink
📦 Update redistribuables
Browse files Browse the repository at this point in the history
  • Loading branch information
Molkobain committed Jul 23, 2019
1 parent 41520e7 commit 1891dd4
Show file tree
Hide file tree
Showing 14 changed files with 523 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@
}
/* Panels: Simple panel with an header and a body to display content nicely */
.mhf-panel {
position: relative;
margin-bottom: 3rem;
}
.mhf-panel .mhf-p-header {
position: relative;
z-index: 1;
display: flex;
align-items: center;
margin-bottom: 0.5rem;
Expand All @@ -82,14 +85,54 @@
.mhf-panel .mhf-p-header .mhf-ph-icon img {
max-width: 38px;
}
.mhf-panel .mhf-p-header .mhf-ph-actions {
position: absolute;
right: 0;
}
.mhf-panel .mhf-p-header .mhf-ph-actions .mhf-ph-toggler {
color: #ea7d1e;
cursor: pointer;
transition-property: transform;
transition-duration: 0.2s;
transition-timing-function: linear;
}
.mhf-panel .mhf-p-body {
position: relative;
/*z-index: 0;*/
/* Must be below header */
margin-top: 0;
padding: 0.3rem;
background-color: #fff;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
transition: all 0.2s ease-in-out;
}
.mhf-panel .mhf-p-body:empty {
display: flex;
justify-content: center;
align-items: center;
}
.mhf-panel .mhf-p-body:empty::after {
content: attr(data-empty-text);
color: #777;
font-style: italic;
}
.mhf-panel:last-child {
margin-bottom: 0;
}
.mhf-panel.mhf-collapsed .mhf-ph-toggler {
transform: rotateZ(90deg);
}
.mhf-panel.mhf-collapsed .mhf-p-body {
margin-top: -50px;
min-height: 50px !important;
max-height: 50px !important;
}
.mhf-panel.mhf-collapsed .mhf-p-body > * {
display: none;
}
.mhf-panel.mhf-collapsed .mhf-p-body:empty::after {
content: "";
}
/* Tooltips */
.mhf-tooltip {
/* qTip tooltips */
Expand All @@ -107,14 +150,19 @@
.mhf-tooltip.qtip .qtip-wrapper .qtip-contentWrapper .qtip-content {
padding: 9px 9px !important;
}
.mhf-tooltip.qtip .qtip-wrapper .qtip-contentWrapper .qtip-content img {
max-width: 100%;
height: initial !important;
/* !important to overload the height in the style attribute of the image, otherwise image ratio is wicked */
}
/* Toggle buttons: Inspired by Mauricio Allende @ https://codepen.io/mallendeo/pen/eLIiG */
.mhf-toggle-button {
font-size: 12pt;
/* Themes */
/* - Flat */
}
.mhf-toggle-button .mhf-tb-input {
display: none;
/* Themes */
/* - Flat */
}
.mhf-toggle-button .mhf-tb-input + .mhf-tb-button {
outline: 0;
Expand Down Expand Up @@ -142,28 +190,40 @@
.mhf-toggle-button .mhf-tb-input:checked + .mhf-tb-button::after {
left: 50%;
}
.mhf-toggle-button .mhf-tb-input.mhf-tb-flat + .mhf-tb-button {
.mhf-toggle-button.mhf-tb-flat .mhf-tb-input + .mhf-tb-button {
padding: 2px;
border-radius: 2em;
background-color: #eaeaea;
box-shadow: inset 0 1px 1px 0px rgba(0, 0, 0, 0.15);
transition: all 0.4s ease;
}
.mhf-toggle-button .mhf-tb-input.mhf-tb-flat + .mhf-tb-button::after {
.mhf-toggle-button.mhf-tb-flat .mhf-tb-input + .mhf-tb-button::after {
border-radius: 50%;
background-color: #fff;
box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.12);
transition: all 0.2s ease;
}
.mhf-toggle-button .mhf-tb-input.mhf-tb-flat:checked + .mhf-tb-button {
.mhf-toggle-button.mhf-tb-flat .mhf-tb-input:checked + .mhf-tb-button {
background-color: #ea7d1e;
}
.mhf-toggle-button .mhf-tb-input.mhf-tb-flat:disabled + .mhf-tb-button {
.mhf-toggle-button.mhf-tb-flat .mhf-tb-input:disabled + .mhf-tb-button {
background-color: #d1d1d1;
}
.mhf-toggle-button .mhf-tb-input.mhf-tb-flat:disabled + .mhf-tb-button::after {
.mhf-toggle-button.mhf-tb-flat .mhf-tb-input:disabled + .mhf-tb-button::after {
background-color: #e6e6e6;
}
.mhf-toggle-button.mhf-tb-flat:hover .mhf-tb-input + .mhf-tb-button, .mhf-toggle-button.mhf-tb-flat:focus .mhf-tb-input + .mhf-tb-button {
background-color: #d6d6d6;
}
.mhf-toggle-button.mhf-tb-flat:hover .mhf-tb-input:checked + .mhf-tb-button, .mhf-toggle-button.mhf-tb-flat:focus .mhf-tb-input:checked + .mhf-tb-button {
background-color: #cc6913;
}
.mhf-toggle-button.mhf-tb-flat:active .mhf-tb-input + .mhf-tb-button {
background-color: #c4c4c4;
}
.mhf-toggle-button.mhf-tb-flat:active .mhf-tb-input:checked + .mhf-tb-button {
background-color: #ab5810;
}
.mhf-toggle-button.mhf-pull-left .mhf-tb-button, .mhf-toggle-button.mhf-pull-right .mhf-tb-button, .mhf-pull-left .mhf-toggle-button .mhf-tb-button, .mhf-pull-right .mhf-toggle-button .mhf-tb-button {
vertical-align: initial;
/* Reset vertical alignment if floated */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ $box-shadow-small: 0 1px 1px rgba(0, 0, 0, 0.15);

/* Panel */
$panel-bg-color: #ffffff;
$panel-empty-hint-color: #777;
//noinspection SassScssResolvedByNameOnly
$panel-collapse-icon-color: $brand-primary;
$panel-collapsed-height: 50px;

/* Toggle buttons */
$toggle-button-off-bg-color: #eaeaea;
//noinspection SassScssResolvedByNameOnly
$toggle-button-on-bg-color: $brand-primary;
$toggle-button-switch-bg-color: #ffffff;

Expand Down Expand Up @@ -87,9 +92,12 @@ $toggle-button-switch-bg-color: #ffffff;
/* Panels: Simple panel with an header and a body to display content nicely */
.mhf-panel{
@extend %mhf-global-settings;
position: relative;
margin-bottom: 3rem;

.mhf-p-header{
position: relative;
z-index: 1;
display: flex;
align-items: center;
margin-bottom: 0.5rem;
Expand All @@ -103,16 +111,64 @@ $toggle-button-switch-bg-color: #ffffff;
max-width: 38px;
}
}
.mhf-ph-actions{
position: absolute;
right: 0;

.mhf-ph-toggler{
color: $panel-collapse-icon-color;
cursor: pointer;
transition-property: transform;
transition-duration: 0.2s;
transition-timing-function: linear;
}
}
}
.mhf-p-body{
position: relative;
/*z-index: 0;*/ /* Must be below header */
margin-top: 0;
padding: 0.3rem;
background-color: $panel-bg-color;
box-shadow: $box-shadow-small;
transition: all 0.2s ease-in-out;

&:empty{
display: flex;
justify-content: center;
align-items: center;

&::after{
content: attr(data-empty-text);
color: $panel-empty-hint-color;
font-style: italic;
}
}
}

&:last-child{
margin-bottom: 0;
}
&.mhf-collapsed{
.mhf-ph-toggler{
transform: rotateZ(90deg);
}
.mhf-p-body{
margin-top: -$panel-collapsed-height;
min-height: $panel-collapsed-height !important;
max-height: $panel-collapsed-height !important;

> *{
display: none;
}

&:empty{
&::after{
content: "";
}
}
}
}
}

/* Tooltips */
Expand All @@ -132,6 +188,11 @@ $toggle-button-switch-bg-color: #ffffff;

.qtip-content{
padding: 9px 9px !important;

img{
max-width: 100%;
height: initial !important; /* !important to overload the height in the style attribute of the image, otherwise image ratio is wicked */
}
}
}
}
Expand Down Expand Up @@ -177,10 +238,12 @@ $toggle-button-switch-bg-color: #ffffff;
&:checked + .mhf-tb-button::after {
left: 50%;
}
}

/* Themes */
/* - Flat */
&.mhf-tb-flat{
/* Themes */
/* - Flat */
&.mhf-tb-flat{
.mhf-tb-input{
+ .mhf-tb-button{
padding: 2px;
border-radius: 2em;
Expand All @@ -206,6 +269,28 @@ $toggle-button-switch-bg-color: #ffffff;
}
}
}

&:hover,
&:focus{
.mhf-tb-input{
+ .mhf-tb-button{
background-color: darken($toggle-button-off-bg-color, 8%);
}
&:checked + .mhf-tb-button{
background-color: darken($toggle-button-on-bg-color, 8%);
}
}
}
&:active{
.mhf-tb-input{
+ .mhf-tb-button{
background-color: darken($toggle-button-off-bg-color, 15%);
}
&:checked + .mhf-tb-button{
background-color: darken($toggle-button-on-bg-color, 15%);
}
}
}
}
}
.mhf-toggle-button.mhf-pull-left,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if($.isFunction($.fn.qtip))
corner: 'leftMiddle',
size: {x: 16, y: 8}, // Made for top/bottom position, overload for left/right positions
},
}
};
// - 'molkobain-light'
// - For top/bottom positioning
$.fn.qtip.styles['molkobain-light'] = {
Expand All @@ -37,14 +37,14 @@ if($.isFunction($.fn.qtip))
tip: {
color: '#ffffff',
},
}
};
// - For left/right positioning
$.fn.qtip.styles['molkobain-light-on-the-side'] = {
name: 'molkobain-light',
tip: {
size: { x: 8, y: 16 },
},
}
};
// - 'molkobain-dark'
// - For top/bottom positioning
$.fn.qtip.styles['molkobain-dark'] = {
Expand All @@ -57,7 +57,7 @@ if($.isFunction($.fn.qtip))
tip: {
color: '#000000',
},
}
};
// - For left/right positioning
$.fn.qtip.styles['molkobain-dark-on-the-side'] = {
name: 'molkobain-dark',
Expand All @@ -66,3 +66,10 @@ if($.isFunction($.fn.qtip))
},
}
}

// Panels
// - Toggler
$(document).on('click', '.mhf-panel .mhf-ph-toggler', function(oEvent){
oEvent.stopPropagation();
$(this).closest('.mhf-panel').toggleClass('mhf-collapsed');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Copyright (c) 2015 - 2019 Molkobain.
*
* This file is part of licensed extension.
*
* Use of this extension is bound by the license you purchased. A license grants you a non-exclusive and non-transferable right to use and incorporate the item in your personal or commercial projects. There are several licenses available (see https://www.molkobain.com/usage-licenses/ for more informations)
*/

namespace Molkobain\iTop\Extension\HandyFramework\Common\Helper;

/**
* Class StringHelper
*
* @package Molkobain\iTop\Extension\HandyFramework\Common\Helper
* @since 1.3.0
*/
class StringHelper
{
/**
* Transform a snake_case $sInput into a CamelCase string
*
* @param string $sInput
*
* @return string
*/
public static function ToCamelCase($sInput)
{
return str_replace(' ', '', ucwords(strtr($sInput, '_-', ' ')));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ public function Render()
$sOnChangeAtt = (!empty($this->sJSOnChangeCallback)) ? 'onchange="javascript: ' . htmlspecialchars($this->sJSOnChangeCallback) . '"' : '';

$sHtml =
<<<EOF
<span class="mhf-toggle-button">
<input class="mhf-tb-input mhf-tb-flat" id="{$this->sInputId}" name="{$this->sInputName}" type="checkbox" {$sOnChangeAtt} {$sInputChecked} {$sInputDisabled} />
<<<HTML
<span class="mhf-toggle-button mhf-tb-flat">
<input class="mhf-tb-input" id="{$this->sInputId}" name="{$this->sInputName}" type="checkbox" {$sOnChangeAtt} {$sInputChecked} {$sInputDisabled} />
<label class="mhf-tb-button" {$sOffTagAtt} {$sOnTagAtt} for="{$this->sInputId}">
</span>
EOF;
HTML;

return $sHtml;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AttributeMHFRackUnit extends AttributeInteger
public function GetValueLabel($sValue)
{
$sValueLabel = parent::GetValueLabel($sValue);
if(!empty($sValueLabel))
if(($sValueLabel !== null) && ($sValueLabel !== ''))
{
$sValueLabel .= 'U';
}
Expand All @@ -36,7 +36,7 @@ public function GetValueLabel($sValue)
public function GetAsHTML($sValue, $oHostObject = null, $bLocalize = true)
{
$sHTMLValue = parent::GetAsHTML($sValue, $oHostObject, $bLocalize);
if(!empty($sHTMLValue))
if(($sHTMLValue !== null) && ($sHTMLValue !== ''))
{
$sHTMLValue .= 'U';
}
Expand Down
Loading

0 comments on commit 1891dd4

Please sign in to comment.