Skip to content

Commit aaa69b1

Browse files
committed
Merge branch 'develop' into 1.2
2 parents d007caf + 042d351 commit aaa69b1

35 files changed

+421
-565
lines changed

composer.json

-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
"dms/phpunit-arraysubset-asserts": "^0.1.0|^0.2.1"
4747
},
4848
"scripts": {
49-
"post-root-package-install": [
50-
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
51-
],
5249
"post-create-project-cmd": [
5350
"@php artisan key:generate"
5451
],

config/cms.php

+4
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@
358358
| insecure - detect hostname and force HTTP schema
359359
| force - force hostname and schema using app.url config value
360360
|
361+
| NOTE: force will ensure that the app.url value is used as the host for
362+
| urls generated through the URL helpers which might have unintended
363+
| consequences for projects that support multiple hostnames.
364+
|
361365
*/
362366

363367
'linkPolicy' => env('LINK_POLICY', 'detect'),

modules/backend/assets/js/vendor/jquery-and-migrate.min.js

+4-219
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/backend/assets/js/vendor/jquery-migrate.min.js

+2-215
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/backend/assets/js/vendor/jquery.min.js

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/backend/behaviors/reordercontroller/assets/js/winter.reorder.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
this.initSortingSimple = function () {
7070
var sortOrders = []
7171

72-
$('#reorderTreeList li').each(function(){
73-
sortOrders.push($(this).data('recordSortOrder'))
72+
$('#reorderTreeList li').each(function(i) {
73+
sortOrders.push(i);
7474
})
7575

7676
this.simpleSortOrders = sortOrders
@@ -79,4 +79,4 @@
7979
}
8080

8181
$.wn.reorderBehavior = new ReorderBehavior;
82-
}(window.jQuery);
82+
}(window.jQuery);

modules/backend/classes/FormField.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php namespace Backend\Classes;
1+
<?php
22

3-
use Str;
3+
namespace Backend\Classes;
4+
5+
use BackedEnum;
46
use Html;
57
use Winter\Storm\Database\Model;
68
use Winter\Storm\Html\Helper as HtmlHelper;
9+
use Winter\Storm\Support\Str;
710

811
/**
912
* Form Field definition
@@ -370,7 +373,10 @@ public function isSelected($value = true)
370373
return false;
371374
}
372375

373-
return (string) $value === (string) $this->value;
376+
$value = ($value instanceof BackedEnum) ? $value->value : $value;
377+
$currentValue = ($this->value instanceof BackedEnum) ? $this->value->value : $this->value;
378+
379+
return (string) $value === (string) $currentValue;
374380
}
375381

376382
/**

modules/backend/console/scaffold/controller/update.stub

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php Block::put('breadcrumb') ?>
22
<ul>
3-
<li><a href="<?= Backend::url('{{lower_author}}/{{lower_plugin}}/{{lower_name}}') ?>">{{title_name}}</a></li>
3+
<li><a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('{{ model_lang_key }}.label_plural')); ?></a></li>
44
<li><?= e($this->pageTitle) ?></li>
55
</ul>
66
<?php Block::endPut() ?>

modules/backend/formwidgets/permissioneditor/assets/css/permissioneditor.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.permissioneditor table{width:100%}
55
.permissioneditor table th{padding:30px 4px 8px 4px;color:#2a3e51;font-weight:normal;border-bottom:1px solid #dbe1e3}
66
.permissioneditor table th.tab{font-size:13px}
7-
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center}
7+
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center;cursor:pointer}
88
.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}
99
.permissioneditor table td.permission-value{text-align:center}
1010
.permissioneditor table td.permission-name{font-size:13px;cursor:pointer;color:#777}
@@ -37,4 +37,4 @@
3737
.permissioneditor table tr:last-child td{border-bottom:none}
3838
.permissioneditor table tr:first-child th{padding-top:0}
3939
.permissioneditor table tr.disabled td.permission-name{color:#AAA}
40-
.permissioneditor table tr.last-section-row td{border-bottom:none}
40+
.permissioneditor table tr.last-section-row td{border-bottom:none}

modules/backend/formwidgets/permissioneditor/assets/js/permissioneditor.js

+33-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
PermissionEditor.prototype.constructor = PermissionEditor
1414

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

25+
PermissionEditor.prototype.onPermissionTypeClick = function (ev) {
26+
var $rows = $(ev.target).closest('tr').nextAll()
27+
var index = $(ev.target).index()
28+
29+
var allChecked = true
30+
31+
for (let i = 0; i < $rows.length; i++) {
32+
var $row = $rows.eq(i)
33+
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)
34+
35+
if ($check.length > 0) {
36+
if (!$check[0].checked) {
37+
allChecked = false
38+
break
39+
}
40+
}
41+
}
42+
43+
for (let i = 0; i < $rows.length; i++) {
44+
var $row = $rows.eq(i)
45+
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)
46+
if ($check.length > 0) {
47+
if ($check.is('input[type=checkbox]')) {
48+
$check.prop('checked', !allChecked)
49+
} else {
50+
$check.prop('checked', true)
51+
}
52+
}
53+
}
54+
};
55+
2456
PermissionEditor.prototype.onPermissionNameClick = function(ev) {
2557
var $row = $(ev.target).closest('tr'),
2658
$checkbox = $row.find('input[type=checkbox]')
@@ -70,4 +102,4 @@
70102
new PermissionEditor()
71103
})
72104

73-
}(window.jQuery);
105+
}(window.jQuery);

modules/backend/formwidgets/repeater/assets/js/repeater.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,13 @@
248248
$target = $item
249249
}
250250

251-
var $textInput = $('input[type=text]:first, select:first', $target).first()
251+
var $textInput = $('input[type=text]:first, select:first, ul:first', $target).first()
252252
if ($textInput.length) {
253253
switch($textInput.prop("tagName")) {
254254
case 'SELECT':
255255
return $textInput.find('option:selected').text()
256+
case 'UL':
257+
return $textInput.find('li.active').text()
256258
default:
257259
return $textInput.val()
258260
}

modules/backend/widgets/form/assets/js/winter.form.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@
186186
data: refreshData
187187
}).success(function() {
188188
self.toggleEmptyTabs()
189-
$('[data-field-name="' + toRefresh.fields[0] + '"]').trigger('change')
189+
$.each(toRefresh.fields, function(key, field) {
190+
$('[data-field-name="' + field + '"]').trigger('change')
191+
})
190192
})
191193
}, this.dependantUpdateInterval)
192194

modules/backend/widgets/form/partials/_field_dropdown.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$fieldOptions = $field->options();
33
$useSearch = $field->getConfig('showSearch', true);
44
$emptyOption = $field->getConfig('emptyOption', $field->placeholder);
5+
$allowCustom = $field->getConfig('allowCustom', false);
56
?>
67

78
<!-- Dropdown -->
@@ -14,7 +15,7 @@
1415
<select
1516
id="<?= $field->getId() ?>"
1617
name="<?= $field->getName() ?>"
17-
class="form-control custom-select <?= $useSearch ? '' : 'select-no-search' ?>"
18+
class="form-control custom-select <?= $useSearch ? '' : 'select-no-search' ?> <?= $allowCustom ? 'select-modifiable' : '' ?>"
1819
<?= $field->getAttributes() ?>
1920
<?= $field->placeholder ? 'data-placeholder="'.e(trans($field->placeholder)).'"' : '' ?>
2021
>

modules/backend/widgets/form/partials/_field_switch.php

+24-22
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,30 @@
99
?>
1010

1111
<!-- Switch -->
12-
<div class="field-switch">
13-
<label for="<?= $field->getId() ?>"><?= e(trans($field->label)) ?></label>
14-
<?php if ($field->comment): ?>
15-
<p class="help-block"><?= $field->commentHtml ? trans($field->comment) : e(trans($field->comment)) ?></p>
16-
<?php endif ?>
17-
</div>
18-
19-
<input
20-
type="hidden"
21-
name="<?= $field->getName() ?>"
22-
value="0"
23-
<?= $previewMode ? 'disabled="disabled"' : '' ?>>
12+
<div class="<?= $previewMode ? 'disabled' : '' ?>">
13+
<div class="field-switch">
14+
<label for="<?= $field->getId() ?>"><?= e(trans($field->label)) ?></label>
15+
<?php if ($field->comment): ?>
16+
<p class="help-block"><?= $field->commentHtml ? trans($field->comment) : e(trans($field->comment)) ?></p>
17+
<?php endif ?>
18+
</div>
2419

25-
<label class="custom-switch" <?= $previewMode ? 'onclick="return false"' : '' ?>>
2620
<input
27-
type="checkbox"
28-
id="<?= $field->getId() ?>"
21+
type="hidden"
2922
name="<?= $field->getName() ?>"
30-
value="1"
31-
<?= $previewMode ? 'readonly="readonly"' : '' ?>
32-
<?= $field->value == 1 ? 'checked="checked"' : '' ?>
33-
<?= $field->getAttributes() ?>>
34-
<span><span><?= e(trans($on)) ?></span><span><?= e(trans($off)) ?></span></span>
35-
<a class="slide-button"></a>
36-
</label>
23+
value="0"
24+
<?= $previewMode ? 'disabled="disabled"' : '' ?>>
25+
26+
<label class="custom-switch" <?= $previewMode ? 'onclick="return false"' : '' ?>>
27+
<input
28+
type="checkbox"
29+
id="<?= $field->getId() ?>"
30+
name="<?= $field->getName() ?>"
31+
value="1"
32+
<?= $previewMode ? 'readonly="readonly"' : '' ?>
33+
<?= $field->value == 1 ? 'checked="checked"' : '' ?>
34+
<?= $field->getAttributes() ?>>
35+
<span><span><?= e(trans($on)) ?></span><span><?= e(trans($off)) ?></span></span>
36+
<a class="slide-button"></a>
37+
</label>
38+
</div>

modules/backend/widgets/mediamanager/assets/css/mediamanager.css

+42-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@ div[data-control="media-manager"]:focus{outline:none}
22
div[data-control="media-manager"] audio,
33
div[data-control="media-manager"] video{width:100%}
44
div[data-control="media-manager"] video{background:#ecf0f1;max-height:225px}
5+
div[data-control="media-manager"] .file-icon{fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;display:inline-block}
6+
div[data-control="media-manager"] .file-icon-extension{font-family:'ArialMT','Arial',sans-serif;font-size:4em;font-weight:900;fill:#fff}
7+
div[data-control="media-manager"] .file-icon-label{fill:#576D7E;fill-rule:nonzero}
8+
div[data-control="media-manager"] .file-icon-css,
9+
div[data-control="media-manager"] .file-icon-less,
10+
div[data-control="media-manager"] .file-icon-scss{fill:#B73FD9}
11+
div[data-control="media-manager"] .file-icon-html,
12+
div[data-control="media-manager"] .file-icon-xml{fill:#EA9B47}
13+
div[data-control="media-manager"] .file-icon-js,
14+
div[data-control="media-manager"] .file-icon-json{fill:#A9A9A9}
15+
div[data-control="media-manager"] .file-icon-pdf{fill:#E30713}
16+
div[data-control="media-manager"] .file-icon-txt{fill:#248BD0}
17+
div[data-control="media-manager"] .file-icon-ai{fill:#F29200}
18+
div[data-control="media-manager"] .file-icon-eps{fill:#F9B234}
19+
div[data-control="media-manager"] .file-icon-psd{fill:#2DAAE2}
20+
div[data-control="media-manager"] .file-icon-ttf,
21+
div[data-control="media-manager"] .file-icon-otf,
22+
div[data-control="media-manager"] .file-icon-woff,
23+
div[data-control="media-manager"] .file-icon-woff2{fill:#C4CA10}
24+
div[data-control="media-manager"] .file-icon-doc,
25+
div[data-control="media-manager"] .file-icon-docx,
26+
div[data-control="media-manager"] .file-icon-rtf,
27+
div[data-control="media-manager"] .file-icon-odt{fill:#0F70B7}
28+
div[data-control="media-manager"] .file-icon-csv,
29+
div[data-control="media-manager"] .file-icon-ods,
30+
div[data-control="media-manager"] .file-icon-xls,
31+
div[data-control="media-manager"] .file-icon-xlsx{fill:#3BAA34}
32+
div[data-control="media-manager"] .file-icon-odp,
33+
div[data-control="media-manager"] .file-icon-ppt,
34+
div[data-control="media-manager"] .file-icon-pptx{fill:#D04526}
35+
div[data-control="media-manager"] .file-icon-rar,
36+
div[data-control="media-manager"] .file-icon-tar,
37+
div[data-control="media-manager"] .file-icon-zip{fill:#363A56}
538
div[data-control="media-manager"] .media-player-fallback{font-size:13px;color:#95a5a6;background:#ecf0f1;line-height:180%}
639
div[data-control="media-manager"] .media-player-fallback.panel-embedded{padding:20px;margin:-20px -20px 0 -20px}
740
div[data-control="media-manager"] .empty-library{padding:20px;text-align:center}
@@ -27,6 +60,7 @@ div[data-control="media-manager"] .media-list.list li{height:75px;width:260px;bo
2760
div[data-control="media-manager"] .media-list.list li .icon-container{border-right:1px solid #f6f8f9;width:75px;height:75px;float:left}
2861
div[data-control="media-manager"] .media-list.list li .icon-container img{max-height:75px}
2962
div[data-control="media-manager"] .media-list.list li .icon-container i{font-size:35px}
63+
div[data-control="media-manager"] .media-list.list li .icon-container svg{max-height:44px}
3064
div[data-control="media-manager"] .media-list.list li .icon-container.image{border-right:1px solid #ecf0f1!important}
3165
div[data-control="media-manager"] .media-list.list li .icon-container p.thumbnail-error-message{display:none}
3266
div[data-control="media-manager"] .media-list.list .icon-wrapper{width:75px}
@@ -47,6 +81,7 @@ div[data-control="media-manager"] .media-list.tiles li .image-placeholder[data-l
4781
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}
4882
div[data-control="media-manager"] .media-list.tiles li .icon-container img{max-height:165px}
4983
div[data-control="media-manager"] .media-list.tiles li .icon-container i{font-size:55px}
84+
div[data-control="media-manager"] .media-list.tiles li .icon-container svg{max-height:65px}
5085
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"}
5186
div[data-control="media-manager"] .media-list.tiles li.selected .icon-container{background:#4ea5e0 !important;border-color:#2581b8}
5287
div[data-control="media-manager"] .media-list.tiles li.selected .icon-container i,
@@ -56,8 +91,11 @@ div[data-control="media-manager"] .media-list.tiles i.icon-chain-broken{margin-t
5691
div[data-control="media-manager"] .media-list.tiles p.size{margin-bottom:0}
5792
div[data-control="media-manager"] [data-control="sidebar-labels"]{word-wrap:break-word}
5893
div[data-control="media-manager"] .sidebar-group{margin-bottom:20px}
59-
div[data-control="media-manager"] .sidebar-image-placeholder-container{display:table;width:100%}
60-
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}
94+
div[data-control="media-manager"] .sidebar-image-placeholder-container,
95+
div[data-control="media-manager"] .sidebar-document-placeholder-container{display:table;width:100%}
96+
div[data-control="media-manager"] .sidebar-image-placeholder,
97+
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}
98+
div[data-control="media-manager"] .sidebar-image-placeholder{height:225px}
6199
div[data-control="media-manager"] .sidebar-image-placeholder[data-loading]{background:#ecf0f1}
62100
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}
63101
div[data-control="media-manager"] .sidebar-image-placeholder i.icon-chain-broken,
@@ -67,6 +105,8 @@ div[data-control="media-manager"] .sidebar-image-placeholder i.icon-level-up{col
67105
div[data-control="media-manager"] .sidebar-image-placeholder.no-border{border-bottom:none}
68106
div[data-control="media-manager"] .sidebar-image-placeholder p{font-size:12px;margin:10px;line-height:160%;color:#bdc3c7;margin-top:25px}
69107
div[data-control="media-manager"] .sidebar-image-placeholder img{max-width:100%;max-height:225px}
108+
div[data-control="media-manager"] .sidebar-document-placeholder{height:155px}
109+
div[data-control="media-manager"] .sidebar-document-placeholder svg{width:100px;height:100px}
70110
div[data-control="media-manager"] .list-container{position:relative;z-index:100}
71111
div[data-control="media-manager"] .list-container .no-data{font-size:13px}
72112
div[data-control="media-manager"] .list-container p.no-data{padding:0 20px 20px 20px}

modules/backend/widgets/mediamanager/assets/js/mediamanager-browser-min.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ for(var i=0,len=previewContainer.children.length;i<len;i++){previewContainer.rem
145145
switch(documentType){case'audio':template=previewPanel.querySelector('[data-control="audio-template"]').innerHTML
146146
break;case'video':template=previewPanel.querySelector('[data-control="video-template"]').innerHTML
147147
break;case'image':template=previewPanel.querySelector('[data-control="image-template"]').innerHTML
148+
break;case'document':template=previewPanel.querySelector('[data-control="document-template"]').innerHTML
148149
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'))
150+
if(documentType=='document')this.loadSidebarDocumentIcon(item)
149151
if(documentType=='image')this.loadSidebarThumbnail()}else if(items.length==1&&items[0].hasAttribute('data-root')){template=previewPanel.querySelector('[data-control="go-up"]').innerHTML
150152
previewContainer.innerHTML=template}else if(items.length==0){template=previewPanel.querySelector('[data-control="no-selection-template"]').innerHTML
151153
previewContainer.innerHTML=template}else{template=previewPanel.querySelector('[data-control="multi-selection-template"]').innerHTML
@@ -164,6 +166,8 @@ if(this.isSearchMode()){previewPanel.querySelector('[data-control="item-folder"]
164166
var folderNode=previewPanel.querySelector('[data-label="folder"]')
165167
folderNode.textContent=item.getAttribute('data-folder')
166168
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)}
169+
MediaManager.prototype.loadSidebarDocumentIcon=function(item){var sidebarDocument=this.sidebarPreviewElement.querySelector('[data-control="sidebar-document"]'),svg=item.querySelector('svg')
170+
sidebarDocument.innerHTML=svg.outerHTML}
167171
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"]')
168172
if(!sidebarThumbnail)return
169173
var data={path:sidebarThumbnail.getAttribute('data-path'),lastModified:sidebarThumbnail.getAttribute('data-last-modified')}
@@ -536,4 +540,4 @@ case'undo-resizing':this.undoResizing()
536540
break}}
537541
MediaManagerImageCropPopup.prototype.onSelectionChanged=function(c){this.updateSelectionSizeLabel(c.w,c.h)}
538542
MediaManagerImageCropPopup.DEFAULTS={alias:undefined,onDone:undefined}
539-
$.wn.mediaManager.imageCropPopup=MediaManagerImageCropPopup}(window.jQuery);
543+
$.wn.mediaManager.imageCropPopup=MediaManagerImageCropPopup}(window.jQuery);

0 commit comments

Comments
 (0)