代码之家  ›  专栏  ›  技术社区  ›  Head Geek

重置TiddlyWiki/CheckboxPlugin清单中的所有项目

  •  0
  • Head Geek  · 技术社区  · 17 年前

    我已经在TiddlyWiki中为自己写了一份每周回顾GTD清单,使用 CheckboxPlugin . 每周完成后,我想单击一个链接取消选中(重置)其中的所有项目,以便下次使用。

    我将支票信息作为标签存储在单独的tiddler页面上。我应该能够删除该页面上的所有标签并刷新检查表页面,但我还没有想出如何做到这一点。

    我通常在C、C++和Lisp中学习,我只是学习JavaScript。有人能提供一些有用的建议吗?

    (在任何人提出建议之前,我已经在同一个网站上查看了ChecklistScript。它没有使用CheckboxPlugin的东西,并且与它不兼容。)

    2 回复  |  直到 17 年前
        1
  •  1
  •   ELS ELS    17 年前

    试试这个(改编自ChecklistScript的“resetall”代码):

    <html><form style="display:inline">
        <input type="button" value="clear all" onclick="
            var tid='SomeTiddler';
            var list='tag1 [[tag 2]] tag3 tag4';
            var tags=list.readBracketedList();
            store.suspendNotifications();
            for (var t=0; t<tags.length; t++)
                store.setTiddlerTag(tid,false,tags[t]);
            store.resumeNotifications();
            story.refreshTiddler(tid,null,true);
    "></form></html>
    
        2
  •  0
  •   Head Geek    17 年前

    <script label="(Reset All)" title="Reset all items" key="X">
            var tid='WeeklyReviewStepsChecklistItems';
            store.getTiddler(tid).tags=[];
            story.refreshTiddler(tid,null,true);
    
            story.refreshTiddler('Weekly Review Steps',null,true);
    </script>
    

    这只是因为我将标签存储在一个单独的tiddler中,并使用 InlineJavascriptPlugin .

    推荐文章