2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
header('Content-Type: text/javascript');
|
2009-10-03 23:52:30 +02:00
|
|
|
require_once '../src/SemanticScuttle/header.php';
|
2009-10-27 21:35:11 +01:00
|
|
|
require_once 'SemanticScuttle/functions.php';
|
2008-11-21 11:44:28 +01:00
|
|
|
$player_root = ROOT .'includes/player/';
|
2007-12-12 17:29:16 +01:00
|
|
|
?>
|
|
|
|
|
|
|
|
function _playerAdd(anchor) {
|
|
|
|
var url = anchor.href;
|
|
|
|
var code = '<object type="application/x-shockwave-flash" data="<?php echo $player_root ?>musicplayer_f6.swf?song_url=' + url +'&b_bgcolor=ffffff&b_fgcolor=000000&b_colors=0000ff,0000ff,ff0000,ff0000&buttons=<?php echo $player_root ?>load.swf,<?php echo $player_root ?>play.swf,<?php echo $player_root ?>stop.swf,<?php echo $player_root ?>error.swf" width="14" height="14">';
|
|
|
|
var code = code + '<param name="movie" value="<?php echo $player_root ?>musicplayer.swf?song_url=' + url +'&b_bgcolor=ffffff&b_fgcolor=000000&b_colors=0000ff,0000ff,ff0000,ff0000&buttons=<?php echo $player_root ?>load.swf,<?php echo $player_root ?>play.swf,<?php echo $player_root ?>stop.swf,<?php echo $player_root ?>error.swf" />';
|
|
|
|
var code = code + '</object>';
|
|
|
|
anchor.parentNode.innerHTML = code +' '+ anchor.parentNode.innerHTML;
|
|
|
|
}
|
|
|
|
|
|
|
|
String.prototype.trim = function() {
|
|
|
|
return this.replace(/^\s+|\s+$/g, '');
|
|
|
|
};
|
|
|
|
|
|
|
|
var deleted = false;
|
|
|
|
function deleteBookmark(ele, input){
|
|
|
|
var confirmDelete = "<span><?php echo T_('Are you sure?') ?> <a href=\"#\" onclick=\"deleteConfirmed(this, " + input + ", \'\'); return false;\"><?php echo T_('Yes'); ?></a> - <a href=\"#\" onclick=\"deleteCancelled(this); return false;\"><?php echo T_('No'); ?></a></span>";
|
2008-11-17 13:11:05 +01:00
|
|
|
ele.style.display = 'none';
|
2007-12-12 17:29:16 +01:00
|
|
|
ele.parentNode.innerHTML = ele.parentNode.innerHTML + confirmDelete;
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteCancelled(ele) {
|
|
|
|
var del = previousElement(ele.parentNode);
|
|
|
|
del.style.display = 'inline';
|
|
|
|
ele.parentNode.parentNode.removeChild(ele.parentNode);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteConfirmed(ele, input, response) {
|
2009-02-05 17:37:36 +01:00
|
|
|
//if (deleted == false) {
|
2008-03-12 11:35:23 +01:00
|
|
|
deleted = ele.parentNode.parentNode.parentNode.parentNode;
|
2009-02-05 17:37:36 +01:00
|
|
|
//}
|
2007-12-12 17:29:16 +01:00
|
|
|
var post = deleted;
|
2008-11-17 13:11:05 +01:00
|
|
|
post.className = 'xfolkentry deleted';
|
2007-12-12 17:29:16 +01:00
|
|
|
if (response != '') {
|
|
|
|
post.style.display = 'none';
|
|
|
|
deleted = false;
|
|
|
|
} else {
|
2009-02-05 17:37:36 +01:00
|
|
|
loadXMLDoc('<?php echo ROOT; ?>ajaxDelete.php?id=' + input);
|
|
|
|
post.style.display = 'none';
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function previousElement(ele) {
|
|
|
|
ele = ele.previousSibling;
|
|
|
|
while (ele.nodeType != 1) {
|
|
|
|
ele = ele.previousSibling;
|
|
|
|
}
|
|
|
|
return ele;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isAvailable(input, response){
|
|
|
|
var usernameField = document.getElementById("username");
|
|
|
|
var username = usernameField.value;
|
|
|
|
username = username.toLowerCase();
|
|
|
|
username = username.trim();
|
|
|
|
var availability = document.getElementById("availability");
|
|
|
|
if (username != '') {
|
2008-11-21 11:44:28 +01:00
|
|
|
usernameField.style.backgroundImage = 'url(<?php echo ROOT; ?>images/loading.gif)';
|
2007-12-12 17:29:16 +01:00
|
|
|
if (response != '') {
|
|
|
|
usernameField.style.backgroundImage = 'none';
|
|
|
|
if (response == 'true') {
|
|
|
|
availability.className = 'available';
|
|
|
|
availability.innerHTML = '<?php echo T_('Available'); ?>';
|
|
|
|
} else {
|
|
|
|
availability.className = 'not-available';
|
|
|
|
availability.innerHTML = '<?php echo T_('Not Available'); ?>';
|
|
|
|
}
|
|
|
|
} else {
|
2008-11-21 11:44:28 +01:00
|
|
|
loadXMLDoc('<?php echo ROOT; ?>ajaxIsAvailable.php?username=' + username);
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function useAddress(ele) {
|
|
|
|
var address = ele.value;
|
|
|
|
if (address != '') {
|
|
|
|
if (address.indexOf(':') < 0) {
|
|
|
|
address = 'http:\/\/' + address;
|
|
|
|
}
|
|
|
|
getTitle(address, null);
|
|
|
|
ele.value = address;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTitle(input, response){
|
|
|
|
var title = document.getElementById('titleField');
|
|
|
|
if (title.value == '') {
|
2008-11-21 11:44:28 +01:00
|
|
|
title.style.backgroundImage = 'url(<?php echo ROOT; ?>images/loading.gif)';
|
2007-12-12 17:29:16 +01:00
|
|
|
if (response != null) {
|
|
|
|
title.style.backgroundImage = 'none';
|
|
|
|
title.value = response;
|
|
|
|
} else if (input.indexOf('http') > -1) {
|
2008-11-21 11:44:28 +01:00
|
|
|
loadXMLDoc('<?php echo ROOT; ?>ajaxGetTitle.php?url=' + input);
|
2007-12-12 17:29:16 +01:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var xmlhttp;
|
|
|
|
function loadXMLDoc(url) {
|
|
|
|
// Native
|
|
|
|
if (window.XMLHttpRequest) {
|
|
|
|
xmlhttp = new XMLHttpRequest();
|
|
|
|
xmlhttp.onreadystatechange = processStateChange;
|
|
|
|
xmlhttp.open("GET", url, true);
|
|
|
|
xmlhttp.send(null);
|
|
|
|
// ActiveX
|
|
|
|
} else if (window.ActiveXObject) {
|
|
|
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|
|
|
if (xmlhttp) {
|
|
|
|
xmlhttp.onreadystatechange = processStateChange;
|
|
|
|
xmlhttp.open("GET", url, true);
|
|
|
|
xmlhttp.send();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function processStateChange() {
|
|
|
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
2009-02-05 17:37:36 +01:00
|
|
|
response = xmlhttp.responseXML.documentElement;
|
2007-12-12 17:29:16 +01:00
|
|
|
method = response.getElementsByTagName('method')[0].firstChild.data;
|
|
|
|
result = response.getElementsByTagName('result')[0].firstChild.data;
|
|
|
|
eval(method + '(\'\', result)');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function playerLoad() {
|
|
|
|
var anchors = document.getElementsByTagName('a');
|
|
|
|
var anchors_length = anchors.length;
|
|
|
|
for (var i = 0; i < anchors_length; i++) {
|
|
|
|
if (anchors[i].className == 'taggedlink' && anchors[i].href.match(/\.mp3$/i)) {
|
|
|
|
_playerAdd(anchors[i]);
|
|
|
|
}
|
|
|
|
}
|
2008-03-12 11:35:23 +01:00
|
|
|
}
|
2009-01-12 14:45:49 +01:00
|
|
|
|
|
|
|
function addAnchor(anchorForm, where) {
|
|
|
|
var whereZone = document.getElementById(where);
|
|
|
|
whereZone.value = whereZone.value + anchorForm;
|
|
|
|
document.getElementById(where).focus();
|
|
|
|
}
|