• [ ] TO DOs
    [ X ] finished TO DOs

  • <script>
    (function(){
    function get_text(el) {
    ret = “”;
    var length = el.childNodes.length;
    for(var i = 0; i < length; i++) {
    var node = el.childNodes[i];
    if(node.nodeType != 8) {
    ret += node.nodeType != 1 ? node.nodeValue : get_text(node);
    }
    }
    return ret;
    }

    Backbone.on(‘key:save’,function(){
    $('.card .view').map(function(c){ var words = get_text(this).split(/\S+/g).length - 1; if($($(this)[0]).children('span.wordcount').length == 0) { $(this).append(“<span class='wordcount'>“+words+” words</span>“);
    } else {
    $($(this)[0]).children(‘span.wordcount’).innerHtml = words+” words”;
    }

    })
    });
    })();
    </script>

    <style>
    span.wordcount {
    position: absolute;
    bottom: 10px;
    vertical-align: center;
    right: 50%;
    font-size: 70%;
    color: #ddd;
    }
    li.card.card-active span.wordcount {
    color: #333;
    }
    </style>

{"cards":[{"_id":"4308f16a17c0a7f44d00022b","treeId":"4306b2c517c0a7f44d00015d","seq":32281,"position":0.5,"parentId":null,"content":"[ ] TO DOs\n[ X ] finished TO DOs"},{"_id":"430920cee5d0e0231d000034","treeId":"4306b2c517c0a7f44d00015d","seq":32960,"position":1,"parentId":"4308f16a17c0a7f44d00022b","content":"<script>\n(function(){\nfunction get_text(el) {\n ret = \"\";\n var length = el.childNodes.length;\n for(var i = 0; i < length; i++) {\n var node = el.childNodes[i];\n if(node.nodeType != 8) {\n ret += node.nodeType != 1 ? node.nodeValue : get_text(node);\n }\n }\n return ret;\n}\n\nBackbone.on('key:save',function(){\n$('.card .view').map(function(c){\nvar words = get_text(this).split(/\\S+/g).length - 1;\n\nif($($(this)[0]).children('span.wordcount').length == 0) {\n $(this).append(\"<span class='wordcount'>\"+words+\" words</span>\");\n} else {\n$($(this)[0]).children('span.wordcount').innerHtml = words+\" words\";\n}\n\n})\n});\n})();\n</script>\n\n<style>\nspan.wordcount {\nposition: absolute;\nbottom: 10px;\nvertical-align: center;\nright: 50%;\nfont-size: 70%;\ncolor: #ddd;\n}\nli.card.card-active span.wordcount {\ncolor: #333;\n}\n</style>"}],"tree":{"_id":"4306b2c517c0a7f44d00015d","name":"Uni","publicUrl":"uni"}}