jQuery Sticky Notes

88 views
Skip to first unread message

fory

unread,
Mar 19, 2010, 3:32:30 PM3/19/10
to jQuery Sticky Notes
Hi guys,
I'm trying to add this Sticky Notes into a mysql DB when i create a
notes and then read them form DB.
The problem is that i can't get that text from Sticky Notes
textareea..

My script look like this:

$.fn.stickynote.createNote = function(o) {

var _note_content = $(document.createElement('textarea'))

var _div_note = $(document.createElement('div'))
.addClass('jStickyNote')
.css('cursor','move');
if(!o.text){
_div_note.append(_note_content);
var _div_create = $(document.createElement('div'))
.addClass('jSticky-create')
.attr({ title: 'Create Sticky Note'});


_div_create.click(function(e){
var _p_note_text = $(document.createElement('p'))
.css('color',o.color)
.html (
$(this)
.parent()
.find('textarea')
.val()
);
$(this)
.parent()
.find('textarea')
.before(_p_note_text)
.remove();

$(this).remove();
})
}
else

_div_note.append('<p style="color:'+o.color+'">'+o.text+'</
p>');

var _div_delete = $(document.createElement('div'))
.addClass('jSticky-delete');

_div_delete.click(function(e){
$(this).parent().remove();
})

var _div_wrap = $(document.createElement('div'))
.css({'position':'absolute','top':+o.top+'5px','left':+o.left
+'10px'})
.append(_div_note)
.append(_div_delete)
.append(_div_create);
switch(o.size){
case 'large':
_div_wrap.addClass('jSticky-large');
break;
case 'small':
_div_wrap.addClass('jSticky-medium');
break;
}
if(o.containment){
_div_wrap.draggable({ containment: '#'+o.containment , scroll:
false ,start: function(event, ui) {
if(o.ontop)
$(this).parent().append($(this));
}});
}
else{
_div_wrap.draggable({ scroll: false ,start: function(event, ui) {
if(o.ontop)
$(this).parent().append($(this));
}});
}
$('#content').append(_div_wrap);
};

Have anyone an idea?

The script that insert in DB is:

$.ajax({
type: "GET",
url: ('insert.php?text='+text),
cache : "false"
});

Reply all
Reply to author
Forward
0 new messages