Factorize scripts-2.0.js into utils.js

No need to include two different and super-small javascript "utils" files.
master
jvoisin 6 years ago committed by GitHub
parent f3b2c2ea7a
commit bf5f8cb713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/advancedSettings.jsp
  2. 1
      airsonic-main/src/main/webapp/WEB-INF/jsp/albumMain.jsp
  3. 1
      airsonic-main/src/main/webapp/WEB-INF/jsp/artistMain.jsp
  4. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/dlnaSettings.jsp
  5. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/generalSettings.jsp
  6. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/help.jsp
  7. 6
      airsonic-main/src/main/webapp/WEB-INF/jsp/left.jsp
  8. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/personalSettings.jsp
  9. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp
  10. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/playerSettings.jsp
  11. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/right.jsp
  12. 6
      airsonic-main/src/main/webapp/WEB-INF/jsp/starred.jsp
  13. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/userSettings.jsp
  14. 41
      airsonic-main/src/main/webapp/script/scripts-2.0.js
  15. 38
      airsonic-main/src/main/webapp/script/util.js

@ -4,7 +4,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
<script type="text/javascript" language="javascript">
function enableLdapFields() {
$("#ldap").is(":checked") ? $("#ldapTable").show() : $("#ldapTable").hide();

@ -5,7 +5,6 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/starService.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/playlistService.js"/>"></script>

@ -24,7 +24,6 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value='/dwr/util.js'/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/starService.js"/>"></script>

@ -21,7 +21,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
</head>
<body class="mainframe bgcolor1">

@ -4,7 +4,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
</head>
<body class="mainframe bgcolor1">

@ -3,7 +3,7 @@
<html><head>
<%@ include file="head.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
</head>
<body class="mainframe bgcolor1">

@ -3,7 +3,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/util.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/playlistService.js"/>"></script>
<script type="text/javascript" language="javascript">
@ -111,8 +111,8 @@
<div id="playlists"></div>
<div id="playlistOverflow" style="display:none"></div>
<div style="padding-top: 0.3em"></div>
<div class="forward" id="showAllPlaylists" style="display: none"><a href="javascript:noop()" onclick="showAllPlaylists()"><fmt:message key="left.showallplaylists"/></a></div>
<div class="forward"><a href="javascript:noop()" onclick="createEmptyPlaylist()"><fmt:message key="left.createplaylist"/></a></div>
<div class="forward" id="showAllPlaylists" style="display: none"><a href="#" onclick="showAllPlaylists()"><fmt:message key="left.showallplaylists"/></a></div>
<div class="forward"><a href="#" onclick="createEmptyPlaylist()"><fmt:message key="left.createplaylist"/></a></div>
<div class="forward"><a href="importPlaylist.view" target="main"><fmt:message key="left.importplaylist"/></a></div>
</div>

@ -4,7 +4,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
<script type="text/javascript" language="javascript">
function enableLastFmFields() {

@ -3,7 +3,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/nowPlayingService.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/playQueueService.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/playlistService.js"/>"></script>

@ -4,7 +4,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
</head>
<body class="mainframe bgcolor1">
<script type="text/javascript" src="<c:url value="/script/wz_tooltip.js"/>"></script>

@ -7,7 +7,7 @@
<script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/util.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/nowPlayingService.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
<script type="text/javascript">

@ -3,7 +3,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/util.js"/>"></script>
<script type="text/javascript" src="<c:url value='/dwr/util.js'/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/starService.js"/>"></script>
@ -143,10 +143,10 @@
</table>
<div class="forward" style="float:left;padding-right:1.5em">
<a href="javascript:noop()" onclick="onSavePlaylist()"><fmt:message key="playlist.save"/></a>
<a href="#" onclick="onSavePlaylist()"><fmt:message key="playlist.save"/></a>
</div>
<div class="forward" style="float: left">
<a href="javascript:noop()" onclick="onPlayAll()"><fmt:message key="main.playall"/></a>
<a href="#" onclick="onPlayAll()"><fmt:message key="main.playall"/></a>
</div>
<div style="clear: both"></div>

@ -4,7 +4,7 @@
<html><head>
<%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/utils.js"/>"></script>
<script type="text/javascript">
function init() {
enablePasswordChangeFields();

@ -1,41 +0,0 @@
//
// REMEMBER TO UPDATE VERSION WHEN CHANGING THIS SCRIPT, IN ORDER FOR BROWSERS TO REFRESH IT.
//
var entityMap = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
function escapeHtml(string) {
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}
function noop() {
}
function popup(mylink, windowname) {
return popupSize(mylink, windowname, 400, 200);
}
function popupSize(mylink, windowname, width, height) {
var href;
if (typeof(mylink) == "string") {
href = mylink;
} else {
href = mylink.href;
}
var w = window.open(href, windowname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes");
w.focus();
w.moveTo(300, 200);
return false;
}

@ -1,10 +1,42 @@
var entityMap = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
function escapeHtml(string) {
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}
function popup(mylink, windowname) {
return popupSize(mylink, windowname, 400, 200);
}
function popupSize(mylink, windowname, width, height) {
var href;
if (typeof(mylink) == "string") {
href = mylink;
} else {
href = mylink.href;
}
var w = window.open(href, windowname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes");
w.focus();
w.moveTo(300, 200);
return false;
}
function updateQueryStringParameter(uri, key, value) {
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
}
else {
} else {
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
return uri + separator + key + "=" + value;
}
}

Loading…
Cancel
Save