Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added compiled plugin version

  • Loading branch information...
commit 6ecae4627d811008ac86a4bc2937a9b193cb3355 1 parent 0b9cab9
@Quimera authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  jquery.tasksplease.min.js
View
1  jquery.tasksplease.min.js
@@ -0,0 +1 @@
+(function(b){function h(e){var a=this,f;b.extend(a,{init:function(){a.setup()},create_task:function(d){var c=b("<li/>");c.text(d);c.append('<span class="remove">'+tp_i18n.delete_task+"</span>");a.delete_event(c.find(".remove"),c);f.append(c);return c},setup:function(){var d=[];f=b('<ul class="tasksplease"/>');var c=e.val();void 0!==c[0]&&(d=c.split("\n"));b.each(d,function(b,c){a.create_task(c,b)});a.container=b('<div class="tasksplease-container"/>');d=b('<textarea type="text" name="task-description" class="task-description" rows="1" placeholder="'+ tp_i18n.add_task+'"></textarea>');a.container.append(f).append(d).append('<input class="add_task" type="submit" value="'+tp_i18n.add+'"/>');e.after(a.container);a.add_new_event(a.container.find(".add_task"));e.hide()},add_new_event:function(d){b(d).click(function(c){var d=b(this).siblings(".task-description"),g=d.val();void 0!==g[0]&&(g=g.replace(/(\r\n|\n|\r)/gm," "),a.create_task(g),description_content=e.val()+"\n"+g,void 0===e.val()[0]&&(description_content=g),e.val(description_content),d.val("")); c.preventDefault()})},delete_event:function(a,c){b(a).click(function(a){var d=b(c).index();b(c).remove();var f=e.val().split("\n");f.splice(d,1);e.val(f.join("\n"));a.preventDefault()})},edit_event:function(a){b(a).click(function(a){a.preventDefault()})}});a.init()}b.fn.tasksplease=function(e){var a=this.data("tasksplease");if(a)return a;var f={sorteable:!0};e&&b.extend(f,e);return this.each(function(){a=new h(b(this),f);b(this).data("tasksplease",a)})}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.