Removed jQuery from almost all pages
jQuery has been removed from all pages, except those who really require it (like autocomplete in link edition). Immediate gain: All pages weight 286 kb LESS ! \o/ Highlighting in search results has also been temporarly removed (and will be re-implemented).
This commit is contained in:
parent
af77b2fd9a
commit
246e9b4e37
7 changed files with 25 additions and 134 deletions
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<head>{include="includes"}
|
||||
{if="empty($GLOBALS['disablejquery'])"}<script src="inc/jquery.min.js#"></script><script src="inc/jquery-ui.min.js#"></script>{/if}
|
||||
</head>
|
||||
<body onload="document.changetag.fromtag.focus();">
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
|
@ -12,5 +14,13 @@
|
|||
<script language="JavaScript">function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script>
|
||||
</div>
|
||||
{include="page.footer"}
|
||||
{if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<head>{include="includes"}
|
||||
{if="empty($GLOBALS['disablejquery'])"}<script src="inc/jquery.min.js#"></script><script src="inc/jquery-ui.min.js#"></script>{/if}
|
||||
</head>
|
||||
<body
|
||||
{if condition="$link.title==''"}onload="document.linkform.lf_title.focus();"
|
||||
{elseif condition="$link.description==''"}onload="document.linkform.lf_description.focus();"
|
||||
|
@ -30,5 +32,13 @@
|
|||
</div>
|
||||
</div>
|
||||
{include="page.footer"}
|
||||
{if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
</body>
|
||||
</html>
|
|
@ -7,4 +7,3 @@
|
|||
<link href="images/favicon.ico#" rel="shortcut icon" type="image/x-icon" />
|
||||
<link type="text/css" rel="stylesheet" href="inc/shaarli.css?version={$version|urlencode}#" />
|
||||
{if condition="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version}#" />{/if}
|
||||
{if="empty($GLOBALS['disablejquery'])"}<script src="inc/jquery.min.js#"></script><script src="inc/jquery-ui.min.js#"></script>{/if}
|
||||
|
|
|
@ -68,7 +68,6 @@
|
|||
{include="page.footer"}
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
// Remove any displayed QR-Code
|
||||
function remove_qrcode()
|
||||
{
|
||||
|
|
|
@ -7,24 +7,3 @@
|
|||
{if="isLoggedIn()"}
|
||||
<script language="JavaScript">function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
|
||||
{/if}
|
||||
|
||||
{if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1});
|
||||
$('#searchtags').autocomplete({source:'{$source}?ws=tags',minLength:1});
|
||||
$('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if="empty($GLOBALS['disablejquery']) && isset($_GET['searchterm'])"}
|
||||
<script src="inc/jquery.highlight.js#"></script>
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#linklist li').highlight("{$search_crits}");
|
||||
});
|
||||
</script>
|
||||
{/if}
|
|
@ -2,7 +2,9 @@
|
|||
<html>
|
||||
<head>{include="includes"}
|
||||
{if="empty($GLOBALS['disablejquery'])"}
|
||||
<script src="inc/jquery.lazyload.min.js#"></script>
|
||||
<script src="inc/jquery.min.js#"></script>
|
||||
<script src="inc/jquery-ui.min.js#"></script>
|
||||
<script src="inc/jquery.lazyload.min.js#"></script>
|
||||
{/if}
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue