Skip to content

Commit

Permalink
Merge branch 'develop' into 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Mar 12, 2024
2 parents d007caf + 042d351 commit aaa69b1
Show file tree
Hide file tree
Showing 35 changed files with 421 additions and 565 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
"dms/phpunit-arraysubset-asserts": "^0.1.0|^0.2.1"
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
Expand Down
4 changes: 4 additions & 0 deletions config/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@
| insecure - detect hostname and force HTTP schema
| force - force hostname and schema using app.url config value
|
| NOTE: force will ensure that the app.url value is used as the host for
| urls generated through the URL helpers which might have unintended
| consequences for projects that support multiple hostnames.
|
*/

'linkPolicy' => env('LINK_POLICY', 'detect'),
Expand Down
223 changes: 4 additions & 219 deletions modules/backend/assets/js/vendor/jquery-and-migrate.min.js

Large diffs are not rendered by default.

217 changes: 2 additions & 215 deletions modules/backend/assets/js/vendor/jquery-migrate.min.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions modules/backend/assets/js/vendor/jquery.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
this.initSortingSimple = function () {
var sortOrders = []

$('#reorderTreeList li').each(function(){
sortOrders.push($(this).data('recordSortOrder'))
$('#reorderTreeList li').each(function(i) {
sortOrders.push(i);
})

this.simpleSortOrders = sortOrders
Expand All @@ -79,4 +79,4 @@
}

$.wn.reorderBehavior = new ReorderBehavior;
}(window.jQuery);
}(window.jQuery);
12 changes: 9 additions & 3 deletions modules/backend/classes/FormField.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php namespace Backend\Classes;
<?php

use Str;
namespace Backend\Classes;

use BackedEnum;
use Html;
use Winter\Storm\Database\Model;
use Winter\Storm\Html\Helper as HtmlHelper;
use Winter\Storm\Support\Str;

/**
* Form Field definition
Expand Down Expand Up @@ -370,7 +373,10 @@ public function isSelected($value = true)
return false;
}

return (string) $value === (string) $this->value;
$value = ($value instanceof BackedEnum) ? $value->value : $value;
$currentValue = ($this->value instanceof BackedEnum) ? $this->value->value : $this->value;

return (string) $value === (string) $currentValue;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/console/scaffold/controller/update.stub
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('{{lower_author}}/{{lower_plugin}}/{{lower_name}}') ?>">{{title_name}}</a></li>
<li><a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('{{ model_lang_key }}.label_plural')); ?></a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.permissioneditor table{width:100%}
.permissioneditor table th{padding:30px 4px 8px 4px;color:#2a3e51;font-weight:normal;border-bottom:1px solid #dbe1e3}
.permissioneditor table th.tab{font-size:13px}
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center}
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center;cursor:pointer}
.permissioneditor table td{padding:10px 4px;vertical-align:top;border-bottom:1px solid #ecf0f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
.permissioneditor table td.permission-value{text-align:center}
.permissioneditor table td.permission-name{font-size:13px;cursor:pointer;color:#777}
Expand Down Expand Up @@ -37,4 +37,4 @@
.permissioneditor table tr:last-child td{border-bottom:none}
.permissioneditor table tr:first-child th{padding-top:0}
.permissioneditor table tr.disabled td.permission-name{color:#AAA}
.permissioneditor table tr.last-section-row td{border-bottom:none}
.permissioneditor table tr.last-section-row td{border-bottom:none}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
PermissionEditor.prototype.constructor = PermissionEditor

PermissionEditor.prototype.init = function() {
$(document).on('click', '.permissioneditor table th.permission-type', this.proxy(this.onPermissionTypeClick))
$(document).on('click', '.permissioneditor table td.permission-name', this.proxy(this.onPermissionNameClick))
$(document).on('click', '.permissioneditor table tr.mode-checkbox input[type=checkbox]', this.proxy(this.onPermissionCheckboxClick))
$(document).on('click', '.permissioneditor table tr.mode-radio input[type=radio]', this.proxy(this.onPermissionRadioClick))
Expand All @@ -21,6 +22,37 @@
// EVENT HANDLERS
// ============================

PermissionEditor.prototype.onPermissionTypeClick = function (ev) {
var $rows = $(ev.target).closest('tr').nextAll()
var index = $(ev.target).index()

var allChecked = true

for (let i = 0; i < $rows.length; i++) {
var $row = $rows.eq(i)
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)

if ($check.length > 0) {
if (!$check[0].checked) {
allChecked = false
break
}
}
}

for (let i = 0; i < $rows.length; i++) {
var $row = $rows.eq(i)
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)
if ($check.length > 0) {
if ($check.is('input[type=checkbox]')) {
$check.prop('checked', !allChecked)
} else {
$check.prop('checked', true)
}
}
}
};

PermissionEditor.prototype.onPermissionNameClick = function(ev) {
var $row = $(ev.target).closest('tr'),
$checkbox = $row.find('input[type=checkbox]')
Expand Down Expand Up @@ -70,4 +102,4 @@
new PermissionEditor()
})

}(window.jQuery);
}(window.jQuery);
4 changes: 3 additions & 1 deletion modules/backend/formwidgets/repeater/assets/js/repeater.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@
$target = $item
}

var $textInput = $('input[type=text]:first, select:first', $target).first()
var $textInput = $('input[type=text]:first, select:first, ul:first', $target).first()
if ($textInput.length) {
switch($textInput.prop("tagName")) {
case 'SELECT':
return $textInput.find('option:selected').text()
case 'UL':
return $textInput.find('li.active').text()
default:
return $textInput.val()
}
Expand Down
4 changes: 3 additions & 1 deletion modules/backend/widgets/form/assets/js/winter.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@
data: refreshData
}).success(function() {
self.toggleEmptyTabs()
$('[data-field-name="' + toRefresh.fields[0] + '"]').trigger('change')
$.each(toRefresh.fields, function(key, field) {
$('[data-field-name="' + field + '"]').trigger('change')
})
})
}, this.dependantUpdateInterval)

Expand Down
3 changes: 2 additions & 1 deletion modules/backend/widgets/form/partials/_field_dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$fieldOptions = $field->options();
$useSearch = $field->getConfig('showSearch', true);
$emptyOption = $field->getConfig('emptyOption', $field->placeholder);
$allowCustom = $field->getConfig('allowCustom', false);
?>

<!-- Dropdown -->
Expand All @@ -14,7 +15,7 @@
<select
id="<?= $field->getId() ?>"
name="<?= $field->getName() ?>"
class="form-control custom-select <?= $useSearch ? '' : 'select-no-search' ?>"
class="form-control custom-select <?= $useSearch ? '' : 'select-no-search' ?> <?= $allowCustom ? 'select-modifiable' : '' ?>"
<?= $field->getAttributes() ?>
<?= $field->placeholder ? 'data-placeholder="'.e(trans($field->placeholder)).'"' : '' ?>
>
Expand Down
46 changes: 24 additions & 22 deletions modules/backend/widgets/form/partials/_field_switch.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,30 @@
?>

<!-- Switch -->
<div class="field-switch">
<label for="<?= $field->getId() ?>"><?= e(trans($field->label)) ?></label>
<?php if ($field->comment): ?>
<p class="help-block"><?= $field->commentHtml ? trans($field->comment) : e(trans($field->comment)) ?></p>
<?php endif ?>
</div>

<input
type="hidden"
name="<?= $field->getName() ?>"
value="0"
<?= $previewMode ? 'disabled="disabled"' : '' ?>>
<div class="<?= $previewMode ? 'disabled' : '' ?>">
<div class="field-switch">
<label for="<?= $field->getId() ?>"><?= e(trans($field->label)) ?></label>
<?php if ($field->comment): ?>
<p class="help-block"><?= $field->commentHtml ? trans($field->comment) : e(trans($field->comment)) ?></p>
<?php endif ?>
</div>

<label class="custom-switch" <?= $previewMode ? 'onclick="return false"' : '' ?>>
<input
type="checkbox"
id="<?= $field->getId() ?>"
type="hidden"
name="<?= $field->getName() ?>"
value="1"
<?= $previewMode ? 'readonly="readonly"' : '' ?>
<?= $field->value == 1 ? 'checked="checked"' : '' ?>
<?= $field->getAttributes() ?>>
<span><span><?= e(trans($on)) ?></span><span><?= e(trans($off)) ?></span></span>
<a class="slide-button"></a>
</label>
value="0"
<?= $previewMode ? 'disabled="disabled"' : '' ?>>

<label class="custom-switch" <?= $previewMode ? 'onclick="return false"' : '' ?>>
<input
type="checkbox"
id="<?= $field->getId() ?>"
name="<?= $field->getName() ?>"
value="1"
<?= $previewMode ? 'readonly="readonly"' : '' ?>
<?= $field->value == 1 ? 'checked="checked"' : '' ?>
<?= $field->getAttributes() ?>>
<span><span><?= e(trans($on)) ?></span><span><?= e(trans($off)) ?></span></span>
<a class="slide-button"></a>
</label>
</div>
44 changes: 42 additions & 2 deletions modules/backend/widgets/mediamanager/assets/css/mediamanager.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@ div[data-control="media-manager"]:focus{outline:none}
div[data-control="media-manager"] audio,
div[data-control="media-manager"] video{width:100%}
div[data-control="media-manager"] video{background:#ecf0f1;max-height:225px}
div[data-control="media-manager"] .file-icon{fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;display:inline-block}
div[data-control="media-manager"] .file-icon-extension{font-family:'ArialMT','Arial',sans-serif;font-size:4em;font-weight:900;fill:#fff}
div[data-control="media-manager"] .file-icon-label{fill:#576D7E;fill-rule:nonzero}
div[data-control="media-manager"] .file-icon-css,
div[data-control="media-manager"] .file-icon-less,
div[data-control="media-manager"] .file-icon-scss{fill:#B73FD9}
div[data-control="media-manager"] .file-icon-html,
div[data-control="media-manager"] .file-icon-xml{fill:#EA9B47}
div[data-control="media-manager"] .file-icon-js,
div[data-control="media-manager"] .file-icon-json{fill:#A9A9A9}
div[data-control="media-manager"] .file-icon-pdf{fill:#E30713}
div[data-control="media-manager"] .file-icon-txt{fill:#248BD0}
div[data-control="media-manager"] .file-icon-ai{fill:#F29200}
div[data-control="media-manager"] .file-icon-eps{fill:#F9B234}
div[data-control="media-manager"] .file-icon-psd{fill:#2DAAE2}
div[data-control="media-manager"] .file-icon-ttf,
div[data-control="media-manager"] .file-icon-otf,
div[data-control="media-manager"] .file-icon-woff,
div[data-control="media-manager"] .file-icon-woff2{fill:#C4CA10}
div[data-control="media-manager"] .file-icon-doc,
div[data-control="media-manager"] .file-icon-docx,
div[data-control="media-manager"] .file-icon-rtf,
div[data-control="media-manager"] .file-icon-odt{fill:#0F70B7}
div[data-control="media-manager"] .file-icon-csv,
div[data-control="media-manager"] .file-icon-ods,
div[data-control="media-manager"] .file-icon-xls,
div[data-control="media-manager"] .file-icon-xlsx{fill:#3BAA34}
div[data-control="media-manager"] .file-icon-odp,
div[data-control="media-manager"] .file-icon-ppt,
div[data-control="media-manager"] .file-icon-pptx{fill:#D04526}
div[data-control="media-manager"] .file-icon-rar,
div[data-control="media-manager"] .file-icon-tar,
div[data-control="media-manager"] .file-icon-zip{fill:#363A56}
div[data-control="media-manager"] .media-player-fallback{font-size:13px;color:#95a5a6;background:#ecf0f1;line-height:180%}
div[data-control="media-manager"] .media-player-fallback.panel-embedded{padding:20px;margin:-20px -20px 0 -20px}
div[data-control="media-manager"] .empty-library{padding:20px;text-align:center}
Expand All @@ -27,6 +60,7 @@ div[data-control="media-manager"] .media-list.list li{height:75px;width:260px;bo
div[data-control="media-manager"] .media-list.list li .icon-container{border-right:1px solid #f6f8f9;width:75px;height:75px;float:left}
div[data-control="media-manager"] .media-list.list li .icon-container img{max-height:75px}
div[data-control="media-manager"] .media-list.list li .icon-container i{font-size:35px}
div[data-control="media-manager"] .media-list.list li .icon-container svg{max-height:44px}
div[data-control="media-manager"] .media-list.list li .icon-container.image{border-right:1px solid #ecf0f1!important}
div[data-control="media-manager"] .media-list.list li .icon-container p.thumbnail-error-message{display:none}
div[data-control="media-manager"] .media-list.list .icon-wrapper{width:75px}
Expand All @@ -47,6 +81,7 @@ div[data-control="media-manager"] .media-list.tiles li .image-placeholder[data-l
div[data-control="media-manager"] .media-list.tiles li .icon-container{width:165px;height:165px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;border:1px solid #ecf0f1;overflow:hidden;background:#f6f8f9;box-sizing:content-box}
div[data-control="media-manager"] .media-list.tiles li .icon-container img{max-height:165px}
div[data-control="media-manager"] .media-list.tiles li .icon-container i{font-size:55px}
div[data-control="media-manager"] .media-list.tiles li .icon-container svg{max-height:65px}
div[data-control="media-manager"] .media-list.tiles li .icon-container p{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}
div[data-control="media-manager"] .media-list.tiles li.selected .icon-container{background:#4ea5e0 !important;border-color:#2581b8}
div[data-control="media-manager"] .media-list.tiles li.selected .icon-container i,
Expand All @@ -56,8 +91,11 @@ div[data-control="media-manager"] .media-list.tiles i.icon-chain-broken{margin-t
div[data-control="media-manager"] .media-list.tiles p.size{margin-bottom:0}
div[data-control="media-manager"] [data-control="sidebar-labels"]{word-wrap:break-word}
div[data-control="media-manager"] .sidebar-group{margin-bottom:20px}
div[data-control="media-manager"] .sidebar-image-placeholder-container{display:table;width:100%}
div[data-control="media-manager"] .sidebar-image-placeholder{display:table-cell;height:225px;position:relative;vertical-align:middle;text-align:center;border-bottom:1px solid #ecf0f1;box-sizing:content-box}
div[data-control="media-manager"] .sidebar-image-placeholder-container,
div[data-control="media-manager"] .sidebar-document-placeholder-container{display:table;width:100%}
div[data-control="media-manager"] .sidebar-image-placeholder,
div[data-control="media-manager"] .sidebar-document-placeholder{display:table-cell;position:relative;vertical-align:middle;text-align:center;border-bottom:1px solid #ecf0f1;box-sizing:content-box}
div[data-control="media-manager"] .sidebar-image-placeholder{height:225px}
div[data-control="media-manager"] .sidebar-image-placeholder[data-loading]{background:#ecf0f1}
div[data-control="media-manager"] .sidebar-image-placeholder[data-loading]:after{background-image:url('../../../../../../modules/system/assets/ui/images/loader-transparent.svg');background-position:50% 50%;content:' ';-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;background-size:62px 62px;position:absolute;width:62px;height:62px;top:50%;left:50%;margin-top:-31px;margin-left:-31px}
div[data-control="media-manager"] .sidebar-image-placeholder i.icon-chain-broken,
Expand All @@ -67,6 +105,8 @@ div[data-control="media-manager"] .sidebar-image-placeholder i.icon-level-up{col
div[data-control="media-manager"] .sidebar-image-placeholder.no-border{border-bottom:none}
div[data-control="media-manager"] .sidebar-image-placeholder p{font-size:12px;margin:10px;line-height:160%;color:#bdc3c7;margin-top:25px}
div[data-control="media-manager"] .sidebar-image-placeholder img{max-width:100%;max-height:225px}
div[data-control="media-manager"] .sidebar-document-placeholder{height:155px}
div[data-control="media-manager"] .sidebar-document-placeholder svg{width:100px;height:100px}
div[data-control="media-manager"] .list-container{position:relative;z-index:100}
div[data-control="media-manager"] .list-container .no-data{font-size:13px}
div[data-control="media-manager"] .list-container p.no-data{padding:0 20px 20px 20px}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ for(var i=0,len=previewContainer.children.length;i<len;i++){previewContainer.rem
switch(documentType){case'audio':template=previewPanel.querySelector('[data-control="audio-template"]').innerHTML
break;case'video':template=previewPanel.querySelector('[data-control="video-template"]').innerHTML
break;case'image':template=previewPanel.querySelector('[data-control="image-template"]').innerHTML
break;case'document':template=previewPanel.querySelector('[data-control="document-template"]').innerHTML
break;}previewContainer.innerHTML=template.replace('{src}',item.getAttribute('data-public-url')).replace('{path}',item.getAttribute('data-path')).replace('{last-modified}',item.getAttribute('data-last-modified-ts'))
if(documentType=='document')this.loadSidebarDocumentIcon(item)
if(documentType=='image')this.loadSidebarThumbnail()}else if(items.length==1&&items[0].hasAttribute('data-root')){template=previewPanel.querySelector('[data-control="go-up"]').innerHTML
previewContainer.innerHTML=template}else if(items.length==0){template=previewPanel.querySelector('[data-control="no-selection-template"]').innerHTML
previewContainer.innerHTML=template}else{template=previewPanel.querySelector('[data-control="multi-selection-template"]').innerHTML
Expand All @@ -164,6 +166,8 @@ if(this.isSearchMode()){previewPanel.querySelector('[data-control="item-folder"]
var folderNode=previewPanel.querySelector('[data-label="folder"]')
folderNode.textContent=item.getAttribute('data-folder')
folderNode.setAttribute('data-path',item.getAttribute('data-folder'))}else{previewPanel.querySelector('[data-control="item-folder"]').setAttribute('class','hide')}}else{this.sidebarPreviewElement.querySelector('[data-control="sidebar-labels"]').setAttribute('class','hide')}this.updateSidebarMediaPreview(items)}
MediaManager.prototype.loadSidebarDocumentIcon=function(item){var sidebarDocument=this.sidebarPreviewElement.querySelector('[data-control="sidebar-document"]'),svg=item.querySelector('svg')
sidebarDocument.innerHTML=svg.outerHTML}
MediaManager.prototype.loadSidebarThumbnail=function(){if(this.sidebarThumbnailAjax){try{this.sidebarThumbnailAjax.abort()}catch(e){}this.sidebarThumbnailAjax=null}var sidebarThumbnail=this.sidebarPreviewElement.querySelector('[data-control="sidebar-thumbnail"]')
if(!sidebarThumbnail)return
var data={path:sidebarThumbnail.getAttribute('data-path'),lastModified:sidebarThumbnail.getAttribute('data-last-modified')}
Expand Down Expand Up @@ -536,4 +540,4 @@ case'undo-resizing':this.undoResizing()
break}}
MediaManagerImageCropPopup.prototype.onSelectionChanged=function(c){this.updateSelectionSizeLabel(c.w,c.h)}
MediaManagerImageCropPopup.DEFAULTS={alias:undefined,onDone:undefined}
$.wn.mediaManager.imageCropPopup=MediaManagerImageCropPopup}(window.jQuery);
$.wn.mediaManager.imageCropPopup=MediaManagerImageCropPopup}(window.jQuery);
Loading

0 comments on commit aaa69b1

Please sign in to comment.