diff --git a/public/js/tick.js b/public/js/tick.js index 1c4ee0f..54b2c8c 100644 --- a/public/js/tick.js +++ b/public/js/tick.js @@ -40,15 +40,14 @@ postList.items.forEach(function(el,i){ if(el.task !== runningList.items[i]) changes = true; - var match = el.task.match(/\*/g) - , currentItem = allItems[i]; + var currentItem = allItems[i]; - if( match && match.length == 1 ) + if( /^[^*]+[*]{1}[^*]*$/.test(el.task) ) { currentItem.removeAttribute('data-urgent') currentItem.innerText = currentItem.innerText.replace('*', '') } - else if( (match && match.length == 2) || (currentItem['data-urgent'] !== undefined)) + else if( /^[^*]+[*]{2}[^*]*$/.test(el.task) || (currentItem['data-urgent'] !== undefined)) { var attr = d.createAttribute('data-urgent'); attr.nodeValue = 'true'; diff --git a/public/ticklist.json b/public/ticklist.json index 179e13b..376d9a4 100644 --- a/public/ticklist.json +++ b/public/ticklist.json @@ -1 +1 @@ -{"items":[{"task":"Bathe Mack.","urgent":false},{"task":"Finish RFPs for clients.","urgent":false},{"task":"Drink avocado marg.","urgent":false},{"task":"Enjoy the Rapture.","urgent":true}]} \ No newline at end of file +{"items":[{"task":"Bathe Mack.","urgent":false},{"task":"Finish RFPs for clients.","urgent":false},{"task":"Drink avocado marg.","urgent":true},{"task":"Enjoy the Rapture.","urgent":false}]} \ No newline at end of file