Skip to content

Commit

Permalink
components folder changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Jul 14, 2020
1 parent 313e903 commit 6ad8505
Show file tree
Hide file tree
Showing 58 changed files with 193 additions and 128 deletions.
104 changes: 104 additions & 0 deletions src/plone/staticresources/static/components/mockup/CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,110 @@ Changelog
.. towncrier release notes start
3.2.0 (2020-06-28)
------------------

New features:


- pat-plone-modal: We can set a string for onSuccess, onError and onFormError
which is the name of a global function to call, on the model of sortable pattern.
This fixes https://github.com/plone/mockup/issues/825
[thomasdesvenain] (#825)
- pat-select2: we can set actions on events: selecting, select, deselecting, deselect (#886)
- pat-plone-modal: Added an onRender option to set a callback that is called when modal is rendered.
This fixes https://github.com/plone/mockup/issues/891
[thomasdesvenain] (#891)
- pat-tooltip: allow ajax content
data-pat-tooltip can get two values:
- "ajaxUrl": the url of tooltip ajax content
- "contentSelector" a js selector of content to display from source content (#892)
- pat-tooltip: we can add classes and style into tooltip (#893)
- TinyMCE: Add support for image captions.
If an image caption is given, the ``<img>`` tag is wrapped within a ``<figure>`` tag and a ``<figcaption>`` tag is added.
The image has an additional class ``image-richtext`` for further reuse.
[thet] (#911)
- Upgrade Sinon from version 1.17.1 to 7.5.0.
[davilima6] (#914)
- Structure pattern:
Filter now reads "Search" and is cleared when changing directories.
Querystring popover button: filter instead of search icon, "Extra Filter" title.
Show statusmessage with "Clear" button when filters are applied.
Show visually if a filter is set.
Allow multiple status messages.
Change message from misleading "Cannot order items while querying" to "Drag and drop reordering is disabled while filters are applied.". Fixes: https://github.com/collective/plone.app.locales/issues/173
Display toolbar a bit compacter.
[thet] (#937)
- Upgrade node version for testing on travis.
[thet] (#938)
- Upgrade patternslib to 2.1.3.
[thet] (#944)
- Do not use HTML lists where items are not lists [a11y]
[erral] (#948)
- Barceloneta-LTS support for ``mockup-patterns-inlinevalidation`` and ``mockup-patterns-modal``
[petschki] (#975)


Bug fixes:


- TinyMCE: fix the position of menu dropdowns when in a modal (#867)
- pat-plone-modal: If we click on a pat-plone-modal link into a mockup modal, the page is not reloaded.
This fixes https://github.com/plone/mockup/issues/884
[thomasdesvenain] (#884)
- tinymce pattern: Add missing translations by...
- copying generateModalHtml function from master branch,
- adding some backported xml changes from 71ddf6f387
- adding 2 further translations (not yet in master)
[djowett-ftw] (#910)
- Upgrade handlebars from 4.1.2 to 4.5.3 to avoid its vulnerabilies

see:

- https://www.npmjs.com/advisories/1300
- https://www.npmjs.com/advisories/1184 (#931)
- Structure pattern: Escape special characters when filtering
[frapell] (#932)
- pat-querystring: Fix path widget for old dashed UIDs (plone.uuid < 1.0.2)
[laulaz] (#939)
- For the ``i18n-dump`` Grunt task, do not read files in directories except ``mockup`` and ``js``.
[thet] (#943)
- TinyMCE pattern: add a random id to the passed in container_id: there might be more than one TinyMCE active in the DOM. Improves #920 which was a fix for positioning of sub-menus in a modal.
[fredvd] (#945)
- Tinymce pattern: add tests for the tabs in template link.xml
[batlock666] (#946)
- Make toolbar tab-navigable effectively hiding submenus
[erral & ionlizarazu] (#950)
- Add a label to the structure pattern serchbox
[erral & ionlizarazu] (#952)
- Structure pattern: add a title to the root item in the breadcrumb
[erral & ionlizarazu] (#955)
- add a label to the select all checkbox and to each of the items in the table to make the table more accessible
[erral & ionlizarazu] (#957)
- toolbar pattern: improve accessibility of up and down arrows
[erral & ionlizarazu] (#959)
- Reorder items to show popover just after their corresponding button to be able to tab-navigate to them
[erral & ionlizarazu] (#963)
- add missing title and aria-label attributes
[erral & ionlizarazu] (#965)
- Remove text from the pagination listing and fix styling
[erral & ionlizarazu] (#967)
- Close popovers when ESC is pushed
[erral & ionlizarazu] (#968)
- pat-inlinevalidation: Fix bug where drop downs would not get validated
[frapell] (#971)
- Set value for RelativeDateWidget on edit
[petschki] (#982)
- Fix Upload tab in TinyMCE Image showing [object Object].
https://github.com/plone/Products.CMFPlone/issues/3120
Fix folder contents "Configure display column" dialog going under toolbar.
https://github.com/plone/Products.CMFPlone/issues/3124
[vincentfretin] (#986)
- Fix regression with moment date not localized. This closes
https://github.com/plone/Products.CMFPlone/issues/2953
[vincentfretin] (#987)


3.1.1 (2019-11-25)
------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ define([
this.$el.attr('aria-label', this.options.title || this.options.tooltip || '');
_.each(this.extraClasses, function(klass) {
this.$el.addClass(klass);
});
}.bind(this));
}, this);
},
handleClick: function(e) {
e.preventDefault();
if (!this.$el.prop('disabled')) {
if (!this.$el.is('.disabled')) {
this.uiEventTrigger('click', this, e);
}
},
serializedModel: function() {
return _.extend({'icon': '', 'title': '', 'shortcut': ''}, this.options);
},
disable: function() {
this.$el.prop('disabled', true);
this.$el.addClass('disabled');
},
enable: function() {
this.$el.prop('disabled', false);
this.$el.removeClass('disabled');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ define([
},
handleClick: function(e) {
e.preventDefault();
if (!this.$el.prop('disabled')) {
if (!this.$el.is('.disabled')) {
this.uiEventTrigger('click', this, e);
}
},
serializedModel: function() {
return _.extend({'icon': '', 'title': ''}, this.options);
},
disable: function() {
this.$el.prop('disabled', true);
this.$el.addClass('disabled');
},
enable: function() {
this.$el.prop('disabled', false);
this.$el.removeClass('disabled');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ define([
actualHeight = $tip[0].offsetHeight;

switch (placement) {
case 'bottom-right':
tp = {top: pos.top + pos.height, left: pos.left + pos.width - 40};
break;
case 'bottom':
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2};
break;
Expand Down Expand Up @@ -192,7 +195,8 @@ define([

this.positionArrow(delta - width + actualWidth, actualWidth, 'left');

} else {
} else if (placement !== 'bottom-right') {
// If placement is bottom-right, don't override left position for the arrow that is defined in css to 20px.
this.positionArrow(actualHeight - height, actualHeight, 'top');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
&.active {
display: block;
}
// Offset the popover to account for the popover arrow
&.bottom-right { margin-top: @popover-arrow-width; }
&.bottom-right > .arrow {
top: -@popover-arrow-outer-width;
left: 20px;
margin-left: -@popover-arrow-outer-width;
border-top-width: 0;
border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
border-bottom-color: @popover-arrow-outer-color;
&:after {
top: 1px;
margin-left: -@popover-arrow-width;
content: " ";
border-top-width: 0;
border-bottom-color: @popover-arrow-color;
}
}
}
.backdrop-popover {
background-color: #fff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
min-width: 250px;
}
}
.alink.disabled {
cursor: @cursor-disabled;
.opacity(.65);
}
.input-group:extend(.input-group all){}
.input-group-addon:extend(.input-group-addon all){}
.input-group-btn:extend(.input-group-btn all){}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ define([
$('[id$="sort_on"]', existingSortOn).val($(this).val());
});

self.$sortOn.append($('<option value="">No sorting</option>')); // default no sorting
self.$sortOn.append($('<option value="">' + _t('No sorting') + '</option>')); // default no sorting
for (var key in self.options['sortable_indexes']) { // jshint ignore:line
self.$sortOn.append(
$('<option/>')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,13 @@
}

.lessvariables,
.patternoptionsuse {
.patternoptions {
.form{
padding-top: 15px;
clear: both;
}
}

.pat-resourceregistry .lessvariables .form {
padding-top: 10px;
clear: both;
}

.patternoptions {
.form-control-feedback {
top: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
define(['underscore'], function(_) {
define(['underscore', 'translate'], function(_, _t) {
'use strict';

var menuOptions = {
'openItem': {
'url': '#',
'title': 'Open',
'title': _t('Open'),
'category': 'button',
'iconCSS': 'glyphicon glyphicon-eye-open',
'css': '',
'modal': false
},
'editItem': {
'url': '#',
'title': 'Edit',
'title': _t('Edit'),
'category': 'button',
'iconCSS': 'glyphicon glyphicon-pencil',
'css': '',
Expand All @@ -22,7 +22,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'cutClicked',
'url': '#',
'title': 'Cut',
'title': _t('Cut'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-scissors',
'css': '',
Expand All @@ -32,7 +32,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'copyClicked',
'url': '#',
'title': 'Copy',
'title': _t('Copy'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-duplicate',
'css': '',
Expand All @@ -42,7 +42,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'pasteClicked',
'url': '#',
'title': 'Paste',
'title': _t('Paste'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-open-file',
'css': '',
Expand All @@ -52,7 +52,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'moveTopClicked',
'url': '#',
'title': 'Move to top of folder',
'title': _t('Move to top of folder'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-step-backward rright',
'css': '',
Expand All @@ -62,7 +62,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'moveBottomClicked',
'url': '#',
'title': 'Move to bottom of folder',
'title': _t('Move to bottom of folder'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-step-backward rleft',
'css': '',
Expand All @@ -72,7 +72,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'setDefaultPageClicked',
'url': '#',
'title': 'Set as default page',
'title': _t('Set as default page'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-ok-circle',
'css': '',
Expand All @@ -82,7 +82,7 @@ define(['underscore'], function(_) {
'library': 'mockup-patterns-structure-url/js/actions',
'method': 'selectAll',
'url': '#',
'title': 'Select all contained items',
'title': _t('Select all contained items'),
'category': 'dropdown',
'iconCSS': 'glyphicon glyphicon-check',
'css': '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ define([
self.columnsView = new ColumnsView({
app: self,
triggerView: columnsBtn,
id: 'structure-columns'
id: 'structure-columns',
placement: 'bottom-right'
});
items.push(columnsBtn);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([
var WellView = PopoverView.extend({
className: 'popover selected-items',
title: _.template(
'<input type="text" class="filter" placeholder="Filter" />' +
'<input type="text" class="filter" placeholder="<%- _t("Filter") %>" />' +
'<a href="#" class=" remove-all">' +
'<span class="glyphicon glyphicon-remove-circle"></span> <%- _t("remove all") %></a>'
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
.navbar {
position: sticky;
top: 0;
z-index: 1060;
z-index: 10;
background-color: #fafafa;

border: none;
Expand Down Expand Up @@ -189,6 +189,10 @@
max-width: 650px;
}

.popover.rearrange{
max-width: 400px;
}

.upload-container .upload-area{
width: 500px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
aria-haspopup="true"
aria-expanded="true"
id="<%- id %>"
title="Actions">
title='<%- _t("Actions") %>'>
<span class="glyphicon glyphicon-cog"></span><span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right" aria-labelledby="<%- id %>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ define([
}
// check if the personal toolbar is not offseted if there isn't enough space
// and we already have the plone-toolbar-more-options added to the page.
if ($pers_bar_container[0].offsetTop !== 0) {
if ($pers_bar_container[0] && $pers_bar_container[0].offsetTop !== 0) {
that.cloneViewsIntoSubset(
$pers_bar_container,
$content_views,
Expand Down
Loading

0 comments on commit 6ad8505

Please sign in to comment.