summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-11 13:29:22 +0200
committerJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-11 13:29:22 +0200
commitb4e89871dd845ecff3d7207ecbf1132fb1cde23b (patch)
tree6ac74dbb87fbbd811aefd48afbf83234b792a05d /apps
parente1bde1a78eac82f981358e68af031d974ca81639 (diff)
parent592eacf37d7b845499ddce65b15fa86791cb3eae (diff)
downloadnextcloud-server-b4e89871dd845ecff3d7207ecbf1132fb1cde23b.tar.gz
nextcloud-server-b4e89871dd845ecff3d7207ecbf1132fb1cde23b.zip
merged master into sharing
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/carddav.php4
-rw-r--r--apps/contacts/js/interface.js30
-rw-r--r--apps/contacts/lib/addressbook.php4
-rw-r--r--apps/contacts/templates/index.php6
-rw-r--r--apps/files_publiclink/js/admin.js4
-rw-r--r--apps/files_publiclink/templates/admin.php14
-rw-r--r--apps/files_publiclink/templates/breadcrumb.php4
-rw-r--r--apps/files_publiclink/templates/files.php9
-rw-r--r--apps/files_publiclink/templates/index.php17
-rw-r--r--apps/media/css/music.css8
-rw-r--r--apps/media/js/player.js6
-rw-r--r--apps/media/js/playlist.js124
-rw-r--r--apps/media/templates/music.php27
13 files changed, 56 insertions, 201 deletions
diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php
index 581bf4a717b..77b3c105deb 100644
--- a/apps/contacts/carddav.php
+++ b/apps/contacts/carddav.php
@@ -32,8 +32,8 @@ $carddavBackend = new OC_Connector_Sabre_CardDAV();
// Root nodes
$nodes = array(
- new Sabre_DAVACL_PrincipalCollection($principalBackend),
- new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend),
+ new Sabre_DAVACL_PrincipalCollection($principalBackend),
+ new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend),
);
// Fire up server
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js
index bab71eec422..ef2179b372b 100644
--- a/apps/contacts/js/interface.js
+++ b/apps/contacts/js/interface.js
@@ -4,12 +4,12 @@ $(document).ready(function(){
return false;
});*/
- $('#contacts_contacts li').live('click',function(){
+ $('#leftcontent li').live('click',function(){
var id = $(this).data('id');
$.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
- $('#contacts_details').data('id',jsondata.data.id);
- $('#contacts_details').html(jsondata.data.page);
+ $('#rightcontent').data('id',jsondata.data.id);
+ $('#rightcontent').html(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@@ -19,12 +19,12 @@ $(document).ready(function(){
});
$('#contacts_deletecard').live('click',function(){
- var id = $('#contacts_details').data('id');
+ var id = $('#rightcontent').data('id');
$.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
- $('#contacts_contacts [data-id="'+jsondata.data.id+'"]').remove();
- $('#contacts_details').data('id','');
- $('#contacts_details').html('');
+ $('#leftcontent [data-id="'+jsondata.data.id+'"]').remove();
+ $('#rightcontent').data('id','');
+ $('#rightcontent').html('');
}
else{
alert(jsondata.data.message);
@@ -34,10 +34,10 @@ $(document).ready(function(){
});
$('#contacts_addproperty').live('click',function(){
- var id = $('#contacts_details').data('id');
+ var id = $('#rightcontent').data('id');
$.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
- $('#contacts_details').append(jsondata.data.page);
+ $('#rightcontent').append(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@@ -79,8 +79,8 @@ $(document).ready(function(){
$('#contacts_newcontact').click(function(){
$.getJSON('ajax/showaddcard.php',{},function(jsondata){
if(jsondata.status == 'success'){
- $('#contacts_details').data('id','');
- $('#contacts_details').html(jsondata.data.page);
+ $('#rightcontent').data('id','');
+ $('#rightcontent').html(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@@ -92,8 +92,8 @@ $(document).ready(function(){
$('#contacts_addcardform input[type="submit"]').live('click',function(){
$.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){
if(jsondata.status == 'success'){
- $('#contacts_details').data('id',jsondata.data.id);
- $('#contacts_details').html(jsondata.data.page);
+ $('#rightcontent').data('id',jsondata.data.id);
+ $('#rightcontent').html(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@@ -103,7 +103,7 @@ $(document).ready(function(){
});
$('.contacts_property [data-use="edit"]').live('click',function(){
- var id = $('#contacts_details').data('id');
+ var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
@@ -129,7 +129,7 @@ $(document).ready(function(){
});
$('.contacts_property [data-use="delete"]').live('click',function(){
- var id = $('#contacts_details').data('id');
+ var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 8b91cdbd6f5..bab260840d9 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -120,10 +120,10 @@ class OC_Contacts_Addressbook{
}
public static function deleteAddressbook($id){
- $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' );
+ $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' );
$stmt->execute(array($id));
- $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE addressbookid = ?' );
+ $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ?' );
$stmt->execute(array($id));
return true;
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index ea76621674a..ffcca50b34d 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -3,15 +3,15 @@ OC_Util::addScript('contacts','interface');
OC_Util::addStyle('contacts','styles');
?>
-<div id="contacts_contacts" class="leftcontent">
+<div id="leftcontent" class="leftcontent">
<ul>
<?php echo $this->inc("part.contacts"); ?>
</ul>
<a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a>
</div>
-<div id="contacts_details" class="rightcontent" data-id="<?php echo $_['id']; ?>">
+<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
<?php echo $this->inc("part.details"); ?>
</div>
<?php if(count($_['addressbooks']) == 1 ): ?>
- <?php echo $l->t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.$_['addressbooks'][0]['uri'])); ?>
+ <?php echo $l->t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.OC_User::getUser().'/'.$_['addressbooks'][0]['uri'])); ?>
<?php endif; ?>
diff --git a/apps/files_publiclink/js/admin.js b/apps/files_publiclink/js/admin.js
index 20eae19c5d8..91ee58beda8 100644
--- a/apps/files_publiclink/js/admin.js
+++ b/apps/files_publiclink/js/admin.js
@@ -31,11 +31,13 @@ $(document).ready(function() {
if(token){
var html="<tr class='link' id='"+token+"'>";
html+="<td class='path'>"+path+"</td>";
- html+="<td class='link'><a href='get.php?token="+token+"'>"+$('#baseUrl').val()+"?token="+token+"</a></td>"
+ html+="<td class='link'><input type='text' value='"+$('#baseUrl').val()+"?token="+token+"' /></td>"
html+="<td><input type='submit' class='delete' data-token='"+token+" value='Delete' /></td>"
html+="</tr>"
$(html).insertAfter($('#newlink_row'));
$('#path').val('');
+ $('#'+token+' input').focus();
+ $('#'+token+' input').select();
}
}
});
diff --git a/apps/files_publiclink/templates/admin.php b/apps/files_publiclink/templates/admin.php
index 4608877e5b8..f6c92d5cb17 100644
--- a/apps/files_publiclink/templates/admin.php
+++ b/apps/files_publiclink/templates/admin.php
@@ -1,18 +1,20 @@
<input type="hidden" id="baseUrl" value="<?php echo $_['baseUrl'];?>"/>
<table id="linklist">
- <tbody>
+ <thead id="controls">
<tr id="newlink_row">
<form action="#" id="newlink">
<td class="path"><input placeholder="Path" id="path"/></td>
<td><input type="submit" value="Share" /></td>
</form>
</tr>
+ </thead>
+ <tbody>
<?php foreach($_['links'] as $link):?>
- <tr class="link" id="<?php echo $link['token'];?>">
- <td class="path"><?php echo $link['path'];?></td>
- <td class="link"><a href="get.php?token=<?php echo $link['token'];?>"><?php echo $_['baseUrl'];?>?token=<?php echo $link['token'];?></a></td>
- <td><input type="submit" class="delete" data-token="<?php echo $link['token'];?>" value="<?php echo $l->t( 'Delete' ); ?>" /></td>
- </tr>
+ <tr class="link" id="<?php echo $link['token'];?>">
+ <td class="path"><?php echo $link['path'];?></td>
+ <td class="link"><input type="text" value="<?php echo $_['baseUrl'];?>?token=<?php echo $link['token'];?>" /></td>
+ <td><input type="submit" class="delete" data-token="<?php echo $link['token'];?>" value="<?php echo $l->t( 'Delete' ); ?>" /></td>
+ </tr>
<?php endforeach;?>
</tbody>
</table>
diff --git a/apps/files_publiclink/templates/breadcrumb.php b/apps/files_publiclink/templates/breadcrumb.php
deleted file mode 100644
index 733531d9e10..00000000000
--- a/apps/files_publiclink/templates/breadcrumb.php
+++ /dev/null
@@ -1,4 +0,0 @@
- <a href="<?php echo link_to("files_publiclink", "get.php?token=".$_['token']); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root" /></a>
- <?php foreach($_["breadcrumb"] as $crumb): ?>
- <a href="<?php echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$crumb["dir"]); ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a>
- <?php endforeach; ?> \ No newline at end of file
diff --git a/apps/files_publiclink/templates/files.php b/apps/files_publiclink/templates/files.php
deleted file mode 100644
index 41ff0a1e765..00000000000
--- a/apps/files_publiclink/templates/files.php
+++ /dev/null
@@ -1,9 +0,0 @@
- <?php foreach($_["files"] as $file): ?>
- <tr>
- <td class="selection"><input type="checkbox" /></td>
- <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" href="<?php if($file["type"] == "dir") echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$file["directory"]."/".$file["name"]); else echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$file["directory"]."/".$file["name"]); ?>" title=""><?php echo htmlspecialchars($file["name"]); ?></a></td>
- <td class="filesize"><?php echo human_file_size($file["size"]); ?></td>
- <td class="date"><?php if($file["type"] != "dir") echo $file["date"]; ?></td>
- <td class="fileaction"><a href="" title="">▾</a></td>
- </tr>
- <?php endforeach; ?>
diff --git a/apps/files_publiclink/templates/index.php b/apps/files_publiclink/templates/index.php
deleted file mode 100644
index 759f3ad8772..00000000000
--- a/apps/files_publiclink/templates/index.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<p class="nav">
- <?php echo($_['breadcrumb']); ?>
-</p>
-<table cellspacing="0">
- <thead>
- <tr>
- <th><input type="checkbox" id="select_all" /></th>
- <th><?php echo $l->t( 'Name' ); ?></th>
- <th><?php echo $l->t( 'Size' ); ?></th>
- <th><?php echo $l->t( 'Modified' ); ?></th>
- <th></th>
- </tr>
- </thead>
- <tbody id="fileList">
- <?php echo($_['fileList']); ?>
- </tbody>
-</table> \ No newline at end of file
diff --git a/apps/media/css/music.css b/apps/media/css/music.css
index dd9b8ea70d9..c78ab200719 100644
--- a/apps/media/css/music.css
+++ b/apps/media/css/music.css
@@ -3,17 +3,13 @@
li button.right.prettybutton{font-size:1em;}
#collection{padding-top:1em;position:relative;width:70ex;float:left;}
#collection li.album,#collection li.song{margin-left:3ex;}
-#playlist{border-spacing:0;}
-#playlist th{background-color:#ccc; text-align:left; font-size:1.2em; padding:0.2em}
-#playlist tr.selected{background-color:#eee;}
-#playlist tr.current{background-color:#ccc;}
-#playlist td.time, #playlist th.time{text-align:right; padding-right:1em;}
+#leftcontent img.remove { display:none; float:right; cursor:pointer; }
+#leftcontent li:hover img.remove { display:inline; }
#collection li button{float:right;}
#collection li,#playlist li{list-style-type:none;}
.template{display:none}
#collection li{padding-right:10px;}
-img.remove{float:right;}
#searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;}
#collection tr.collapsed td.album, #collection tr.collapsed td.title{color:#ddd}
a.expander{float:right;display:block}
diff --git a/apps/media/js/player.js b/apps/media/js/player.js
index 4e1cc3cd754..8298db56e61 100644
--- a/apps/media/js/player.js
+++ b/apps/media/js/player.js
@@ -30,7 +30,7 @@ var PlayList={
if(PlayList.player){
if(PlayList.player.data('jPlayer').options.supplied!=PlayList.items[index].type){//the the audio type changes we need to reinitialize jplayer
PlayList.player.jPlayer("destroy");
- PlayList.init(PlayList.items[index].type,function(){PlayList.play(null,time,eady)});
+ PlayList.init(PlayList.items[index].type,function(){PlayList.play(null,time,ready)});
}else{
PlayList.player.jPlayer("setMedia", PlayList.items[PlayList.current]);
PlayList.items[index].playcount++;
@@ -73,7 +73,7 @@ var PlayList={
PlayList.render();
return false;
});
- PlayList.player=$('#jp-interface div.player');
+ PlayList.player=$('#controls div.player');
}
$(PlayList.player).jPlayer({
ended:PlayList.next,
@@ -91,7 +91,7 @@ var PlayList={
}
},
volume:PlayList.volume,
- cssSelectorAncestor:'#jp-interface',
+ cssSelectorAncestor:'#controls',
swfPath:OC.linkTo('media','js'),
});
},
diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js
index ad6c63a0333..778939db01c 100644
--- a/apps/media/js/playlist.js
+++ b/apps/media/js/playlist.js
@@ -2,49 +2,21 @@ PlayList.render=function(){
$('#playlist').show();
PlayList.parent.empty();
for(var i=0;i<PlayList.items.length;i++){
- var tr=PlayList.template.clone();
var item=PlayList.items[i];
- if(i==PlayList.current){
- tr.addClass('current');
- }
- tr.removeClass('template');
- tr.data('name',item.name);
- tr.data('artist',item.artist);
- tr.children('td.name').children('span').text(item.name);
- tr.children('td.artist').text(item.artist);
- tr.children('td.album').text(item.album);
- tr.data('index',i);
- tr.click(function(){
- PlayList.play($(this).data('index'));
- PlayList.render();
- });
- tr.hover(function(){
- var button=$('<img class="remove" title="'+t('media','Remove')+'"/>');
- button.attr('src',OC.imagePath('core','actions/delete'));
- $(this).children().last().append(button);
- button.click(function(event){
- event.stopPropagation();
- event.preventDefault();
- var index=$(this).parent().parent().data('index');
- PlayList.remove(index);
- });
- },function(){
- $(this).children().last().children('img.remove').remove();
- });
- tr.children('td.name').children('input').click(function(event){
+ var li=$('<li/>');
+ li.append(item.name);
+ var img=$('<img class="remove" src="'+OC.imagePath('core','actions/delete')+'"/>');
+ img.click(function(event){
event.stopPropagation();
- if($(this).attr('checked')){
- $(this).parent().parent().addClass('selected');
- if($('tbody td.name input:checkbox').length==$('tbody td.name input:checkbox:checked').length){
- $('#selectAll').attr('checked',true);
- }
- }else{
- $(this).parent().parent().removeClass('selected');
- $('#selectAll').attr('checked',false);
- }
- procesSelection();
+ PlayList.remove($(this).parent().data('index'));
+ });
+ li.click(function(event){
+ PlayList.play($(this).data('index'));
});
- PlayList.parent.append(tr);
+ li.append(img)
+ li.data('index',i);
+ li.addClass('song');
+ PlayList.parent.append(li);
}
}
PlayList.getSelected=function(){
@@ -55,78 +27,16 @@ PlayList.hide=function(){
}
$(document).ready(function(){
- PlayList.parent=$('#playlist tbody');
- PlayList.template=$('#playlist tr.template');
+ PlayList.parent=$('#leftcontent');
$('#selectAll').click(function(){
if($(this).attr('checked')){
// Check all
- $('tbody td.name input:checkbox').attr('checked', true);
- $('tbody td.name input:checkbox').parent().parent().addClass('selected');
+ $('#leftcontent li.song input:checkbox').attr('checked', true);
+ $('#leftcontent li.song input:checkbox').parent().addClass('selected');
}else{
// Uncheck all
- $('tbody td.name input:checkbox').attr('checked', false);
- $('tbody td.name input:checkbox').parent().parent().removeClass('selected');
+ $('#leftcontent li.song input:checkbox').attr('checked', false);
+ $('#leftcontent li.song input:checkbox').parent().removeClass('selected');
}
- procesSelection();
});
});
-
-function procesSelection(){
- var selected=PlayList.getSelected();
- if(selected.length==0){
- $('th.name span').text(t('media','Name'));
- $('th.artist').text(t('media','Artist'));
- $('th.album').text(t('media','Album'));
- $('th.time').text(t('media','Time'));
- $('th.plays').empty();
- $('th.plays').text(t('media','Plays'));
- }else{
- var name=selected.length+' '+t('media','selected');
- var artist=$(selected[0]).data('artist');
- var album=$(selected[0]).data('album');
- var time=$(selected[0]).data('time');
- var plays=$(selected[0]).data('plays');
- for(var i=1;i<selected.length;i++){
- var item=$(selected[i]);
- if(artist!='mixed' && item.data('artist')!==artist){
- artist='mixed'
- }
- if(album!='mixed' && item.data('album')!==album){
- album='mixed'
- }
- if(time!='mixed' && item.data('time')!==time){
- time='mixed'
- }
- if(plays!='mixed' && item.data('plays')!==plays){
- plays='mixed'
- }
- }
- $('th.name span').text(name);
- $('th.artist').text(artist);
- $('th.album').text(album);
- if(time!='mixed'){
- var secconds=(time%60);
- if(secconds<10){
- secconds='0'+secconds;
- }
- var time=Math.floor(time/60)+':'+secconds;
- }
- $('th.time').text(time);
- $('th.plays').text(plays);
- var button=$('<img class="remove" title="Remove"/>');
- button.attr('src',OC.imagePath('core','actions/delete'));
- $('th.plays').append(button);
- button.click(function(event){
- event.stopPropagation();
- event.preventDefault();
- PlayList.getSelected().each(function(index,element){
- var index=$(element).data('index');
- PlayList.items[index]=null;
- });
- PlayList.items=PlayList.items.filter(function(item){return item!==null});
- PlayList.render();
- PlayList.save();
- procesSelection();
- });
- }
-} \ No newline at end of file
diff --git a/apps/media/templates/music.php b/apps/media/templates/music.php
index d103e10b750..a89c5421b4a 100644
--- a/apps/media/templates/music.php
+++ b/apps/media/templates/music.php
@@ -20,32 +20,7 @@
<div class="player" id="jp-player"></div>
</div>
-<div id="leftcontent">
-<table id="playlist">
- <thead>
- <tr>
- <th class="name"><input id="selectAll" type="checkbox"><?php echo $l->t('Name')?></th>
- <th class="artist"><?php echo $l->t('Artist')?></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <?php echo $l->t('The playlist is empty')?>
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr class="template">
- <td class="name">
- <input type="checkbox">
- <span></span>
- </td>
- <td class="artist"></td>
- </tr>
- </tfoot>
-</table>
-</div>
+<ul id="leftcontent"></ul>
<div id="rightcontent">
<div id="scan">