bookmarks app seems to work now :)

This commit is contained in:
Georg Ehrke 2012-04-25 21:20:06 +02:00
parent 323b19a4a0
commit 1a913ac282
2 changed files with 6 additions and 6 deletions

View File

@ -30,6 +30,6 @@ $RUNTIME_NOSETUPFS=true;
OC_JSON::checkLoggedIn(); OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks'); OC_JSON::checkAppEnabled('bookmarks');
require_once('../bookmarksHelper.php'); require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
$id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']); $id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']);
OC_JSON::success(array('data' => $id)); OC_JSON::success(array('data' => $id));

View File

@ -20,7 +20,7 @@ function getBookmarks() {
} }
$.ajax({ $.ajax({
url: 'ajax/updateList.php', url: OC.filePath('bookmarks', 'ajax', 'updateList.php'),
data: 'tag=' + encodeURIComponent($('#bookmarkFilterTag').val()) + '&page=' + bookmarks_page + '&sort=' + bookmarks_sorting, data: 'tag=' + encodeURIComponent($('#bookmarkFilterTag').val()) + '&page=' + bookmarks_page + '&sort=' + bookmarks_sorting,
success: function(bookmarks){ success: function(bookmarks){
if (bookmarks.data.length) { if (bookmarks.data.length) {
@ -63,7 +63,7 @@ function addOrEditBookmark(event) {
if (id == 0) { if (id == 0) {
$.ajax({ $.ajax({
url: 'ajax/addBookmark.php', url: OC.filePath('bookmarks', 'ajax', 'addBookmark.php'),
data: 'url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags), data: 'url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags),
success: function(response){ success: function(response){
$('.bookmarks_input').val(''); $('.bookmarks_input').val('');
@ -75,7 +75,7 @@ function addOrEditBookmark(event) {
} }
else { else {
$.ajax({ $.ajax({
url: 'ajax/editBookmark.php', url: OC.filePath('bookmarks', 'ajax', 'editBookmark.php'),
data: 'id=' + id + '&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags), data: 'id=' + id + '&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags),
success: function(){ success: function(){
$('.bookmarks_input').val(''); $('.bookmarks_input').val('');
@ -92,7 +92,7 @@ function addOrEditBookmark(event) {
function delBookmark(event) { function delBookmark(event) {
var record = $(this).parent().parent(); var record = $(this).parent().parent();
$.ajax({ $.ajax({
url: 'ajax/delBookmark.php', url: OC.filePath('bookmarks', 'ajax', 'delBookmark.php'),
data: 'url=' + encodeURIComponent($(this).parent().parent().children('.bookmark_url:first').text()), data: 'url=' + encodeURIComponent($(this).parent().parent().children('.bookmark_url:first').text()),
success: function(data){ success: function(data){
record.remove(); record.remove();
@ -164,7 +164,7 @@ function updateOnBottom() {
function recordClick(event) { function recordClick(event) {
$.ajax({ $.ajax({
url: 'ajax/recordClick.php', url: OC.filePath('bookmarks', 'ajax', 'recordClick.php'),
data: 'url=' + encodeURIComponent($(this).attr('href')), data: 'url=' + encodeURIComponent($(this).attr('href')),
}); });
} }