mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-04 18:29:40 +02:00
some minor tweakage to make ajaxie stuff kind of work in IE
This commit is contained in:
parent
04cd880273
commit
ea624090bc
11 changed files with 3369 additions and 48 deletions
|
@ -98,20 +98,3 @@ function popup_art(url) {
|
|||
newwindow=window.open(url, "ampache_art", "menubar=no,toolbar=no,location=no,directories=no");
|
||||
if (window.focus) {newwindow.focus()}
|
||||
}
|
||||
|
||||
// function needed for IE. attaches mouseover/out events to give/remove css class .sfhover (fake hover)
|
||||
sfHover = function(navlist) {
|
||||
var sfEls = document.getElementById("navlist").getElementsByTagName("LI");
|
||||
for (var i=0; i <sfEls.length; i++) {
|
||||
sfEls[i].onmouseover=function() {
|
||||
this.className+=" sfhover";
|
||||
}
|
||||
sfEls[i].onmouseout=function() {
|
||||
this.className=this.className.replace(new RegExp("sfhover\\b"), "");
|
||||
}
|
||||
} // end for
|
||||
} // end function for sfHover
|
||||
|
||||
if (window.attachEvent) window.attachEvent("onload", sfHover);
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ function show_rating_static($object_id,$type) {
|
|||
|
||||
$rating = new Rating($object_id,$type);
|
||||
|
||||
include(conf('prefix') . '/templates/show_object_rating_static.inc.php');
|
||||
require Config::get('prefix') . '/templates/show_object_rating_static.inc.php';
|
||||
|
||||
} // show_rating_static
|
||||
|
||||
|
|
|
@ -33,8 +33,12 @@
|
|||
var data = http_request.responseXML;
|
||||
var newContent = http_request.responseXML.getElementsByTagName('content');
|
||||
|
||||
|
||||
for(var i=0; i < newContent.length; i++) {
|
||||
document.getElementById(newContent[i].getAttribute('div')).innerHTML=newContent[i].firstChild.nodeValue;
|
||||
var newID = newContent[i].getAttribute('div');
|
||||
if (document.getElementById(newID)) {
|
||||
$(newID).update(newContent[i].firstChild.nodeValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -75,3 +79,4 @@
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
|
3271
modules/prototype/prototype.js
vendored
Normal file
3271
modules/prototype/prototype.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
@ -36,6 +36,45 @@ header("Cache-Control: no-store, no-cache, must-revalidate");
|
|||
header("Pragma: no-cache");
|
||||
|
||||
switch ($action) {
|
||||
/* Controls the editing of objects */
|
||||
case 'show_edit_object':
|
||||
switch ($_GET['type']) {
|
||||
case 'album':
|
||||
$key = 'album_' . $_GET['id'];
|
||||
$album = new Album($_GET['id']);
|
||||
$album->format();
|
||||
break;
|
||||
default:
|
||||
// Bad type
|
||||
die;
|
||||
break;
|
||||
} // end switch on type
|
||||
|
||||
ob_start();
|
||||
require Config::get('prefix') . '/templates/show_edit_' . $_GET['type'] . '_row.inc.php';
|
||||
$results[$key] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
echo xml_from_array($results);
|
||||
break;
|
||||
case 'edit_object':
|
||||
switch ($_POST['type']) {
|
||||
case 'album':
|
||||
$key = 'album_' . $_POST['id'];
|
||||
$album = new Album($_POST['id']);
|
||||
$album->format();
|
||||
break;
|
||||
default:
|
||||
// Bad type
|
||||
die;
|
||||
break;
|
||||
} // end switch on type
|
||||
|
||||
ob_start();
|
||||
require Config::get('prefix') . '/templates/show_' . $_POST['type'] . '_row.inc.php';
|
||||
$results[$key] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
echo xml_from_array($results);
|
||||
break;
|
||||
/* Controls Localplay */
|
||||
case 'localplay':
|
||||
$localplay = init_localplay();
|
||||
|
|
|
@ -49,6 +49,7 @@ if (Config::get('use_rss')) { ?>
|
|||
<body>
|
||||
<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
|
||||
<div id="3514" style="display:none;"></div>
|
||||
<div id="maincontainer" <?php
|
||||
if ($GLOBALS['theme']['orientation'] == 'horizontal') {
|
||||
|
|
43
templates/show_album_row.inc.php
Normal file
43
templates/show_album_row.inc.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/*
|
||||
|
||||
Copyright (c) 2001 - 2007 Ampache.org
|
||||
All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License v2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
?>
|
||||
<td>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=album&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('add','',_('Add')); ?>
|
||||
</span>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=album_random&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('random','',_('Random')); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo $album->f_name_link; ?></td>
|
||||
<td><?php echo $album->f_artist; ?></td>
|
||||
<td><?php echo $album->song_count; ?></td>
|
||||
<td><?php echo $album->year; ?></td>
|
||||
<td>
|
||||
<?php if (Access::check_function('batch_download')) { ?>
|
||||
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&id=<?php echo $album->id; ?>">
|
||||
<?php echo get_user_icon('batch_download','',_('Batch Download')); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=show_edit_object&type=album&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('edit','',_('Edit')); ?>
|
||||
</span>
|
||||
</td>
|
|
@ -41,28 +41,7 @@ $ajax_url = Config::get('ajax_url');
|
|||
$album->format();
|
||||
?>
|
||||
<tr id="album_<?php echo $album->id; ?>" class="<?php echo flip_class(); ?>">
|
||||
<td>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=album&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('add','',_('Add')); ?>
|
||||
</span>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=album_random&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('random','',_('Random')); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo $album->f_name_link; ?></td>
|
||||
<td><?php echo $album->f_artist; ?></td>
|
||||
<td><?php echo $album->song_count; ?></td>
|
||||
<td><?php echo $album->year; ?></td>
|
||||
<td>
|
||||
<?php if (Access::check_function('batch_download')) { ?>
|
||||
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&id=<?php echo $album->id; ?>">
|
||||
<?php echo get_user_icon('batch_download','',_('Batch Download')); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=album&type=edit&id=<?php echo $album->id; ?>');return true;" >
|
||||
<?php echo get_user_icon('edit','',_('Edit')); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php require Config::get('prefix') . '/templates/show_album_row.inc.php'; ?>
|
||||
</tr>
|
||||
<?php } //end foreach ($albums as $album) ?>
|
||||
</table>
|
||||
|
|
|
@ -28,7 +28,7 @@ $artist = scrub_out(truncate_with_ellipse($song->f_artist_full,'25'));
|
|||
<b><?php echo _('Song'); ?></b><br /><a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&song_id=<?php echo $song->id; ?>">
|
||||
<?php echo $title; ?>
|
||||
</a>
|
||||
<?php if(conf('ratings')) { ?>
|
||||
<?php if(Config::get('ratings')) { ?>
|
||||
<br /><?php show_rating($song->id,'song'); ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
*/
|
||||
|
||||
/* Create some variables we are going to need */
|
||||
$web_path = conf('web_path');
|
||||
$base_url = conf('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . conf('ajax_info');
|
||||
$web_path = Config::get('web_path');
|
||||
$base_url = Config::get('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id;
|
||||
|
||||
|
||||
//set the background to no stars
|
||||
|
|
|
@ -38,7 +38,7 @@ $web_path = Config::get('web_path');
|
|||
<?php } ?>
|
||||
</a><br>
|
||||
<?php
|
||||
if(conf('ratings')){
|
||||
if(Config::get('ratings')){
|
||||
echo "<div style=\"float:left; display:inline;\" id=\"rating_" . $album->id . "_album\">";
|
||||
show_rating_static($album->id, 'album');}
|
||||
echo "</div>";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue