diff --git a/assets/yform-formbuilder.css b/assets/yform-formbuilder.css index 3c162c86..bf808224 100644 --- a/assets/yform-formbuilder.css +++ b/assets/yform-formbuilder.css @@ -1,69 +1 @@ -#yform-formbuilder .form-horizontal .control-label { - font-weight: 400; - text-align: left; -} - -#yform-formbuilder-classes-showhelp .panel { - margin-bottom: 0; -} -#yform-formbuilder-classes-showhelp .rex-page-section + .rex-page-section { - border-top: 1px solid #c1c9d4; -} -#yform-formbuilder-classes-showhelp .panel-title { - font-size: 14px; -} - - -#yform-js-formbuilder-placeholders { - position: relative; - margin-top: -6px; - margin-bottom: 10px; - padding: 30px 12px 10px 12px; - background-color: #fff; - border: 1px solid #c1c9d4; -} -#yform-js-formbuilder-placeholders h3 { - position: absolute; - top: 0; - left: 0; - margin: 0; - padding: 5px 12px; - background: #f3f6fb; - color: #324050; - font-size: 12px; -} -#yform-js-formbuilder-placeholders code { - cursor: pointer; -} -#yform-js-formbuilder-placeholders-help { - margin: 10px -12px -10px -12px; - padding-top: 5px; - padding-bottom: 5px; - background: #f3f6fb; - border-top: 1px solid #dfe3e9; - color: #324050; - font-size: 12px; -} -#yform-formbuilder-info { - padding: 5px 0; - border-top: 1px solid #c1c9d4; - font-size: 12px; - text-align: right; -} - -table.yform-table-help tr.yform-classes-famous { - background: #c2d0e0; -} - -table.yform-table-help tr.yform-classes-famous .btn-default { - background-color: #e1e9f4; - border-color: #a1a9b4 -} - -table.yform-table-help tr.yform-classes-famous .example-code { - display: inline-block; -} - -table.yform-table-help tr.yform-classes-deprecated { - background: #f1a9b4; -} +#yform-formbuilder .form-horizontal .control-label{font-weight:400;text-align:left}#yform-formbuilder-classes-showhelp .panel{margin-bottom:0}#yform-formbuilder-classes-showhelp .rex-page-section+.rex-page-section{border-top:1px solid #c1c9d4}#yform-formbuilder-classes-showhelp .panel-title{font-size:14px}#yform-js-formbuilder-placeholders{position:relative;margin-top:-6px;margin-bottom:10px;padding:30px 12px 10px 12px;background-color:#fff;border:1px solid #c1c9d4}#yform-js-formbuilder-placeholders h3{position:absolute;top:0;left:0;margin:0;padding:5px 12px;background:#f3f6fb;color:#324050;font-size:12px}#yform-js-formbuilder-placeholders code{cursor:pointer}#yform-js-formbuilder-placeholders-help{margin:10px -12px -10px -12px;padding-top:5px;padding-bottom:5px;background:#f3f6fb;border-top:1px solid #dfe3e9;color:#324050;font-size:12px}#yform-formbuilder-info{padding:5px 0;border-top:1px solid #c1c9d4;font-size:12px;text-align:right}table.yform-table-help tr.yform-classes-famous{background-color:rgba(75, 154, 217, 0.2)}table.yform-table-help tr.yform-classes-famous:hover{background-color:rgba(75, 154, 217, 0.3)}table.yform-table-help tr.yform-classes-famous .example-code{display:inline-block}table.yform-table-help tr.yform-classes-deprecated{background-color:rgba(217, 83, 79, 0.2)}table.yform-table-help tr.yform-classes-deprecated:hover{background-color:rgba(217, 83, 79, 0.3)}body.rex-theme-dark table.yform-table-help tr.yform-classes-famous{background-color:rgba(24, 103, 166, 0.2)}body.rex-theme-dark table.yform-table-help tr.yform-classes-famous:hover{background-color:rgba(24, 103, 166, 0.3)}body.rex-theme-dark table.yform-table-help tr.yform-classes-deprecated{background-color:rgba(128, 25, 25, 0.2)}body.rex-theme-dark table.yform-table-help tr.yform-classes-deprecated:hover{background-color:rgba(128, 25, 25, 0.3)}@media (prefers-color-scheme:dark){body.rex-has-theme:not(.rex-theme-light) table.yform-table-help tr.yform-classes-famous{background-color:rgba(24, 103, 166, 0.2)}body.rex-has-theme:not(.rex-theme-light) table.yform-table-help tr.yform-classes-famous:hover{background-color:rgba(24, 103, 166, 0.3)}body.rex-has-theme:not(.rex-theme-light) table.yform-table-help tr.yform-classes-deprecated{background-color:rgba(128, 25, 25, 0.2)}body.rex-has-theme:not(.rex-theme-light) table.yform-table-help tr.yform-classes-deprecated:hover{background-color:rgba(128, 25, 25, 0.3)}} diff --git a/assets/yform.css b/assets/yform.css index b925bd07..7b7db3bf 100644 --- a/assets/yform.css +++ b/assets/yform.css @@ -1,40 +1 @@ -.yform-select-style { - overflow: hidden; - width: 100%; - margin-bottom: 6px; - background: #fff url("data:image/png;base64,R0lGODlhDwAUAIABAAAAAP///yH5BAEAAAEALAAAAAAPABQAAAIXjI+py+0Po5wH2HsXzmw//lHiSJZmUAAAOw==") no-repeat 98% 50%; - border: 1px solid #c1c9d4; -} -.yform-select-style select { - width: 100%; - padding: 6px 12px; - background: transparent; - background-image: none; - border: none; - box-shadow: none; - -webkit-appearance: none; - -moz-appearance:none; - -webkit-border-radius: 0px; -} -.yform-select-style select:focus { - outline: none; - background-color: transparent; -} -.yform-select-style select:hover { - cursor: pointer; -} - -.yform-table-help td { - -ms-word-break: break-all; - word-break: break-all; -} - -.form-captcha .input-group-addon { - padding: 0; -} - -.form-captcha .input-group-addon > img { - height: 100%; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} \ No newline at end of file +.yform-select-style{overflow:hidden;width:100%;margin-bottom:6px;background:#fff url("data:image/png;base64,R0lGODlhDwAUAIABAAAAAP///yH5BAEAAAEALAAAAAAPABQAAAIXjI+py+0Po5wH2HsXzmw//lHiSJZmUAAAOw==") no-repeat 98% 50%;border:1px solid #c1c9d4}.yform-select-style select{width:100%;padding:6px 12px;background:transparent;background-image:none;border:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;-webkit-border-radius:0px}.yform-select-style select:focus{outline:none;background-color:transparent}.yform-select-style select:hover{cursor:pointer}.yform-table-help td{-ms-word-break:break-all;word-break:break-all}.form-captcha .input-group-addon{padding:0}.form-captcha .input-group-addon>img{height:100%;border-top-left-radius:4px;border-bottom-left-radius:4px} diff --git a/boot.php b/boot.php index 8411683b..18e2a8ef 100644 --- a/boot.php +++ b/boot.php @@ -12,6 +12,20 @@ rex_view::addCssFile($this->getAssetsUrl('yform.css')); rex_view::addCssFile($this->getAssetsUrl('yform-formbuilder.css')); + rex_extension::register('PACKAGES_INCLUDED', function() { + if ($this->getProperty('compile')) { + $compiler = new rex_scss_compiler(); + $compiler->setRootDir($this->getPath('scss/')); + $compiler->setScssFile($this->getPath('scss/yform.scss')); + $compiler->setCssFile($this->getPath('assets/yform.css')); + $compiler->compile(); + $compiler->setScssFile($this->getPath('scss/yform-formbuilder.scss')); + $compiler->setCssFile($this->getPath('assets/yform-formbuilder.css')); + $compiler->compile(); + rex_dir::copy($this->getPath('assets'), $this->getAssetsPath()); // copy whole assets directory + } + }); + rex_extension::register('PAGE_CHECKED', static function (rex_extension_point $ep) { $page = rex_be_controller::getPageObject('yform'); $subpages = $page->getSubpages(); diff --git a/package.yml b/package.yml index f28b785f..04e845ad 100644 --- a/package.yml +++ b/package.yml @@ -2,6 +2,7 @@ package: yform version: '4.0.0-beta4' author: 'Jan Kristinus, Gregor Harlan' supportpage: 'https://github.com/yakamara/redaxo_yform/issues' +compile: 0 page: title: 'translate:yform' diff --git a/plugins/manager/assets/manager.css b/plugins/manager/assets/manager.css index 1ad9f966..81a60bd1 100644 --- a/plugins/manager/assets/manager.css +++ b/plugins/manager/assets/manager.css @@ -1,253 +1 @@ - -#rex-yform .rex-widget-field { - padding-top: 0px; - margin-top: 0px; -} - -#rex-yform div.rex-widget { - clear:none; - float:left; - display:block; - margin:0px; - width:390px; - /*margin-left:245px;*/ - } -#rex-yform div.rex-widget input.text { - padding: 2px; - width: 290px; - } -#rex-yform div.rex-widget select{ - width:335px; - } -div#rex-title h1 span { - color:#CBCBCB; - font-size:0.5em; - } - -body#rex-page-yform .yform-manager-searchfield{ - background:silver; - color:white; - padding:3px; - border-radius:5px; - margin:1px; - display:inline-block; - -} - -.rex-yform textarea.yform-textarea-short{ - height:130px; -} - -.yform-table_field p.rex-button { - padding-left: 140px; -} -.yform-table_field p.rex-button a.rex-button { - float: left; - padding-top: 0; - padding-bottom: 0; - margin-left: -140px; -} -.yform-table_field p.rex-button span { - display: block; -} - -#yform-manager-search-form p.help-block { - font-size: 11px; -} - - -/* Piped *********************************************************************** -*******************************************************************************/ -.rex-navi-piped { - margin: 0; - padding-left: 0; - list-style: none; -} -.rex-navi-piped > * { - display: inline; - padding: 0 5px 0 6px; - font-weight: bold; -} -.rex-navi-piped > * { - background-image: url(../../../redaxo/media/pipe_c2.gif); - background-position: 0px 2px; -} -.rex-navi-piped > *:first-child { - background: none; -} - - - - - - -/* be-relation 1-n -*/ - -.yform-be-relation-wrapper { - margin: auto; - padding: 0 -} - -.yform-be-relation-wrapper > div { - border: 1px solid #bfe0d8; - background: #f1fcfa; - /*color: #1C94C4;*/ - margin: 0 0 10px 0; - padding: 20px 15px 15px 25px; - position: relative -} - -.yform-be-relation-wrapper span.sorthandle { - cursor: move; - position: absolute; - opacity: .5; - top: 5px; - bottom: 5px; - left: 4px; - width: 8px; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAB3RJTUUH3wIDBycZ/Cj09AAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAAWSURBVHjaY2DABhoaGupBGMRmYiAEAKo2BAFbROu9AAAAAElFTkSuQmCC) -} - -.yform-be-relation-wrapper span.sorthandle:hover { - opacity: .8 -} - -div.sortable-ghost { - border: 1px dashed #CCC; - opacity: .4 -} - -.yform-be-relation-wrapper span.removeadded { - position: absolute; - right: 15px; - top: 9px; -} - -.yform-be-relation-wrapper span.removeadded .btn { - cursor: pointer; -} - -.yform-be-relation-wrapper span.removeadded .btn[disabled] { - cursor: default; -} - -.yform-be-relation-wrapper span.removeadded .btn .rex-icon { - margin: 0 !important; -} - -.yform-be-relation-wrapper > div:after, .yform-be-relation-wrapper-wrapper > div:before { - content: ""; - display: table -} - -.yform-be-relation-wrapper > div:after { - clear: both -} - -.yform-be-relation-wrapper > div { - zoom: 1 -} - -.yform-be-relation-animate { - -webkit-transition: opacity 249ms linear, top 149ms ease; - -moz-transition: opacity 249ms linear, top 149ms ease; - transition: opacity 249ms linear, top 149ms ease; -} - -.panel.yform-be-relation-hidden-panel { - background: inherit; - border: inherit; - margin: inherit; -} - -.hide_sorthandle .sorthandle, -.hide_removeadded .removeadded { - display: none; -} - -.yform-be-relation-wrapper.hide_sorthandle > div { - padding-left: 15px; -} -.yform-be-relation-wrapper.hide_removeadded > div { - padding-top: 15px; -} - -.formbe_table th.rex-table-action { - padding: 4px 8px -} - -.formbe_table .add-mobile-btn, .formbe_table th.rex-table-action .btn { - border-radius: 0; - line-height: 26px -} - -.formbe_table .add-mobile-btn { - margin-bottom: 20px; - width: 100% -} - -.formbe_table table { - margin: 0 0 4px 0 -} - -.formbe_table tbody tr td { - padding-left: 8px; - padding-top: 30px -} - -.formbe_table tbody tr td:before { - line-height: 1; - width: 100% -} - -.formbe_table tbody tr td.delete-row { - padding-top: 8px -} - -@media screen and (min-width: 480px) { - .formbe_table tbody tr td { - padding-top: 8px; - padding-left: 40% - } - - .formbe_table tbody tr td:before { - line-height: 34px; - width: 35% - } -} - -@media screen and (min-width: 768px) { - .formbe_table tbody tr td { - padding-left: 8px - } -} - -.formbe_table .be-value-input .form-group { - margin: 0 -} - -.formbe_table .be-value-input label { - display: none -} - -.formbe_table .btn-delete { - border-radius: 0; - display: block; - line-height: 26px -} - -@media screen and (min-width: 768px) { - .formbe_table .add-mobile-btn { - display: none - } -} - -.yform-dropdown--on-hover:hover .dropdown-menu { - display: block; - margin-top: 0; -} - -.yform-dropdown .btn { - font-size: inherit; -} +#rex-yform .rex-widget-field{padding-top:0px;margin-top:0px}#rex-yform div.rex-widget{clear:none;float:left;display:block;margin:0px;width:390px}#rex-yform div.rex-widget input.text{padding:2px;width:290px}#rex-yform div.rex-widget select{width:335px}div#rex-title h1 span{color:#CBCBCB;font-size:0.5em}body#rex-page-yform .yform-manager-searchfield{background:silver;color:white;padding:3px;border-radius:5px;margin:1px;display:inline-block}.rex-yform textarea.yform-textarea-short{height:130px}.yform-table_field p.rex-button{padding-left:140px}.yform-table_field p.rex-button a.rex-button{float:left;padding-top:0;padding-bottom:0;margin-left:-140px}.yform-table_field p.rex-button span{display:block}#yform-manager-search-form p.help-block{font-size:11px}.rex-navi-piped{margin:0;padding-left:0;list-style:none}.rex-navi-piped>*{display:inline;padding:0 5px 0 6px;font-weight:bold}.rex-navi-piped>*{background-image:url(../../../redaxo/media/pipe_c2.gif);background-position:0px 2px}.rex-navi-piped>*:first-child{background:none}.yform-be-relation-wrapper{margin:auto;padding:0}.yform-be-relation-wrapper>div{border:1px solid #bfe0d8;background:#f1fcfa;margin:0 0 10px 0;padding:20px 15px 15px 25px;position:relative}.yform-be-relation-wrapper span.sorthandle{cursor:move;position:absolute;opacity:0.5;top:5px;bottom:5px;left:4px;width:8px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAB3RJTUUH3wIDBycZ/Cj09AAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAAWSURBVHjaY2DABhoaGupBGMRmYiAEAKo2BAFbROu9AAAAAElFTkSuQmCC)\a }.yform-be-relation-wrapper span.sorthandle:hover{opacity:0.8}div.sortable-ghost{border:1px dashed #CCC;opacity:0.4}.yform-be-relation-wrapper span.removeadded{position:absolute;right:15px;top:9px}.yform-be-relation-wrapper span.removeadded .btn{cursor:pointer}.yform-be-relation-wrapper span.removeadded .btn[disabled]{cursor:default}.yform-be-relation-wrapper span.removeadded .btn .rex-icon{margin:0 !important}.yform-be-relation-wrapper>div:after,.yform-be-relation-wrapper-wrapper>div:before{content:"";display:table}.yform-be-relation-wrapper>div:after{clear:both}.yform-be-relation-wrapper>div{zoom:1}.yform-be-relation-animate{-webkit-transition:opacity 249ms linear, top 149ms ease;-moz-transition:opacity 249ms linear, top 149ms ease;transition:opacity 249ms linear, top 149ms ease}.panel.yform-be-relation-hidden-panel{background:inherit;border:inherit;margin:inherit}.hide_sorthandle .sorthandle,.hide_removeadded .removeadded{display:none}.yform-be-relation-wrapper.hide_sorthandle>div{padding-left:15px}.yform-be-relation-wrapper.hide_removeadded>div{padding-top:15px}.formbe_table th.rex-table-action{padding:4px 8px}.formbe_table .add-mobile-btn,.formbe_table th.rex-table-action .btn{border-radius:0;line-height:26px}.formbe_table .add-mobile-btn{margin-bottom:20px;width:100%}.formbe_table table{margin:0 0 4px 0}.formbe_table tbody tr td{padding-left:8px;padding-top:30px}.formbe_table tbody tr td:before{line-height:1;width:100%}.formbe_table tbody tr td.delete-row{padding-top:8px}@media screen and (min-width:480px){.formbe_table tbody tr td{padding-top:8px;padding-left:40%}.formbe_table tbody tr td:before{line-height:34px;width:35%}}@media screen and (min-width:768px){.formbe_table tbody tr td{padding-left:8px}}.formbe_table .be-value-input .form-group{margin:0}.formbe_table .be-value-input label{display:none}.formbe_table .btn-delete{border-radius:0;display:block;line-height:26px}@media screen and (min-width:768px){.formbe_table .add-mobile-btn{display:none}}.yform-dropdown--on-hover:hover .dropdown-menu{display:block;margin-top:0}.yform-dropdown .btn{font-size:inherit}.yform-manager-type-validate{color:#aaa}.yform-manager-type-action{background-color:#cfd9d9}.yform-manager-type-default{background-color:#eff9f9}body.rex-theme-dark .yform-manager-type-validate{color:rgba(255, 255, 255, 0.45)}body.rex-theme-dark .yform-manager-type-action{background-color:#1b232c}body.rex-theme-dark .yform-manager-type-default{background-color:#1a3332}@media (prefers-color-scheme:dark){body.rex-has-theme:not(.rex-theme-light) .yform-manager-type-validate{color:rgba(255, 255, 255, 0.45)}body.rex-has-theme:not(.rex-theme-light) .yform-manager-type-action{background-color:#1b232c}body.rex-has-theme:not(.rex-theme-light) .yform-manager-type-default{background-color:#1a3332}} diff --git a/plugins/manager/boot.php b/plugins/manager/boot.php index f2a836b7..ee12470e 100644 --- a/plugins/manager/boot.php +++ b/plugins/manager/boot.php @@ -14,6 +14,17 @@ rex_complex_perm::register('yform_manager_table_view', 'rex_yform_manager_table_perm_view'); if (rex::isBackend() && rex::getUser()) { + rex_extension::register('PACKAGES_INCLUDED', function() { + if ($this->getProperty('compile')) { + $compiler = new rex_scss_compiler(); + $compiler->setRootDir($this->getPath('scss/')); + $compiler->setScssFile($this->getPath('scss/manager.scss')); + $compiler->setCssFile($this->getPath('assets/manager.css')); + $compiler->compile(); + rex_dir::copy($this->getPath('assets'), $this->getAssetsPath()); // copy whole assets directory + } + }); + rex_view::addJsFile($this->getAssetsUrl('manager.js')); rex_view::addCssFile($this->getAssetsUrl('manager.css')); rex_view::addJsFile($this->getAssetsUrl('widget.js')); diff --git a/plugins/manager/lib/yform/manager.php b/plugins/manager/lib/yform/manager.php index 937cd01b..29266979 100644 --- a/plugins/manager/lib/yform/manager.php +++ b/plugins/manager/lib/yform/manager.php @@ -1300,13 +1300,13 @@ function rex_yform_list_format($p, $value = '') } switch ($p['list']->getValue('type_id')) { case 'validate': - $style = 'color:#aaa;'; // background-color:#cfd9d9; + $styleClass = 'yform-manager-type-validate'; break; case 'action': - $style = 'background-color:#cfd9d9;'; + $styleClass = 'yform-manager-type-action'; break; default: - $style = 'background-color:#eff9f9;'; + $styleClass = 'yform-manager-type-default'; break; } @@ -1314,7 +1314,7 @@ function rex_yform_list_format($p, $value = '') $p['value'] = rex_i18n::translate($p['value']); } - return '