aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Tasklist.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-15 21:26:28 -0700
committerzotlabs <mike@macgirvin.com>2017-03-15 21:26:28 -0700
commitf6b643e84ee1ce8b4e13f959e0d58804f4aabd3b (patch)
treec22cc6aee9776ef34940ab539c6fb7f7e80e45ec /Zotlabs/Widget/Tasklist.php
parent16d750d1f6cf0d2866388269e02445630c4e3464 (diff)
downloadvolse-hubzilla-f6b643e84ee1ce8b4e13f959e0d58804f4aabd3b.tar.gz
volse-hubzilla-f6b643e84ee1ce8b4e13f959e0d58804f4aabd3b.tar.bz2
volse-hubzilla-f6b643e84ee1ce8b4e13f959e0d58804f4aabd3b.zip
widgets cont.
Diffstat (limited to 'Zotlabs/Widget/Tasklist.php')
-rw-r--r--Zotlabs/Widget/Tasklist.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Tasklist.php b/Zotlabs/Widget/Tasklist.php
new file mode 100644
index 000000000..6f7a8aaed
--- /dev/null
+++ b/Zotlabs/Widget/Tasklist.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Zotlabs\Widget;
+
+require_once('include/event.php');
+
+class Tasklist {
+
+ function widget($arr) {
+
+ if (! local_channel())
+ return;
+
+ $o .= '<script>var tasksShowAll = 0; $(document).ready(function() { tasksFetch(); $("#tasklist-new-form").submit(function(event) { event.preventDefault(); $.post( "tasks/new", $("#tasklist-new-form").serialize(), function(data) { tasksFetch(); $("#tasklist-new-summary").val(""); } ); return false; } )});</script>';
+ $o .= '<script>function taskComplete(id) { $.post("tasks/complete/"+id, function(data) { tasksFetch();}); }
+ function tasksFetch() {
+ $.get("tasks/fetch" + ((tasksShowAll) ? "/all" : ""), function(data) {
+ $(".tasklist-tasks").html(data.html);
+ });
+ }
+ </script>';
+
+ $o .= '<div class="widget">' . '<h3>' . t('Tasks') . '</h3><div class="tasklist-tasks">';
+ $o .= '</div><form id="tasklist-new-form" action="" ><input id="tasklist-new-summary" type="text" name="summary" value="" /></form>';
+ $o .= '</div>';
+ return $o;
+
+ }
+}
+