Skip to content

Commit 6ab190d

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into API-Sprint41-Bugs
2 parents 7e55595 + 9e8434e commit 6ab190d

File tree

971 files changed

+23589
-96710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

971 files changed

+23589
-96710
lines changed

Gruntfile.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module.exports = function (grunt) {
1111
// Require
1212
// --------------------------------------
1313

14+
require('./dev/tools/grunt/tasks/mage-minify')(grunt);
15+
1416
// Time how long tasks take. Can help when optimizing build times
1517
require('time-grunt')(grunt);
1618

@@ -33,7 +35,10 @@ module.exports = function (grunt) {
3335
blank: 'app/design/frontend/Magento/blank',
3436
luma: 'app/design/frontend/luma'
3537
},
36-
doc: 'lib/web/css/docs'
38+
doc: 'lib/web/css/docs',
39+
uglify: {
40+
legacy: 'lib/web/legacy-build.min.js'
41+
}
3742
},
3843
doc: {
3944
styleName: 'docs'
@@ -110,7 +115,7 @@ module.exports = function (grunt) {
110115
},
111116
documentation: {
112117
files: {
113-
'<%= config.path.doc %>/<%= config.doc.styleName %>.css': "<%= config.path.doc %>/source/<%= config.doc.styleName %>.less"
118+
'<%= config.path.doc %>/<%= config.doc.styleName %>.css': '<%= config.path.doc %>/source/<%= config.doc.styleName %>.less'
114119
}
115120
}
116121
},
@@ -131,10 +136,40 @@ module.exports = function (grunt) {
131136
'<%= config.path.doc %>': '<%= config.path.doc %>/source' // Todo UI: Check out JS for Styledocco
132137
}
133138
}
134-
}
139+
},
135140

141+
'mage-minify': {
142+
legacy: {
143+
options: {
144+
type: 'yui-js',
145+
tempPath: 'var/cache/',
146+
options: ['--nomunge=true']
147+
},
148+
files: {
149+
'<%= config.path.uglify.legacy %>': [
150+
'lib/web/prototype/prototype.js',
151+
'lib/web/prototype/window.js',
152+
'lib/web/scriptaculous/builder.js',
153+
'lib/web/scriptaculous/effects.js',
154+
'lib/web/lib/ccard.js',
155+
'lib/web/prototype/validation.js',
156+
'lib/web/varien/js.js',
157+
'lib/web/mage/adminhtml/varienLoader.js',
158+
'lib/web/mage/adminhtml/tools.js'
159+
]
160+
}
161+
}
162+
}
136163
});
137164

165+
/**
166+
* Creates build of a legacy files.
167+
* Mostly prototype dependant libraries.
168+
*/
169+
grunt.registerTask('legacy-build', [
170+
'mage-minify:legacy'
171+
]);
172+
138173
// Default task
139174
// --------------------------------------
140175
grunt.registerTask('default', []); // ToDo UI: define default tasks

app/code/Magento/AdminNotification/view/adminhtml/requirejs-config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
systemMessageDialog: 'Magento_AdminNotification/system/notification'
9+
systemMessageDialog: 'Magento_AdminNotification/system/notification',
10+
toolbarEntry: 'Magento_AdminNotification/toolbar_entry'
1011
}
11-
},
12-
deps: [
13-
"Magento_AdminNotification/toolbar_entry"
14-
]
12+
}
1513
};

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @see \Magento\AdminNotification\Block\Window
1313
*/
1414
?>
15-
<div class="fade critical-notification">
15+
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification">
1616
<div class="popup popup-<?php echo preg_replace('#[^a-z0-9]+#', '-', strtolower($this->getSeverityText())) ?>">
1717
<div class="popup-inner">
1818
<header class="popup-header">

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
?>
1010
<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?>
1111
<?php $notificationCount = $this->getUnreadNotificationCount(); ?>
12-
<div class="notifications-summary" data-notification-count="<?php echo $this->escapeHtml($notificationCount); ?>">
12+
<div data-mage-init='{"toolbarEntry": {}}' class="notifications-summary" data-notification-count="<?php echo $this->escapeHtml($notificationCount); ?>">
1313
<?php if ($notificationCount > 0) : ?>
1414
<a href="<?php echo $this->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action" data-mage-init='{"dropdown":{}}' title="<?php echo __('Notifications'); ?>" data-toggle="dropdown">
1515
<span class="text"><?php echo __('Notifications'); ?></span>

app/code/Magento/AdminNotification/view/adminhtml/web/toolbar_entry.js

Lines changed: 90 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -4,106 +4,105 @@
44
*/
55
define([
66
"jquery",
7-
"jquery/ui"
7+
"jquery/ui",
8+
"domReady!"
89
], function($){
910
'use strict';
1011

11-
$(document).ready(function() {
12-
// Mark notification as read via AJAX call
13-
var markNotificationAsRead = function(notificationId) {
14-
var requestUrl = $('.notifications-summary .dropdown-menu').attr('data-mark-as-read-url');
15-
$.ajax({
16-
url: requestUrl,
17-
type: 'POST',
18-
dataType: 'json',
19-
data: {
20-
id: notificationId
21-
},
22-
showLoader: false
23-
});
24-
};
25-
var notificationCount = $('.notifications-summary').attr('data-notification-count');
26-
// Remove notification from the list
27-
var removeNotificationFromList = function(notificationEntry) {
28-
notificationEntry.remove();
29-
notificationCount--;
30-
$('.notifications-summary').attr('data-notification-count', notificationCount);
31-
32-
if (notificationCount == 0) {
33-
// Change appearance of the bubble and its behavior when the last notification is removed
34-
$('.notifications-summary .dropdown-menu').remove();
35-
var notificationIcon = $('.notifications-summary .notifications-icon');
36-
notificationIcon.removeAttr('data-toggle');
37-
notificationIcon.off('click.dropdown');
38-
$('.notifications-action .counter').text('');
39-
$('.notifications-action .counter').hide();
40-
} else {
41-
$('.notifications-action .counter').text(notificationCount);
42-
// Modify caption of the 'See All' link
43-
var actionElement = $('.notifications-summary .dropdown-menu .last .action-more');
44-
actionElement.text(actionElement.text().replace(/\d+/, notificationCount));
45-
}
46-
};
47-
48-
// Show popup with notification details
49-
var showNotificationDetails = function(notificationEntry) {
50-
var popupElement = notificationEntry.find('.notifications-dialog-content').clone();
51-
var notificationId = notificationEntry.attr('data-notification-id');
52-
var dialogClassSeverity = 'notifications-entry-dialog';
53-
if (notificationEntry.attr('data-notification-severity')) {
54-
dialogClassSeverity = 'notifications-entry-dialog notifications-entry-dialog-critical';
55-
}
56-
popupElement.dialog({
57-
title: popupElement.attr('data-title'),
58-
minWidth: 500,
59-
modal: true,
60-
dialogClass: dialogClassSeverity,
61-
buttons: [
62-
{
63-
text: popupElement.attr('data-acknowledge-caption'),
64-
'class': 'action-acknowledge primary',
65-
click: function(event) {
66-
markNotificationAsRead(notificationId);
67-
removeNotificationFromList(notificationEntry);
68-
$(this).dialog('close');
69-
}
70-
},
71-
{
72-
text: popupElement.attr('data-cancel-caption'),
73-
'class': 'action-cancel',
74-
click: function(event) {
75-
$(this).dialog('close');
76-
}
77-
}
78-
]
79-
});
80-
popupElement.parent().attr('aria-live','assertive');
81-
popupElement.dialog('open');
82-
};
83-
84-
// Show notification description when corresponding item is clicked
85-
$('.notifications-summary .dropdown-menu .notifications-entry').on('click.showNotification', function(event) {
86-
// hide notification dropdown
87-
$('.notifications-summary .notifications-icon').trigger('click.dropdown');
88-
showNotificationDetails($(this));
89-
event.stopPropagation();
90-
});
91-
92-
// Remove corresponding notification from the list and mark it as read
93-
$('.notifications-close').on('click.removeNotification', function(event) {
94-
var notificationEntry = $(this).closest('.notifications-entry')
95-
var notificationId = notificationEntry.attr('data-notification-id');
96-
markNotificationAsRead(notificationId);
97-
removeNotificationFromList(notificationEntry);
98-
event.stopPropagation();
12+
// Mark notification as read via AJAX call
13+
var markNotificationAsRead = function(notificationId) {
14+
var requestUrl = $('.notifications-summary .dropdown-menu').attr('data-mark-as-read-url');
15+
$.ajax({
16+
url: requestUrl,
17+
type: 'POST',
18+
dataType: 'json',
19+
data: {
20+
id: notificationId
21+
},
22+
showLoader: false
9923
});
24+
};
25+
var notificationCount = $('.notifications-summary').attr('data-notification-count');
26+
// Remove notification from the list
27+
var removeNotificationFromList = function(notificationEntry) {
28+
notificationEntry.remove();
29+
notificationCount--;
30+
$('.notifications-summary').attr('data-notification-count', notificationCount);
10031

101-
// Hide notifications bubble
10232
if (notificationCount == 0) {
33+
// Change appearance of the bubble and its behavior when the last notification is removed
34+
$('.notifications-summary .dropdown-menu').remove();
35+
var notificationIcon = $('.notifications-summary .notifications-icon');
36+
notificationIcon.removeAttr('data-toggle');
37+
notificationIcon.off('click.dropdown');
38+
$('.notifications-action .counter').text('');
10339
$('.notifications-action .counter').hide();
10440
} else {
105-
$('.notifications-action .counter').show();
41+
$('.notifications-action .counter').text(notificationCount);
42+
// Modify caption of the 'See All' link
43+
var actionElement = $('.notifications-summary .dropdown-menu .last .action-more');
44+
actionElement.text(actionElement.text().replace(/\d+/, notificationCount));
45+
}
46+
};
47+
48+
// Show popup with notification details
49+
var showNotificationDetails = function(notificationEntry) {
50+
var popupElement = notificationEntry.find('.notifications-dialog-content').clone();
51+
var notificationId = notificationEntry.attr('data-notification-id');
52+
var dialogClassSeverity = 'notifications-entry-dialog';
53+
if (notificationEntry.attr('data-notification-severity')) {
54+
dialogClassSeverity = 'notifications-entry-dialog notifications-entry-dialog-critical';
10655
}
56+
popupElement.dialog({
57+
title: popupElement.attr('data-title'),
58+
minWidth: 500,
59+
modal: true,
60+
dialogClass: dialogClassSeverity,
61+
buttons: [
62+
{
63+
text: popupElement.attr('data-acknowledge-caption'),
64+
'class': 'action-acknowledge primary',
65+
click: function(event) {
66+
markNotificationAsRead(notificationId);
67+
removeNotificationFromList(notificationEntry);
68+
$(this).dialog('close');
69+
}
70+
},
71+
{
72+
text: popupElement.attr('data-cancel-caption'),
73+
'class': 'action-cancel',
74+
click: function(event) {
75+
$(this).dialog('close');
76+
}
77+
}
78+
]
79+
});
80+
popupElement.parent().attr('aria-live','assertive');
81+
popupElement.dialog('open');
82+
};
83+
84+
// Show notification description when corresponding item is clicked
85+
$('.notifications-summary .dropdown-menu .notifications-entry').on('click.showNotification', function(event) {
86+
// hide notification dropdown
87+
$('.notifications-summary .notifications-icon').trigger('click.dropdown');
88+
showNotificationDetails($(this));
89+
event.stopPropagation();
90+
});
91+
92+
// Remove corresponding notification from the list and mark it as read
93+
$('.notifications-close').on('click.removeNotification', function(event) {
94+
var notificationEntry = $(this).closest('.notifications-entry')
95+
var notificationId = notificationEntry.attr('data-notification-id');
96+
markNotificationAsRead(notificationId);
97+
removeNotificationFromList(notificationEntry);
98+
event.stopPropagation();
10799
});
108100

101+
// Hide notifications bubble
102+
if (notificationCount == 0) {
103+
$('.notifications-action .counter').hide();
104+
} else {
105+
$('.notifications-action .counter').show();
106+
}
107+
109108
});

app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function _getFooterHtml($element)
214214
protected function _getExtraJs($element)
215215
{
216216
$htmlId = $element->getHtmlId();
217-
$output = "Fieldset.applyCollapse('{$htmlId}');";
217+
$output = "require(['prototype'], function(){Fieldset.applyCollapse('{$htmlId}');});";
218218
return $this->_jsHelper->getScript($output);
219219
}
220220

app/code/Magento/Backend/Block/Widget/Button/SplitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function getToggleAttributesHtml()
123123
}
124124

125125
$attributes = ['title' => $title, 'class' => join(' ', $classes), 'disabled' => $disabled];
126-
$this->_getDataAttributes(['toggle' => 'dropdown'], $attributes);
126+
$this->_getDataAttributes(['mage-init' => '{"dropdown": {}}', 'toggle' => 'dropdown'], $attributes);
127127

128128
$html = $this->_getAttributesString($attributes);
129129
$html .= $this->getUiId('dropdown');

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,10 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
99
<head>
1010
<title>Magento Admin</title>
11-
<link src="prototype/prototype.js"/>
12-
<link src="prototype/window.js"/>
13-
<link src="scriptaculous/builder.js"/>
14-
<link src="scriptaculous/effects.js"/>
15-
<link src="lib/ccard.js"/>
16-
<link src="prototype/validation.js"/>
17-
<link src="varien/js.js"/>
18-
<link src="mage/adminhtml/varienLoader.js"/>
19-
<link src="mage/adminhtml/tools.js"/>
20-
<link src="lib/ds-sleight.js" ie_condition="lt IE 7" defer="defer"/>
21-
<css src="mage/calendar.css"/>
11+
<link src="legacy-build.min.js"/>
2212
<link src="requirejs/require.js"/>
23-
<link src="mage/requirejs/resolver.js"/>
24-
<link src="jquery/jquery.js"/>
25-
<link src="mage/jquery-no-conflict.js"/>
26-
<link src="app-config.js"/>
27-
<link src="extjs/ext-tree.js"/>
28-
<link src="extjs/ext-tree-checkbox.js"/>
13+
<link src="jquery.js"/>
14+
<css src="mage/calendar.css"/>
2915
<css src="extjs/resources/css/ext-all.css"/>
3016
<css src="extjs/resources/css/ytheme-magento.css"/>
3117
</head>
@@ -87,7 +73,6 @@
8773
<referenceContainer name="after.body.start">
8874
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
8975
<block class="Magento\Translation\Block\Js" name="translate" template="Magento_Translation::translate.phtml"/>
90-
<block class="Magento\Framework\View\Element\Template" name="head.scripts" template="Magento_Backend::page/js/head_scripts.phtml"/>
9176
<block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/>
9277
<block class="Magento\Framework\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/>
9378
</referenceContainer>

app/code/Magento/Backend/view/adminhtml/requirejs-config.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)