Add option to select jQuery 3.x (#1835) + add description to other options in Advanced config screen

This commit is contained in:
Kijin Sung 2022-12-28 01:08:41 +09:00
parent dc1182f6f5
commit 0aa4fed636
6 changed files with 35 additions and 2 deletions

View file

@ -675,10 +675,19 @@ class HTMLDisplayHandler
*/
private function _loadCommonJSCSS()
{
if (config('view.jquery_version') === 3)
{
$jquery_version = self::JQUERY_V3;
$jquery_migrate_version = self::JQUERY_V3_MIGRATE;
}
else
{
$jquery_version = self::JQUERY_V2;
$jquery_migrate_version = self::JQUERY_V2_MIGRATE;
}
Context::loadFile(array('./common/css/rhymix.scss', '', '', -1600000000), true);
$jquery_version = self::JQUERY_V2;
$jquery_migrate_version = self::JQUERY_V2_MIGRATE;
$original_file_list = array(
'plugins/jquery.migrate/jquery-migrate-' . $jquery_migrate_version . '.min.js',
'plugins/cookie/js.cookie.min.js',

View file

@ -77,6 +77,7 @@ return array(
'manager_layout' => 'module',
'minify_scripts' => 'common',
'concat_scripts' => 'none',
'jquery_version' => 2,
'server_push' => false,
'use_gzip' => false,
),

View file

@ -105,6 +105,7 @@ class Advanced extends Base
Context::set('manager_layout', Config::get('view.manager_layout'));
Context::set('minify_scripts', Config::get('view.minify_scripts'));
Context::set('concat_scripts', Config::get('view.concat_scripts'));
Context::set('jquery_version', Config::get('view.jquery_version'));
Context::set('use_server_push', Config::get('view.server_push'));
Context::set('use_gzip', Config::get('view.use_gzip'));
@ -211,6 +212,7 @@ class Advanced extends Base
Config::set('view.manager_layout', $vars->manager_layout ?: 'module');
Config::set('view.minify_scripts', $vars->minify_scripts ?: 'common');
Config::set('view.concat_scripts', $vars->concat_scripts ?: 'none');
Config::set('view.jquery_version', $vars->jquery_version == 3 ? 3 : 2);
Config::set('view.server_push', $vars->use_server_push === 'Y');
Config::set('view.use_gzip', $vars->use_gzip === 'Y');

View file

@ -148,8 +148,12 @@ $lang->cmd_concat_css_only = 'Combine all CSS';
$lang->cmd_concat_js_only = 'Combine all JS';
$lang->cmd_concat_css_js = 'Combine both CSS and JS';
$lang->about_concat_scripts = 'Automatically combine CSS and JS scripts into as few files as possible. External scripts are not combined.';
$lang->jquery_version = 'jQuery Version';
$lang->about_jquery_version = 'You can select the default jQuery version for this site. Please note that jQuery 3.x may not be compatible with older features.';
$lang->use_server_push = 'Use HTTP/2 Server Push';
$lang->about_use_server_push = 'This option adds headers to the response that some CDNs interpret as server push directives.';
$lang->use_gzip = 'gzip Compression';
$lang->about_use_gzip = 'This option should be left off unless you know for sure that your webserver doesn\'t compress output by default.';
$lang->delay_session = 'Delay session start';
$lang->about_delay_session = 'To improve performance when using a caching proxy server such as Varnish, do not issue sessions to visitors until they log in.<br>Selecting this option may interfere with autologin, and visitor counts may become inaccurate.';
$lang->mediafilter_whitelist = 'Allow external media';

View file

@ -149,8 +149,12 @@ $lang->cmd_concat_css_only = 'CSS만 합침';
$lang->cmd_concat_js_only = 'JS만 합침';
$lang->cmd_concat_css_js = 'CSS와 JS를 모두 합침';
$lang->about_concat_scripts = 'CSS, JS 파일들을 하나로 합쳐서 전송합니다. 외부에서 로딩하는 스크립트는 합쳐지지 않습니다.';
$lang->jquery_version = 'jQuery 버전';
$lang->about_jquery_version = '기본으로 사용할 jQuery 버전을 선택합니다. jQuery 3.x는 오래된 기능과 호환되지 않을 수 있습니다.';
$lang->use_server_push = 'Server Push 사용';
$lang->about_use_server_push = '일부 CDN에서 지원하는 기능으로, 미리 로딩할 스크립트 정보를 헤더에 추가합니다.';
$lang->use_gzip = 'gzip 압축';
$lang->about_use_gzip = '웹서버가 gzip을 지원하지 않더라도 페이지를 강제로 압축하는 기능입니다. 대부분의 서버에는 필요하지 않습니다.';
$lang->delay_session = '세션 시작 지연';
$lang->about_delay_session = 'Varnish 등의 프록시 캐싱 서버 사용시 성능 개선을 위해, 로그인하지 않은 사용자에게는 인증 세션을 부여하지 않습니다.<br>이 옵션을 사용하면 자동 로그인이 되지 않으며, 방문자 수 집계가 정확하게 이루어지지 않을 수 있습니다.';
$lang->mediafilter_whitelist = '외부 멀티미디어 허용';

View file

@ -208,11 +208,22 @@
<p class="x_help-block">{$lang->about_concat_scripts}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->jquery_version}</label>
<div class="x_controls">
<label for="jquery_version_2" class="x_inline"><input type="radio" name="jquery_version" id="jquery_version_2" value="2" checked="checked"|cond="$jquery_version !== 3" /> jQuery {HTMLDisplayHandler::JQUERY_V2}</label>
<label for="jquery_version_3" class="x_inline"><input type="radio" name="jquery_version" id="jquery_version_3" value="3" checked="checked"|cond="$jquery_version === 3" /> jQuery {HTMLDisplayHandler::JQUERY_V3}</label>
<br />
<p class="x_help-block">{$lang->about_jquery_version}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->use_server_push}</label>
<div class="x_controls">
<label for="use_server_push_y" class="x_inline"><input type="radio" name="use_server_push" id="use_server_push_y" value="Y" checked="checked"|cond="$use_server_push" /> {$lang->cmd_yes}</label>
<label for="use_server_push_n" class="x_inline"><input type="radio" name="use_server_push" id="use_server_push_n" value="N" checked="checked"|cond="!$use_server_push" /> {$lang->cmd_no}</label>
<br />
<p class="x_help-block">{$lang->about_use_server_push}</p>
</div>
</div>
<div class="x_control-group">
@ -220,6 +231,8 @@
<div class="x_controls">
<label for="use_gzip_y" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_y" value="Y" checked="checked"|cond="$use_gzip" /> {$lang->cmd_yes}</label>
<label for="use_gzip_n" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_n" value="N" checked="checked"|cond="!$use_gzip" /> {$lang->cmd_no}</label>
<br />
<p class="x_help-block">{$lang->about_use_gzip}</p>
</div>
</div>
<div class="x_clearfix btnArea">