Skip to content

Commit 17047c4

Browse files
authored
Merge pull request #8004 from Oldiesmann/cloudflare_cdn
[3.0] Add an option for cdnjs to jQuery CDNs
2 parents 11064ae + 11c9741 commit 17047c4

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Languages/en_US/Help.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
$helptxt['disallow_sendBody'] = 'This setting removes the option to receive the text of replies, posts, and personal messages in notification emails.<br><br>Often, members will reply to the notification email, which in most cases means the webmaster receives the reply.';
265265
$helptxt['enable_ajax_alerts'] = 'This option allows your members to receive AJAX notifications. This means that members do not need to refresh the page to get new notifications.<br><strong>NOTE:</strong> This option might cause a severe load at your server with many users online.';
266266
$helptxt['alerts_auto_purge'] = 'Once an alert has been read, it is rarely needed again. For performance reasons, it is a good idea to automatically delete them after a while.';
267-
$helptxt['jquery_source'] = 'This will determine the source used to load the jQuery Library. <em>Google CDN, jQuery CDN</em> and <em>Microsoft CDN</em> will load the jQuery library from those respective CDN networks. <em>Local</em> will only use the local source. <em>Custom</em> allows you to specify a custom URL for the library.';
267+
$helptxt['jquery_source'] = 'This will determine the source used to load the jQuery Library. <em>Cloudflare CDN (cdnjs), Google CDN, jQuery CDN</em> and <em>Microsoft CDN</em> will load the jQuery library from those respective CDN networks. <em>Local</em> will only use the local source. <em>Custom</em> allows you to specify a custom URL for the library.';
268268
$helptxt['compactTopicPagesEnable'] = 'This will just show a selection of the number of pages.<br><em>Example:</em>
269269
&quot;3&quot; to display: 1 ... 4 [5] 6 ... 9 <br>
270270
&quot;5&quot; to display: 1 ... 3 4 [5] 6 7 ... 9';

Languages/en_US/ManageSettings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
$txt['jquery_custom_label'] = 'Custom';
7777
$txt['jquery_custom'] = 'Custom URL to the jQuery Library';
7878
$txt['jquery_local'] = 'Local';
79+
$txt['jquery_cloudflare_cdn'] = 'Cloudflare CDN (cdnjs)';
7980
$txt['jquery_google_cdn'] = 'Google CDN';
8081
$txt['jquery_jquery_cdn'] = 'jQuery CDN';
8182
$txt['jquery_microsoft_cdn'] = 'Microsoft CDN';

Sources/Actions/Admin/Features.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,7 @@ public static function basicConfigVars(): array
15731573
'jquery_source',
15741574
[
15751575
'cdn' => Lang::getTxt('jquery_google_cdn', file: 'ManageSettings'),
1576+
'cloudflare_cdn' => Lang::getTxt('jquery_cloudflare_cdn', file: 'ManageSettings'),
15761577
'jquery_cdn' => Lang::getTxt('jquery_jquery_cdn', file: 'ManageSettings'),
15771578
'microsoft_cdn' => Lang::getTxt('jquery_microsoft_cdn', file: 'ManageSettings'),
15781579
'local' => Lang::getTxt('jquery_local', file: 'ManageSettings'),

Sources/Theme.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,7 @@ protected function loadJavaScript(): void
22292229
// Add the JQuery library to the list of files to load.
22302230
$jQueryUrls = [
22312231
'cdn' => 'https://ajax.googleapis.com/ajax/libs/jquery/' . JQUERY_VERSION . '/jquery.min.js',
2232+
'cloudflare_cdn' => 'https://cdnjs.cloudflare.com/ajax/libs/' . JQUERY_VERSION . '/jquery.min.js',
22322233
'jquery_cdn' => 'https://code.jquery.com/jquery-' . JQUERY_VERSION . '.min.js',
22332234
'microsoft_cdn' => 'https://ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js',
22342235
];

0 commit comments

Comments
 (0)