Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- // Настройка Fancybox
- $("#add").fancybox({
- 'zoomSpeedIn' : 600,
- 'zoomSpeedOut' : 500,
- 'easingIn' : 'easeOutBack',
- 'easingOut' : 'easeInBack',
- 'hideOnContentClick': false,
- 'padding' : 15
- });
- $('.pr-title,.pr-body,.pr-performer').live('keyup',function(e){
- if(!this.preview)
- this.preview=$('#fancy_ajax .note');
- this.preview.find($(this).attr('class').replace('pr-','.')).html($(this).val().replace(/<[^>]+>/ig,''));
- });
- // Кнопка отправки
- $('#note-submit').live('click',function(e){
- if($('.pr-title').val().length<4){
- alert("Слишком короткий заголовок!")
- return false;
- }
- if($('.pr-body').val().length<4){
- alert("Слишком короткая задача!")
- return false;
- }
- if($('.pr-performer').val().length<1){
- alert("Не назначен исполнитель!")
- return false;
- }
- $(this).replaceWith('<img src="img/ajax_load.gif" style="margin:30px auto;display:block" />');
- var data = {
- 'title': $('.pr-title').val(),
- 'body': $('.pr-body').val(),
- 'performer': $('.pr-performer').val(),
- };
- $.post('app/post.php',data,function(msg){
- if(parseInt(msg)) {
- var tmp = $('#fancy_ajax .note').clone();
- tmp.appendTo($('#all'));
- make_draggable(tmp)
- }
- $("#add").fancybox.close();
- });
- e.preventDefault();
- })
- $('.note-form').live('submit',function(e){e.preventDefault();});
- $("#dell").click(function(){
- var self = this;
- var id = $(self).data("id");
- $.ajax({
- url:"index.php",
- data:"delete="+id;
- success:function(result){
- $(self).parent().fadeOut();
- }
- });
- });
- });
- function make_draggable(elements){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement