Merge branch 'develop' of github.com:octobercms/october into develop

Conflicts:
	modules/backend/widgets/table/assets/js/build-min.js
This commit is contained in:
alekseybobkov 2015-01-13 18:46:01 -08:00
commit c2d03194b4
6 changed files with 52 additions and 15646 deletions

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ return'<i class="select-icon '+iconClass+'"></i> '+state.text
if(imageSrc)
return'<img class="select-image" src="'+imageSrc+'" alt="" /> '+state.text
return state.text}
$('select.custom-select').select2({formatResult:formatSelectOption,formatSelection:formatSelectOption,escapeMarkup:function(m){return m;}})})
$('select.custom-select:not([data-no-auto-update-on-render=true])').select2({formatResult:formatSelectOption,formatSelection:formatSelectOption,escapeMarkup:function(m){return m;}})})
$(document).on('disable','select.custom-select',function(event,status){$(this).select2('enable',!status)})
$(document).on('focus','select.custom-select',function(event){setTimeout($.proxy(function(){$(this).select2('focus')},this),10)})})(jQuery);$(window).on('ajaxErrorMessage',function(event,message){swal({title:message,confirmButtonClass:'btn-default'})
event.preventDefault()})
@ -765,7 +765,9 @@ self.endScrollTimeout=undefined},50)}else{$el.trigger('oc.scrollEnd')}
return scrolled}
setTimeout(function(){self.update()},1);}
Scrollbar.DEFAULTS={vertical:true,scrollSpeed:2,animation:true,start:function(){},drag:function(){},stop:function(){}}
Scrollbar.prototype.update=function(){this.$scrollbar.hide()
Scrollbar.prototype.update=function(){if(!this.$scrollbar)
return
this.$scrollbar.hide()
this.setThumbSize()
this.setThumbPosition()
this.$scrollbar.show()}
@ -1381,7 +1383,7 @@ Inspector.prototype.getPopoverTemplate=function(){return'
</table> \
<form> \
'}
Inspector.prototype.init=function(){if(this.config.length==0)
Inspector.prototype.init=function(){if(!this.config||this.config.length==0)
return
var self=this,fieldsConfig=this.preprocessConfig(),data={title:this.title?this.title:this.$el.data('inspector-title'),description:this.description?this.description:this.$el.data('inspector-description'),properties:fieldsConfig.properties,editor:function(){return function(text,render){if(this.itemType=='property')
return self.renderEditor(this,render)}},info:function(){return function(text,render){if(this.description!==undefined&&this.description!=null)
@ -1589,7 +1591,9 @@ e.preventDefault()
var self=this
setTimeout(function(){self.focus()},0)
return false})
$('[data-toggle=tooltip]',this.$el.data('oc.popover').$container).tooltip('hide')}
$('[data-toggle=tooltip]',this.$el.data('oc.popover').$container).tooltip('hide')
if(!e.isDefaultPrevented()){$.each(this.editors,function(){if(this.cleanup)
this.cleanup()})}}
Inspector.prototype.editorExternalPropertyEnabled=function(editor){var $container=this.$el.data('inspector-container'),$cell=$('#'+editor.inspectorCellId,$container),$extPropEditorContainer=$cell.find('.external-param-editor-container')
return $extPropEditorContainer.hasClass('editor-visible')}
Inspector.prototype.findEditor=function(property){var count=this.editors.length
@ -1678,6 +1682,7 @@ InspectorEditorDropdown.prototype.getTemplate=function(){return'
</td> \
';}
InspectorEditorDropdown.prototype.init=function(){var value=this.inspector.readProperty(this.fieldDef.property),self=this
$(this.selector).attr('data-no-auto-update-on-render','true')
$(this.selector).val(value)
if(!Modernizr.touch){var options={dropdownCssClass:'ocInspectorDropdown'}
if(this.fieldDef.placeholder!==undefined)
@ -1722,6 +1727,7 @@ self.initialization=false
self.hideLoadingIndicator()},error:function(jqXHR,textStatus,errorThrown){alert(jqXHR.responseText.length?jqXHR.responseText:jqXHR.statusText)
self.hideLoadingIndicator()}})}
InspectorEditorDropdown.prototype.onHideExternalParameterEditor=function(){this.loadOptions(false)}
InspectorEditorDropdown.prototype.cleanup=function(){$(this.selector).select2('destroy')}
$.oc.inspector.editors.inspectorEditorDropdown=InspectorEditorDropdown;function initInspector($element){var inspector=$element.data('oc.inspector')
if(inspector===undefined){inspector=new Inspector($element.get(0),$element.data())
inspector.loadConfiguration(function(){inspector.init()})

View File

@ -217,7 +217,7 @@ class FileUpload extends FormWidgetBase
$validationRules = ['max:'.File::getMaxFilesize()];
if ($isImage) {
$validationRules[] = 'mimes:jpg,jpeg,bmp,png,gif';
$validationRules[] = 'mimes:jpg,jpeg,bmp,png,gif,svg';
}
$validation = Validator::make(

View File

@ -16,7 +16,7 @@
data-show-gutter="<?= $showGutter ? 'true' : 'false' ?>"
data-language="<?= $language ?>"
data-margin="<?= $margin ?>"
data-vendor-path="<?= URL::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>/">
data-vendor-path="<?= URL::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>">
<div class="editor-toolbar">
<ul>
<li class="fullscreen-enable">

View File

@ -102,7 +102,11 @@ return [
'list_title' => 'Manage Groups',
'new' => 'New Administrator Group',
'delete_confirm' => 'Do you really want to delete this administrator group?',
'return' => 'Return to the group list'
'return' => 'Return to the group list',
'description_field' => 'Description',
'is_new_user_default_field' => 'Add new administrators to this group by default',
'code_field' => 'Code',
'code_comment' => 'Enter a unique code if you want to access it with the API.'
],
'preferences' => [
'not_authenticated' => 'There is no an authenticated user to load or save preferences for.'

View File

@ -40,7 +40,8 @@ trait AssetMaker
}
$result = null;
$reserved = ['build'];
$pathCache = [];
$this->removeDuplicates();
if ($type == null || $type == 'css') {
foreach ($this->assets['css'] as $asset) {
@ -48,16 +49,10 @@ trait AssetMaker
/*
* Prevent duplicates
*/
$path = $this->getAssetEntryBuildPath($asset);
if (isset($pathCache[$path])) {
continue;
}
$pathCache[$path] = true;
$attributes = HTML::attributes(array_merge(
[
'rel' => 'stylesheet',
'href' => $path
'href' => $this->getAssetEntryBuildPath($asset)
],
array_except($asset['attributes'], $reserved)
));
@ -68,20 +63,10 @@ trait AssetMaker
if ($type == null || $type == 'rss') {
foreach ($this->assets['rss'] as $asset) {
/*
* Prevent duplicates
*/
$path = $this->getAssetEntryBuildPath($asset);
if (isset($pathCache[$path])) {
continue;
}
$pathCache[$path] = true;
$attributes = HTML::attributes(array_merge(
[
'rel' => 'alternate',
'href' => $path,
'href' => $this->getAssetEntryBuildPath($asset),
'title' => 'RSS',
'type' => 'application/rss+xml'
],
@ -94,19 +79,9 @@ trait AssetMaker
if ($type == null || $type == 'js') {
foreach ($this->assets['js'] as $asset) {
/*
* Prevent duplicates
*/
$path = $this->getAssetEntryBuildPath($asset);
if (isset($pathCache[$path])) {
continue;
}
$pathCache[$path] = true;
$attributes = HTML::attributes(array_merge(
[
'src' => $path
'src' => $this->getAssetEntryBuildPath($asset)
],
array_except($asset['attributes'], $reserved)
));
@ -202,6 +177,8 @@ trait AssetMaker
*/
public function getAssetPaths()
{
$this->removeDuplicates();
$assets = [];
foreach ($this->assets as $type => $collection) {
$assets[$type] = [];
@ -209,6 +186,7 @@ trait AssetMaker
$assets[$type][] = $this->getAssetEntryBuildPath($asset);
}
}
return $assets;
}
@ -298,4 +276,30 @@ trait AssetMaker
return $asset;
}
/**
* Removes duplicate assets from the entire collection.
* @return void
*/
protected function removeDuplicates()
{
foreach ($this->assets as $type => &$collection) {
$pathCache = [];
foreach ($collection as $key => $asset) {
if (!$path = array_get($asset, 'path')) {
continue;
}
if (isset($pathCache[$path])) {
array_forget($collection, $key);
continue;
}
$pathCache[$path] = true;
}
}
}
}