mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-12-02 06:24:11 +01:00
Updated bookmark form
This commit is contained in:
parent
51a4119bea
commit
5a4a8af2f1
@ -15,11 +15,6 @@
|
|||||||
padding: 0.5ex;
|
padding: 0.5ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bookmarks_add {
|
|
||||||
display: none;
|
|
||||||
margin-top: 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmarks_list {
|
.bookmarks_list {
|
||||||
margin-top: 36px;
|
margin-top: 36px;
|
||||||
}
|
}
|
||||||
@ -35,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bookmarks_input {
|
.bookmarks_input {
|
||||||
width: 20em;
|
width: 8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bookmark_actions {
|
.bookmark_actions {
|
||||||
|
@ -3,11 +3,7 @@ var bookmarks_loading = false;
|
|||||||
|
|
||||||
var bookmarks_sorting = 'bookmarks_sorting_recent';
|
var bookmarks_sorting = 'bookmarks_sorting_recent';
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.bookmarks_addBtn').click(function(event){
|
|
||||||
$('.bookmarks_add').slideToggle();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#bookmark_add_submit').click(addOrEditBookmark);
|
$('#bookmark_add_submit').click(addOrEditBookmark);
|
||||||
$(window).scroll(updateOnBottom);
|
$(window).scroll(updateOnBottom);
|
||||||
|
|
||||||
@ -55,21 +51,14 @@ function addOrEditBookmark(event) {
|
|||||||
var title = encodeEntities($('#bookmark_add_title').val());
|
var title = encodeEntities($('#bookmark_add_title').val());
|
||||||
var tags = encodeEntities($('#bookmark_add_tags').val());
|
var tags = encodeEntities($('#bookmark_add_tags').val());
|
||||||
var taglist = tags.split(' ');
|
var taglist = tags.split(' ');
|
||||||
var tagshtml = '';
|
|
||||||
$("#firstrun").hide();
|
$("#firstrun").hide();
|
||||||
|
|
||||||
for ( var i=0, len=taglist.length; i<len; ++i ){
|
|
||||||
tagshtml += '<a class="bookmark_tag" href="?tag=' + encodeURI(taglist[i]) + '">' + taglist[i] + '</a> ';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'ajax/addBookmark.php',
|
url: 'ajax/addBookmark.php',
|
||||||
data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
|
data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
|
||||||
success: function(response){
|
success: function(response){
|
||||||
var bookmark_id = response.data;
|
$('.bookmarks_input').val('');
|
||||||
$('.bookmarks_add').slideToggle();
|
|
||||||
$('.bookmarks_add').children('p').children('.bookmarks_input').val('');
|
|
||||||
$('.bookmarks_list').empty();
|
$('.bookmarks_list').empty();
|
||||||
bookmarks_page = 0;
|
bookmarks_page = 0;
|
||||||
getBookmarks();
|
getBookmarks();
|
||||||
@ -81,8 +70,7 @@ function addOrEditBookmark(event) {
|
|||||||
url: 'ajax/editBookmark.php',
|
url: 'ajax/editBookmark.php',
|
||||||
data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
|
data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
|
||||||
success: function(){
|
success: function(){
|
||||||
$('.bookmarks_add').slideToggle();
|
$('.bookmarks_input').val('');
|
||||||
$('.bookmarks_add').children('p').children('.bookmarks_input').val('');
|
|
||||||
$('#bookmark_add_id').val('0');
|
$('#bookmark_add_id').val('0');
|
||||||
$('.bookmarks_list').empty();
|
$('.bookmarks_list').empty();
|
||||||
bookmarks_page = 0;
|
bookmarks_page = 0;
|
||||||
|
@ -9,16 +9,11 @@
|
|||||||
?>
|
?>
|
||||||
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
|
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>
|
|
||||||
</div>
|
|
||||||
<div class="bookmarks_add">
|
|
||||||
<input type="hidden" id="bookmark_add_id" value="0" />
|
<input type="hidden" id="bookmark_add_id" value="0" />
|
||||||
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
|
<input type="text" id="bookmark_add_url" placeholder="<?php echo $l->t('Address'); ?>" class="bookmarks_input" />
|
||||||
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
|
<input type="text" id="bookmark_add_title" placeholder="<?php echo $l->t('Title'); ?>" class="bookmarks_input" />
|
||||||
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
|
<input type="text" id="bookmark_add_tags" placeholder="<?php echo $l->t('Tags'); ?>" class="bookmarks_input" />
|
||||||
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
|
<input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" />
|
||||||
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
|
|
||||||
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bookmarks_list">
|
<div class="bookmarks_list">
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user