mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +02:00
fixed up the playlist and the auto refresh with jquery
This commit is contained in:
parent
de35a43d54
commit
6b40e833ea
4 changed files with 34 additions and 22 deletions
|
@ -49,7 +49,12 @@ function ajaxState(url, input) {
|
||||||
// processContents
|
// processContents
|
||||||
// Iterate over a response and do any updates we received.
|
// Iterate over a response and do any updates we received.
|
||||||
function processContents(data, status) {
|
function processContents(data, status) {
|
||||||
$(data).find("content").each(function () {
|
$(data).find('content').each(function () {
|
||||||
$('#' + $(this).attr('div')).html($(this).text())
|
$('#' + $(this).attr('div')).html($(this).text())
|
||||||
|
var text = $.parseHTML($(this).text(), document, true);
|
||||||
|
var dom = $(text);
|
||||||
|
dom.filter('script').each(function(){
|
||||||
|
$.globalEval(this.text || this.textContent || this.innerHtml || '');
|
||||||
|
});
|
||||||
})
|
})
|
||||||
} // processContents
|
} // processContents
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//
|
//
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.default_hidden').hide();
|
||||||
|
});
|
||||||
|
|
||||||
// flipField
|
// flipField
|
||||||
// Toggles the disabled property on the specifed field
|
// Toggles the disabled property on the specifed field
|
||||||
|
@ -39,10 +42,10 @@ function updateText(field, value) {
|
||||||
// Toggles display type between block and none. Used for ajax loading div.
|
// Toggles display type between block and none. Used for ajax loading div.
|
||||||
function toggleVisible(element) {
|
function toggleVisible(element) {
|
||||||
var target = $('#' + element);
|
var target = $('#' + element);
|
||||||
if (target.is(':visible')) {
|
if (target.is(':visible')) {
|
||||||
target.hide();
|
target.hide();
|
||||||
} else {
|
} else {
|
||||||
target.show();
|
target.show();
|
||||||
}
|
}
|
||||||
} // toggleVisible
|
} // toggleVisible
|
||||||
|
|
||||||
|
@ -67,16 +70,7 @@ function delayRun(element, time, method, page, source) {
|
||||||
// IE issue fixed by Spocky, we have to use the iframe for Democratic Play &
|
// IE issue fixed by Spocky, we have to use the iframe for Democratic Play &
|
||||||
// Localplay, which don't actually prompt for a new file
|
// Localplay, which don't actually prompt for a new file
|
||||||
function reloadUtil(target) {
|
function reloadUtil(target) {
|
||||||
|
$('#util_iframe').prop('src', target);
|
||||||
if (navigator.appName == 'Opera') {
|
|
||||||
$('util_iframe').contentWindow.location.reload(true);
|
|
||||||
}
|
|
||||||
else if (navigator.appName == 'Konqueror') {
|
|
||||||
$('util_iframe').contentDocument.location.reload(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$('util_iframe').src = $('util_iframe').src;
|
|
||||||
}
|
|
||||||
} // reloadUtil
|
} // reloadUtil
|
||||||
|
|
||||||
// reloadRedirect
|
// reloadRedirect
|
||||||
|
@ -102,10 +96,21 @@ function check_inline_song_edit(type, song) {
|
||||||
|
|
||||||
// really should be using jquery ui and have something nice looking
|
// really should be using jquery ui and have something nice looking
|
||||||
function showAddTagDialog(id, type, path) {
|
function showAddTagDialog(id, type, path) {
|
||||||
var tagName = window.prompt('Enter Tag:', '');
|
$('#dialog_tag_item').dialog({
|
||||||
var url = path + '/server/ajax.server.php?page=tag&action=add_tag_by_name&type=' + type + '&object_id=' + id + '&tag_name=' + tagName;
|
modal: true,
|
||||||
if (tagName != null || tagName != '') {
|
buttons: [
|
||||||
ajaxPut(url);
|
{
|
||||||
}
|
text: 'ok',
|
||||||
|
click: function () {
|
||||||
|
var tagName = $('#dialog_tag_item_tag_name').val();
|
||||||
|
if (tagName != null || tagName != '') {
|
||||||
|
ajaxPut(path + '/server/ajax.server.php?page=tag&action=add_tag_by_name&type=' + type + '&object_id=' + id + '&tag_name=' + tagName);
|
||||||
|
}
|
||||||
|
$('#dialog_tag_item_tag_name').val('');
|
||||||
|
$(this).dialog('close');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ if (Config::get('use_rss')) { ?>
|
||||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=<?php echo Config::get('site_charset'); ?>" />
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=<?php echo Config::get('site_charset'); ?>" />
|
||||||
<title><?php echo scrub_out(Config::get('site_title')); ?> - <?php echo $location['title']; ?></title>
|
<title><?php echo scrub_out(Config::get('site_title')); ?> - <?php echo $location['title']; ?></title>
|
||||||
<?php require_once Config::get('prefix') . '/templates/stylesheets.inc.php'; ?>
|
<?php require_once Config::get('prefix') . '/templates/stylesheets.inc.php'; ?>
|
||||||
|
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/jquery/jquery-ui-1.10.3.min.css" type="text/css" media="screen" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="<?php echo $web_path; ?>/modules/jquery/jquery-1.9.1.js" language="javascript" type="text/javascript"></script>
|
<script src="<?php echo $web_path; ?>/modules/jquery/jquery-1.9.1.js" language="javascript" type="text/javascript"></script>
|
||||||
|
@ -48,6 +49,7 @@ if (Config::get('use_rss')) { ?>
|
||||||
<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script>
|
<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script>
|
||||||
<!-- rfc3514 implementation -->
|
<!-- rfc3514 implementation -->
|
||||||
<div id="rfc3514" style="display:none;">0x0</div>
|
<div id="rfc3514" style="display:none;">0x0</div>
|
||||||
|
<div id="dialog_tag_item" class="default_hidden"><span><?php echo T_('Enter tag:')?></span><br /><input type="text" id="dialog_tag_item_tag_name"/></div>
|
||||||
<div id="maincontainer">
|
<div id="maincontainer">
|
||||||
<div id="header"><!-- This is the header -->
|
<div id="header"><!-- This is the header -->
|
||||||
<h1 id="headerlogo">
|
<h1 id="headerlogo">
|
||||||
|
|
|
@ -31,6 +31,6 @@ function refresh()
|
||||||
<?php echo Ajax::action($ajax_url, ''); ?>;
|
<?php echo Ajax::action($ajax_url, ''); ?>;
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
window.setInterval(refresh(), refreshInterval);
|
window.setInterval(function(){refresh();}, refreshInterval * 1000);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue