TiddlyWiki.org

Changeset 4964

Show
Ignore:
Timestamp:
16/05/08 09:17:13 (2 months ago)
Author:
BramChen
Message:

Deletions and
Updated plugins

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/contributors/BramChen/plugins/ArchivedTimeline.js

    r2278 r4964  
    33|''Name:''|ArchivedTimeline| 
    44|''Description:''|Timeline archived monthly.| 
    5 |''Version:''|0.6.3
    6 |''Date:''|Jan 14, 2007| 
     5|''Version:''|0.7.0
     6|''Date:''|Aug 25, 2007| 
    77|''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646| 
    88|''Author:''|BramChen (bram.chen (at) gmail (dot) com)| 
    9 |''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License]]| 
     9|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]| 
    1010|''~CoreVersion:''|2.0.11| 
    1111|''Browser:''|Firefox 1.5+; InternetExplorer 6.0| 
    1212 
    13 !Syntax/Examples: 
    14 |{{{<<timeline [modified | created] [maxentries]>>}}}| 
     13!Syntax: 
     14{{{<<timeline [modified|created [maxentries [dateFormate]]]>>}}} 
     15!Examples: 
     16{{{<<timeline>>}}} 
     17{{{<<timeline created 10>>}}} 
     18{{{<<timeline modified 10 "MMM DD, YYYY">>}}} 
     19 
    1520!Revision History: 
    1621|''Version''|''Date''|''Note''| 
     22|0.7.0|Aug 25, 2007|Accept a date format parameter| 
    1723|0.6.3|Jan 14, 2007|Cleaned codes, Removed config.macros.timeline.slider and config.macros.timeline.onClickSlider| 
    1824|0.6.2|Dec 10, 2006|Add monthFormat to display month format for Chinese| 
     
    3440***/ 
    3541//{{{ 
    36 version.extensions.archivedTimeline = {major: 0, minor: 6, revision: 3
    37         date: new Date("Jan 14, 2007"), 
     42version.extensions.archivedTimeline = {major: 0, minor: 7, revision: 0
     43        date: new Date("Aug 26, 2007"), 
    3844        name: "ArchivedTimeline", 
    3945        type: "Macro", 
     
    5864        var last = (params[1])?params[1]:config.options.txtTimelineMaxentries; 
    5965                last = (isNaN(last)||last<1) ? 0:tiddlers.length-Math.min(tiddlers.length,parseInt(last)); 
     66        var dateFormat = params[2] ? params[2] : this.dateFormat; 
    6067        var cookie; var archives; 
    6168        for (var t=tiddlers.length-1; t>=last; t--) { 
     
    7784                } 
    7885                if(theDay != lastDay){ 
    79                         theText +=  tiddler[field].formatString(this.dateFormat) + '\n'; 
     86                        theText +=  tiddler[field].formatString(dateFormat) + '\n'; 
    8087                        lastDay = theDay;  
    8188                } 
  • Trunk/contributors/BramChen/plugins/ArchivedTimeline.js.meta

    r2278 r4964  
    11title: ArchivedTimeline 
    22modifier: BramChen 
    3 modified: 200701132200 
     3modified: 2007008252200 
    44created: 200611172200 
    55tags: systemConfig excludeLists excludeSearch excludeMissing 
  • Trunk/contributors/BramChen/plugins/CommentPlugin.js

    r1303 r4964  
    11/*** 
    22|''Name:''|CommentPlugin| 
    3 |''Source:''|
     3|''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646
    44|''Author:''|Tim Morgan (modified by Bram Chen| 
    5 |''Desc:''|''Adds "comments" to any TiddlyWiki or adaptation.''| 
    6 | |Used in conjunction with the RecentPlugin, one can have a decent forum environment.| 
     5|''Version:''|1.0.1| 
     6|''Date:''|Apr 27, 2008| 
     7|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]| 
     8|''~CoreVersion:''|2.0.11| 
     9|''Description:''|Adds "comments" to any TiddlyWiki or adaptation.| 
     10|~|Used in conjunction with the RecentPlugin, one can have a decent forum environment.| 
    711 
    812''Translation sample 1:'' 
     
    1216        CommentInTitle: " 迎響 ", 
    1317        comments:"迎響", 
    14         add:"回應 U+00BB.", 
     18        add:"回應 »", 
    1519        edit:"線茯", 
    1620        tooltips:"癌衚關斌歀文的盞關意芋", 
     
    3640 
    3741''Revision history:'' 
     42* v1.0.1 (Apr 27, 2008) 
     43** Fixed bug, empty only_on_tags should allow all tiddlers could be commented (bug reported by MilchFlasche), except the tiddlers tagged with 'not_on_tags' (also shadowed).<br>(in general, the array only_on_tags would contain one element 'comment' at least, not really empty) 
     44* v1.0.0 (Feb 3, 2008) 
     45** Fixed bug, those tiddlers tagging with some other tiddlers and not tagged with only_on_tags would also be created a comment links with count 0. 
     46* v0.8.0 (Jan 17, 2007) 
     47** Some minor changes and bugs fixed 
    3848* v0.7.0 (Nov 09, 2006) 
    39 ** Minor changes, more easier to be translated (Bram) 
     49** Minor changes, more easier to be translated 
    4050* v0.6.0 (Nov 09, 2006) 
    41 ** Runs compatibly with TW 2.1.0+ (Bram) 
     51** Runs compatibly with TW 2.1.0+ 
    4252* v0.5.0 (Jun 15, 2006) 
    43 ** Fixed bug for feature of CommentEditTemplate (bug reported by MilchFlasche, fixed by Bram
    44 ** Fixed bug in redefined TiddlyWiki.prototype.saveTiddler (Bram) 
    45 * v0.4.0 (Jun 03, 2006) Added CommentEditTemplate (Bram) 
    46 * v0.3.0 (Jun 01, 2006) Some minor changes for readOnly mode (Bram) 
    47 * v0.2.0 (Apr 04, 2006) Fixed bug for only_on_tags (Bram) 
     53** Fixed bug for feature of CommentEditTemplate (bug reported by MilchFlasche
     54** Fixed bug in redefined TiddlyWiki.prototype.saveTiddler 
     55* v0.4.0 (Jun 03, 2006) Added CommentEditTemplate 
     56* v0.3.0 (Jun 01, 2006) Some minor changes for readOnly mode 
     57* v0.2.0 (Apr 04, 2006) Fixed bug for only_on_tags 
    4858* v0.1.0 (Mar 13, 2006) Modified by Bram Chen. 
    4959***/ 
     
    5767        add: "New Comment Here...", 
    5868        edit: "Edit", 
    59         tooltips:" Create a new comment tiddler associated with this tiddler", 
     69        tooltips: "Create a new comment tiddler associated with this tiddler", 
    6070        Title: "%0 Comment %1", 
    6171        CommenteditTemplate: {yourName: "Your Name: ", nickName: "(nick name)", comments: "Comment: "} 
     
    7080 
    7181var CPlingo = config.CommentPlugin.CPlingo; 
    72 config.CommentPlugin.only_on_tags.push(CPlingo.comments); 
    73  
    74 function in_array(item, arr){ 
    75         for(var i=0;i<arr.length;i++){ 
    76                 if(item==arr[i]) {return true;} 
    77         } 
    78 }; 
    79  
    80 function one_in_array(items, arr){ 
    81         for(var i=0;i<items.length;i++){ 
    82                 if(in_array(items[i], arr)){return true;} 
    83         } 
    84         return false 
    85 }; 
     82//config.CommentPlugin.only_on_tags.pushUnique(CPlingo.comments); 
    8683 
    8784function get_parent(tiddler){ 
    88         while(in_array(CPlingo.comments, tiddler.tags)){ 
     85        while(tiddler.isTagged(CPlingo.comments)){ 
    8986                tiddler=store.fetchTiddler(tiddler.tags[0]); 
    9087        } 
     
    9693        var count=0; 
    9794        for(var i=0;i<tagged.length;i++){ 
    98                 if(in_array(CPlingo.comments, tagged[i].tags)){ 
     95                if(tagged[i].tags.contains(CPlingo.comments)){ 
    9996                        count+=count_comments(tagged[i].title)+1; 
    10097                } 
     
    105102 
    106103config.shadowTiddlers.CommentEditTemplate="<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler wikibar'></div><div class='title' macro='view title'></div><div class='editor' macro='edit tags' style='display:none;'></div><div class='GuestSign' >" + CPlingo.CommenteditTemplate.yourName + "<span macro='option txtUserName'></span>" + CPlingo.CommenteditTemplate.nickName + "<br />" + CPlingo.CommenteditTemplate.comments + "</div><div class='editor' macro='edit text'></div>"; 
    107 config.tiddlerTemplates[3]="CommentEditTemplate"; 
     104config.tiddlerTemplates[3]="CommentEditTemplate";       
    108105var COMMENT_EDIT_TEMPLATE = 3; 
    109106 
    110 config.shadowTiddlers.CommentPluginStyle = '\n/*{{{*/\n.commentTags ul{list-style:none; padding-left:0px;margin: 0 0 3px 0;} .commentTags li{display:inline;color:#999;} .commentTags li a.button{color:#999;} .comment{border-left:1px solid #ccc; margin-top:10px; margin-left:10px; padding:5px;} .newCommentLink{padding-top:10px} .tagging, .selected .tagging, .tiddler .tagging{display:none;} .comment a.button{padding:0px; font-size:smaller;}\n/*}}}*/'; 
    111 config.shadowTiddlers.StyleSheet += config.shadowTiddlers.CommentPluginStyle
     107config.shadowTiddlers.CommentPluginStyle = '\n/*{{{*/\n.commentTags ul {list-style:none; padding-left:0px; margin: 0 0 3px 0;}\n.commentTags li {display:inline; color:#999;}\n.commentTags li a.button {color:#999;}\n.comment {border-left:1px solid #ccc; margin-top:10px; margin-left:10px; padding:5px;}\n.newCommentLink {padding-top:10px}\n.tagging, .selected .tagging, .tiddler .tagging {display:none;}\n.comment a.button {padding:0px; font-size:smaller; background-color:lightgray;}\n.comments a.button {background-color:lightgray;}\n/*}}}*/'; 
     108config.shadowTiddlers.StyleSheet += '\n[[CommentPluginStyle]]'
    112109config.macros.newCommentLink = { 
    113110        label: CPlingo.add, 
    114111        prompt: CPlingo.tooltips, 
    115112        handler: function(place,macroName,params,wikifier,paramString,tiddler) { 
     113                config.CommentPlugin.only_on_tags.pushUnique(CPlingo.comments); 
    116114                if(tiddler && store.tiddlerExists(tiddler.title) && !readOnly && (!window.zw || zw.loggedIn || zw.anonEdit)) { 
    117                         if(config.CommentPlugin.only_on_tags.length>0 && !one_in_array(tiddler.tags, config.CommentPlugin.only_on_tags)) return; 
    118                         if(config.CommentPlugin.not_on_tags.length>0 && one_in_array(tiddler.tags, config.CommentPlugin.not_on_tags)) return; 
     115                        if(tiddler.tags.containsAny(config.CommentPlugin.not_on_tags) || !(tiddler.tags.containsAny(config.CommentPlugin.only_on_tags) || config.CommentPlugin.only_on_tags == CPlingo.comments)) 
     116                               return; 
    119117                        var onclick = function(e) { 
    120118                                var e = (e)?e:window.event; 
    121119                                var theTarget = resolveTarget(e); 
    122                                 var titlex=tiddler.title.split(CPlingo.CommentInTitle)[0]
    123                                 var title = (tiddler.title.indexOf(CPlingo.CommentInTitle)!=-1)? titlex : tiddler.title; 
     120                                var tagxs = tiddler.title.split(CPlingo.CommentInTitle)
     121                                var title = (tiddler.title.indexOf(CPlingo.CommentInTitle)!=-1)? tagxs[0] : tiddler.title; 
    124122                                title = CPlingo.Title.format([title,(new Date()).formatString(CPlingo.dateFormat)]); 
    125123                                var comment = store.createTiddler(title); 
    126124                                comment.text = ''; 
    127                                 comment.tags = [tiddler.title, CPlingo.comments, 'excludeLists']; 
     125                                comment.tags = [tiddler.title, CPlingo.comments,'excludeLists']; 
    128126                                readOnly = false; 
    129127                                story.displayTiddler(theTarget, title, COMMENT_EDIT_TEMPLATE); 
     
    142140        var comments = store.getTaggedTiddlers(tiddler.title, 'created'); 
    143141        var count = count_comments(tiddler.title); 
    144         if(comments.length>0 && !in_array(CPlingo.comments, tiddler.tags) && config.CommentPlugin.fold_comments) { 
     142        if(count>0 && !tiddler.tags.contains(CPlingo.comments) && config.CommentPlugin.fold_comments) { 
    145143                var show = createTiddlyElement(place, 'p'); 
    146144                show.innerHTML = '<a href="#" onclick="var e=document.getElementById(\'comments'+tiddler.title+'\');e.style.display=e.style.display==\'block\'?\'none\':\'block\';return false;">' + CPlingo.comments +'('+count+') »</a>'; 
    147145        } 
    148146        var place = createTiddlyElement(place, 'div', 'comments'+tiddler.title, 'comments'); 
    149         if(comments.length>0 && !in_array(CPlingo.comments, tiddler.tags) && config.CommentPlugin.fold_comments && config.CommentPlugin.default_fold) 
     147        if(count>0 && !tiddler.tags.contains(CPlingo.comments) && config.CommentPlugin.fold_comments && config.CommentPlugin.default_fold) 
    150148                place.style.display = 'none'; 
    151149        else 
    152150                place.style.display = 'block'; 
    153151        for(var i=0; i<comments.length; i++) { 
    154                 if(!in_array(CPlingo.comments, comments[i].tags))continue; 
     152                if(!comments[i].tags.contains(CPlingo.comments))continue; 
    155153                var container = createTiddlyElement(place, 'div', null, 'comment'); 
    156154                var title = createTiddlyElement(container, 'strong'); 
    157155                var link = createTiddlyLink(title, comments[i].modifier, true); 
    158156                createTiddlyElement(title, 'span', null, null, ', '+comments[i].created.formatString(this.dateFormat)); 
    159 /* -- remove editable option for security concern 
     157/* ## remove editable option for security concern 
    160158                if(comments[i].modifier == config.options.txtUserName) { 
    161159                        createTiddlyElement(title, 'span', null, null, ' ('); 
     
    177175TiddlyWiki.prototype.CommentPlugin_saveTiddler = TiddlyWiki.prototype.saveTiddler; 
    178176TiddlyWiki.prototype.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags) { 
    179         tags=(typeof tags == "string") ? tags.readBracketedList() : tags; 
    180         if(in_array(CPlingo.comments, tags)){ 
     177        tags=(!window.zw && typeof tags == "string") ? tags.readBracketedList() : tags; 
     178        if(tags.contains(CPlingo.comments)){ 
    181179                newBody=newBody.htmlDecode(); // comment this line, for working with HTMLAreaPackage 
    182180                newBody=newBody.substr(0,config.CommentPlugin.max_comment_count); 
     
    184182        } 
    185183        var t = this.CommentPlugin_saveTiddler(title,newTitle,newBody,modifier,modified,tags); 
    186         if(in_array(CPlingo.comments, tags)) { 
     184        if(tags.contains(CPlingo.comments)) { 
    187185                var original = config.CommentPlugin.default_fold; 
    188186                config.CommentPlugin.default_fold = false; 
    189                 story.refreshTiddler(get_parent(t).title, DEFAULT_VIEW_TEMPLATE, true); 
     187//              story.refreshTiddler(get_parent(t).title, DEFAULT_VIEW_TEMPLATE, true); 
     188                story.refreshTiddler(t.tags[0].split(CPlingo.CommentInTitle)[0], DEFAULT_VIEW_TEMPLATE, true); 
    190189                config.CommentPlugin.default_fold = original; 
    191190                CPCloseTiddlers.push(newTitle); 
  • Trunk/contributors/BramChen/plugins/CommentPlugin.js.meta

    r2278 r4964  
    11title: CommentPlugin 
    22modifier: BramChen 
    3 modified: 200611172200 
     3modified: 200804272200 
    44created: 200611172200 
    55tags: systemConfig excludeLists excludeSearch excludeMissing 
  • Trunk/contributors/BramChen/plugins/CommentTabPlugin.js

    r1303 r4964  
    1 //''Breaks the Timeline tab into "Tiddlers" and "Comments".''// 
    2 //Makes sense with the CommentPlugin.// 
    3  
    4 {{{ 
     1/*** 
     2|''Name:''|CommentTabPlugin| 
     3|''Source:''|[[TiddlyWiki-zh|http://tiddlywiki-zh.googlecode.com/svn/trunk/contributors/BramChen/locales/plugins/]]| 
     4|''Requires:''|[[CommentPlugin|http://sourceforge.net/project/showfiles.php?group_id=150646]]| 
     5|''Descriptions:''|Breaks the Timeline tab into "Tiddlers" and "Comments".| 
     6***/ 
     7//{{{ 
    58function in_array(item, arr){for(var i=0;i<arr.length;i++)if(item==arr[i])return true}; 
    69function get_parent(tiddler){while(tiddler && in_array(config.CommentPlugin.CPlingo.comments, tiddler.tags)) tiddler=store.fetchTiddler(tiddler.tags[0]);return tiddler}; 
     
    3841        } 
    3942}; 
    40 }}} 
     43//}}} 
  • Trunk/contributors/BramChen/plugins/CommentTabPlugin.js.meta

    r2278 r4964  
    11title: CommentTabPlugin 
    22modifier: BramChen 
    3 modified: 200611172200 
     3modified: 200704112200 
    44created: 200611172200 
    55tags: systemConfig excludeLists excludeSearch excludeMissing 
  • Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hans.js.meta

    r1144 r4964  
    33modified: 200611172200 
    44created: 200611172200 
    5 tags: systemConfig lingo zh-Hans 
     5tags: systemConfig excludeSearch locale zh-Hans 
  • Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hant.js.meta

    r1144 r4964  
    33modified: 200611172200 
    44created: 200611172200 
    5 tags: systemConfig lingo zh-Hant 
     5tags: systemConfig excludeSearch locale zh-Hant 
  • Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hans.js.meta

    r1144 r4964  
    33modified: 200611282200 
    44created: 200611282200 
    5 tags: systemConfig lingo zh-Hans 
     5tags: tags: systemConfig excludeSearch locale zh-Hans 
  • Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hant.js.meta

    r1144 r4964  
    33modified: 200611282200 
    44created: 200611282200 
    5 tags: systemConfig lingo zh-Hant 
     5tags: systemConfig excludeSearch locale zh-Hant 
  • Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh-Hans.js.meta

    r1144 r4964  
    33modified: 200611161700 
    44created: 200604270000 
    5 tags: systemConfig lingo zh-Hans 
     5tags: tags: systemConfig excludeSearch locale zh-Hans 
  • Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh_Hant.js.meta

    r1144 r4964  
    33modified: 200611161700 
    44created: 200604270000 
    5 tags: systemConfig lingo zh-Hant 
     5tags: systemConfig excludeSearch locale zh-Hant 
  • Trunk/contributors/BramChen/plugins/locales/TidIDEPlugin.zh-Hans.js.meta

    r1144 r4964  
    33modified: 200611280000 
    44created: 200611280000 
    5 tags: systemConfig lingo zh-Hans 
     5tags: tags: systemConfig excludeSearch locale zh-Hans 
  • Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hans.js.meta

    r1160 r4964  
    33modified: 200612140000 
    44created: 200612140000 
    5 tags: systemConfig lingo zh-Hant 
     5tags: systemConfig excludeSearch locale zh-Hant 
  • Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hant.js.meta

    r1160 r4964  
    33modified: 200612140000 
    44created: 200612140000 
    5 tags: systemConfig lingo zh-Hant 
     5tags: systemConfig excludeSearch locale zh-Hant