Skip to content

Commit

Permalink
fix #2145 common.js 등을 임의로 로드하는 경우 스크립트 충돌 및 모바일에서 URI.js 등의 파일이 누락된 …
Browse files Browse the repository at this point in the history
…문제 고침
  • Loading branch information
bnu committed Sep 12, 2017
1 parent 78ace2f commit c466ed0
Show file tree
Hide file tree
Showing 3 changed files with 909 additions and 894 deletions.
78 changes: 40 additions & 38 deletions classes/display/HTMLDisplayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,39 +389,39 @@ function _loadJSCSS()
// add common JS/CSS files
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/URI.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/blankshield.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -1110000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -1100000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/URI.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/blankshield.min.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -1000000), true);
if(!__DISABLE_DEFAULT_CSS__)
{
$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/xe.css', '', '', -10000000), true);
}
else
{
$oContext->unloadFile(array('./common/css/xe.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/xe.css', '', '', -10000000), true);
}
}
else
{
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -1110000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -1100000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -1000000), true);
if(!__DISABLE_DEFAULT_CSS__)
{
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -10000000), true);
}
else
{
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -10000000), true);
}
}

Expand Down Expand Up @@ -462,39 +462,41 @@ private function _loadMobileJSCSS()
// add common JS/CSS files
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -1100000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/URI.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/blankshield.min.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -1000000), true);
if(!__DISABLE_DEFAULT_CSS__)
{
$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/xe.css', '', '', -10000000), true);
$oContext->loadFile(array('./common/css/mobile.css', '', '', -10000000), true);
}
else
{
$oContext->unloadFile(array('./common/css/xe.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/mobile.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/xe.css', '', '', -10000000), true);
$oContext->unloadFile(array('./common/css/mobile.css', '', '', -10000000), true);
}
}
else
{
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -1100000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -1000000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -1000000), true);
if(!__DISABLE_DEFAULT_CSS__)
{
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -10000000), true);
$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -10000000), true);
}
else
{
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -10000000), true);
$oContext->unloadFile(array('./common/css/mobile.min.css', '', '', -10000000), true);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions classes/frontendfile/FrontEndFileHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ function getCssFileList()
*/
function getJsFileList($type = 'head')
{

$ignore = array('modernizr.js', 'common.js', 'js_app.js', 'xml2json.js', 'xml_handler.js', 'xml_js_filter.js');

if($type == 'head')
{
$map = &$this->jsHeadMap;
Expand All @@ -330,6 +333,14 @@ function getJsFileList($type = 'head')
{
foreach($indexedMap as $file)
{
if((!__DEBUG__ && __XE_VERSION_STABLE__) && $file->filePath === '/common/js')
{
if(in_array($file->fileName, $ignore))
{
continue;
}
}

$query = '';
if(!$file->external && is_readable($file->cdnPath . '/' . $file->fileName))
{
Expand Down
Loading

0 comments on commit c466ed0

Please sign in to comment.