Skip to content
Browse files

dates and categories

  • Loading branch information...
1 parent 52c1799 commit 47c499e0465762658f0b55cbdb81d38e788cdd6d root committed
Showing with 48 additions and 5 deletions.
  1. +3 −0 index.jsp
  2. +5 −3 todo.css
  3. +14 −1 todo.js
  4. +26 −1 todo_list.txt
View
3 index.jsp
@@ -40,6 +40,9 @@
%></textarea>
</form>
+
+ <center>Powered by <a href="https://github.com/vitorpamplona/FreeToDo">FreeToDo</a></center>
+
<script>
var saveTimeout = null;
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
View
8 todo.css
@@ -1,3 +1,5 @@
-span.todo-people {color: #a0b;}
-span.todo-minus {color: #a22;}
-span.todo-plus {color: #2b2;}
+span.todo-people {color: #c79c60 }
+span.todo-urgent {color: #9a1f1b;}
+span.todo-plus {color: #c88900;}
+span.todo-date {color: #00681c;}
+span.todo-category {color: #5b10a0; }
View
15 todo.js
@@ -1,18 +1,31 @@
CodeMirror.defineMode("todo", function() {
return {
token: function(stream) {
+ if (stream.match(/^(jan|fev|mar|apr|may|jun|jul|ago|oct|nov|dec)+\s(\d)+/i)) {
+ return "todo-date";
+ }
+
var ch = stream.next();
+
+ // CATEGORY
+ if (ch == "*") {
+ //stream.skipToEnd();
+ while ((next = stream.peek()) != "@" && !stream.eol()) stream.next();
+ return "todo-category";
+ }
if (ch == "+") {
//stream.skipToEnd();
while ((next = stream.peek()) != "@" && !stream.eol()) stream.next();
return "todo-plus";
}
+
+
if (ch == "!") {
//stream.skipToEnd();
while ((next = stream.peek()) != "@" && !stream.eol()) stream.next();
- return "todo-minus";
+ return "todo-urgent";
}
if (ch == "@") {
View
27 todo_list.txt
@@ -1,12 +1,37 @@
+* Project 1
+
! Urgent Item: Talk to @Paulo
+ Teste @Vitor sadfa
-- Item One
+* Project 2
+
+- Item One teste due to Apr 22
- Item Two
+@Vitor this is cool..
+from @Abhi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

0 comments on commit 47c499e

Please sign in to comment.
Something went wrong with that request. Please try again.