Skip to content

Commit 70c7e18

Browse files
author
Sven Reichel
authored
RWD theme: use jQuery via composer (#4429)
* removed jquery-files * updated xml layout, added config * test composer plugin * update jquery * updated config scope * Downgraded to 1.12.4 * phpstan baseline
1 parent 8fd1faa commit 70c7e18

File tree

10 files changed

+139
-11068
lines changed

10 files changed

+139
-11068
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
# ChartJs library
2727
/js/lib/chartjs
2828

29+
# jQuery library
30+
/js/lib/jquery/jquery*
31+
2932
# TinyMCE library
3033
/js/lib/tinymce
3134

.phpstan.dist.baseline.neon

+7-1
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,12 @@ parameters:
11401140
count: 1
11411141
path: app/code/core/Mage/Api2/Model/Resource.php
11421142

1143+
-
1144+
message: '#^Call to an undefined method Varien_Data_Collection_Db\:\:addAttributeToFilter\(\)\.$#'
1145+
identifier: method.notFound
1146+
count: 1
1147+
path: app/code/core/Mage/Api2/Model/Resource.php
1148+
11431149
-
11441150
message: '#^Method Mage_Api2_Model_Resource\:\:_create\(\) invoked with 1 parameter, 0 required\.$#'
11451151
identifier: arguments.count
@@ -6117,7 +6123,7 @@ parameters:
61176123
-
61186124
message: '#^If condition is always false\.$#'
61196125
identifier: if.alwaysFalse
6120-
count: 2
6126+
count: 3
61216127
path: app/code/core/Mage/Tax/Helper/Data.php
61226128

61236129
-

app/code/core/Mage/Core/etc/config.xml

+3
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@
310310
<js>
311311
<merge_files>0</merge_files>
312312
</js>
313+
<jquery>
314+
<migrate>0</migrate>
315+
</jquery>
313316
</dev>
314317
<system>
315318
<csrf>

app/code/core/Mage/Core/etc/system.xml

+18
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,24 @@
725725
</merge_css_files>
726726
</fields>
727727
</css>
728+
<jquery translate="label">
729+
<label>jQuery Settings</label>
730+
<sort_order>120</sort_order>
731+
<show_in_default>1</show_in_default>
732+
<show_in_website>1</show_in_website>
733+
<show_in_store>1</show_in_store>
734+
<fields>
735+
<migrate translate="label">
736+
<label>Load jQuery-migration.js</label>
737+
<frontend_type>select</frontend_type>
738+
<source_model>adminhtml/system_config_source_yesno</source_model>
739+
<sort_order>10</sort_order>
740+
<show_in_default>1</show_in_default>
741+
<show_in_website>1</show_in_website>
742+
<show_in_store>1</show_in_store>
743+
</migrate>
744+
</fields>
745+
</jquery>
728746
</groups>
729747
</dev>
730748
<general translate="label" module="core">

app/design/frontend/rwd/default/layout/page.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626
<block type="page/html_head" name="head" as="head">
2727
<action method="addJs"><script>prototype/prototype.js</script></action>
28-
<action method="addJs"><script>lib/jquery/jquery-1.12.4.min.js</script></action>
28+
<action method="addJs"><script>lib/jquery/jquery.min.js</script></action>
29+
<action method="addJs" ifconfig="dev/jquery/migrate">
30+
<script>lib/jquery/jquery-migrate.min.js</script>
31+
</action>
2932
<action method="addJs"><script>lib/jquery/noconflict.js</script></action>
3033
<action method="addJs"><script>lib/ccard.js</script></action>
3134
<action method="addJs"><script>prototype/validation.js</script></action>

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"composer-runtime-api": "^2",
2929
"colinmollenhour/cache-backend-redis": "^1.14",
3030
"colinmollenhour/magento-redis-session": "^3.2.0",
31+
"components/jquery": "1.12.4",
3132
"cweagans/composer-patches": "^1.7",
3233
"ezyang/htmlpurifier": "^4.17",
3334
"flowjs/flowjs": "dev-master",

0 commit comments

Comments
 (0)