diff options
author | Phie <phie@phie.ovh> | 2018-12-29 01:59:06 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2018-12-29 01:59:06 +0300 |
commit | 64900c0c262ab8cea5271be5cc8524ecfceed202 (patch) | |
tree | 1d0b65dc0b63e9f06dc1c00e5fc4fee649cdbff8 /templates | |
parent | 315f39f9170006505e9f96be8e0fe7f5a7485032 (diff) |
do not load jquery twice
Diffstat (limited to 'templates')
-rwxr-xr-x | templates/index.php | 3 | ||||
-rwxr-xr-x | templates/settings.php | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/templates/index.php b/templates/index.php index b3e1d8f..4795f16 100755 --- a/templates/index.php +++ b/templates/index.php @@ -18,7 +18,8 @@ $file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file); $file = preg_replace_callback('/<script(.*?)src=\"(.*?\.js(?:\?.*?)?)"/s',function ($matches) { global $currentpath; - + if($matches[2] === "libs/jquery.min.js") + return ""; return "<script".$matches[1]."src=\"".$matches[2]."?mtime=".filemtime($currentpath.$matches[2])."\""; }, $file); diff --git a/templates/settings.php b/templates/settings.php index 8b4f4fa..f54569d 100755 --- a/templates/settings.php +++ b/templates/settings.php @@ -13,6 +13,8 @@ $file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file); preg_match_all('/<script.*?src=\"(.*?\.js(?:\?.*?)?)"/si', $file, $matches, PREG_PATTERN_ORDER); for ($i = 0; $i < count($matches[1]); $i++) { + if($matches[1][$i] === "libs/jquery.min.js") + continue; script("carnet","../templates/CarnetElectron/".substr($matches[1][$i],0,-3)); } if($_['carnet_display_fullscreen']==="yes") |