Changeset 4964
- Timestamp:
- 16/05/08 09:17:13 (2 months ago)
- Files:
-
- Trunk/contributors/BramChen/plugins/ArchivedTimeline.js (modified) (4 diffs)
- Trunk/contributors/BramChen/plugins/ArchivedTimeline.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/CommentPlugin.js (modified) (10 diffs)
- Trunk/contributors/BramChen/plugins/CommentPlugin.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/CommentTabPlugin.js (modified) (2 diffs)
- Trunk/contributors/BramChen/plugins/CommentTabPlugin.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/RecentTiddlersPlugin.js (added)
- Trunk/contributors/BramChen/plugins/RecentTiddlersPlugin.js.meta (added)
- Trunk/contributors/BramChen/plugins/TiddlyCalendar.js (added)
- Trunk/contributors/BramChen/plugins/TiddlyCalendar.js.meta (added)
- Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hans.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hant.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hans.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hant.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh-Hans.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh_Hant.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/TidIDEPlugin.zh-Hans.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hans.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hant.js.meta (modified) (1 diff)
- Trunk/contributors/BramChen/tweaks/core/patchShadowed (deleted)
- Trunk/contributors/BramChen/tweaks/tiddlers (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/contributors/BramChen/plugins/ArchivedTimeline.js
r2278 r4964 3 3 |''Name:''|ArchivedTimeline| 4 4 |''Description:''|Timeline archived monthly.| 5 |''Version:''|0. 6.3|6 |''Date:''| Jan 14, 2007|5 |''Version:''|0.7.0| 6 |''Date:''|Aug 25, 2007| 7 7 |''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646| 8 8 |''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/]]| 10 10 |''~CoreVersion:''|2.0.11| 11 11 |''Browser:''|Firefox 1.5+; InternetExplorer 6.0| 12 12 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 15 20 !Revision History: 16 21 |''Version''|''Date''|''Note''| 22 |0.7.0|Aug 25, 2007|Accept a date format parameter| 17 23 |0.6.3|Jan 14, 2007|Cleaned codes, Removed config.macros.timeline.slider and config.macros.timeline.onClickSlider| 18 24 |0.6.2|Dec 10, 2006|Add monthFormat to display month format for Chinese| … … 34 40 ***/ 35 41 //{{{ 36 version.extensions.archivedTimeline = {major: 0, minor: 6, revision: 3,37 date: new Date(" Jan 14, 2007"),42 version.extensions.archivedTimeline = {major: 0, minor: 7, revision: 0, 43 date: new Date("Aug 26, 2007"), 38 44 name: "ArchivedTimeline", 39 45 type: "Macro", … … 58 64 var last = (params[1])?params[1]:config.options.txtTimelineMaxentries; 59 65 last = (isNaN(last)||last<1) ? 0:tiddlers.length-Math.min(tiddlers.length,parseInt(last)); 66 var dateFormat = params[2] ? params[2] : this.dateFormat; 60 67 var cookie; var archives; 61 68 for (var t=tiddlers.length-1; t>=last; t--) { … … 77 84 } 78 85 if(theDay != lastDay){ 79 theText += tiddler[field].formatString( this.dateFormat) + '\n';86 theText += tiddler[field].formatString(dateFormat) + '\n'; 80 87 lastDay = theDay; 81 88 } Trunk/contributors/BramChen/plugins/ArchivedTimeline.js.meta
r2278 r4964 1 1 title: ArchivedTimeline 2 2 modifier: BramChen 3 modified: 20070 11322003 modified: 2007008252200 4 4 created: 200611172200 5 5 tags: systemConfig excludeLists excludeSearch excludeMissing Trunk/contributors/BramChen/plugins/CommentPlugin.js
r1303 r4964 1 1 /*** 2 2 |''Name:''|CommentPlugin| 3 |''Source:''| |3 |''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646| 4 4 |''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.| 7 11 8 12 ''Translation sample 1:'' … … 12 16 CommentInTitle: " è¿Žé¿ ", 13 17 comments:"迎é¿", 14 add:"åæ U+00BB.",18 add:"åæ Â»", 15 19 edit:"線茯", 16 20 tooltips:"çŒè¡šéæŒæ€æççžéæèŠ", … … 36 40 37 41 ''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 38 48 * v0.7.0 (Nov 09, 2006) 39 ** Minor changes, more easier to be translated (Bram)49 ** Minor changes, more easier to be translated 40 50 * v0.6.0 (Nov 09, 2006) 41 ** Runs compatibly with TW 2.1.0+ (Bram)51 ** Runs compatibly with TW 2.1.0+ 42 52 * 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 48 58 * v0.1.0 (Mar 13, 2006) Modified by Bram Chen. 49 59 ***/ … … 57 67 add: "New Comment Here...", 58 68 edit: "Edit", 59 tooltips: "Create a new comment tiddler associated with this tiddler",69 tooltips: "Create a new comment tiddler associated with this tiddler", 60 70 Title: "%0 Comment %1", 61 71 CommenteditTemplate: {yourName: "Your Name: ", nickName: "(nick name)", comments: "Comment: "} … … 70 80 71 81 var 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); 86 83 87 84 function get_parent(tiddler){ 88 while( in_array(CPlingo.comments, tiddler.tags)){85 while(tiddler.isTagged(CPlingo.comments)){ 89 86 tiddler=store.fetchTiddler(tiddler.tags[0]); 90 87 } … … 96 93 var count=0; 97 94 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)){ 99 96 count+=count_comments(tagged[i].title)+1; 100 97 } … … 105 102 106 103 config.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"; 104 config.tiddlerTemplates[3]="CommentEditTemplate"; 108 105 var COMMENT_EDIT_TEMPLATE = 3; 109 106 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;107 config.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/*}}}*/'; 108 config.shadowTiddlers.StyleSheet += '\n[[CommentPluginStyle]]'; 112 109 config.macros.newCommentLink = { 113 110 label: CPlingo.add, 114 111 prompt: CPlingo.tooltips, 115 112 handler: function(place,macroName,params,wikifier,paramString,tiddler) { 113 config.CommentPlugin.only_on_tags.pushUnique(CPlingo.comments); 116 114 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; 119 117 var onclick = function(e) { 120 118 var e = (e)?e:window.event; 121 119 var theTarget = resolveTarget(e); 122 var t itlex=tiddler.title.split(CPlingo.CommentInTitle)[0];123 var title = (tiddler.title.indexOf(CPlingo.CommentInTitle)!=-1)? t itlex: tiddler.title;120 var tagxs = tiddler.title.split(CPlingo.CommentInTitle); 121 var title = (tiddler.title.indexOf(CPlingo.CommentInTitle)!=-1)? tagxs[0] : tiddler.title; 124 122 title = CPlingo.Title.format([title,(new Date()).formatString(CPlingo.dateFormat)]); 125 123 var comment = store.createTiddler(title); 126 124 comment.text = ''; 127 comment.tags = [tiddler.title, CPlingo.comments, 'excludeLists'];125 comment.tags = [tiddler.title, CPlingo.comments,'excludeLists']; 128 126 readOnly = false; 129 127 story.displayTiddler(theTarget, title, COMMENT_EDIT_TEMPLATE); … … 142 140 var comments = store.getTaggedTiddlers(tiddler.title, 'created'); 143 141 var count = count_comments(tiddler.title); 144 if(co mments.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) { 145 143 var show = createTiddlyElement(place, 'p'); 146 144 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>'; 147 145 } 148 146 var place = createTiddlyElement(place, 'div', 'comments'+tiddler.title, 'comments'); 149 if(co mments.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) 150 148 place.style.display = 'none'; 151 149 else 152 150 place.style.display = 'block'; 153 151 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; 155 153 var container = createTiddlyElement(place, 'div', null, 'comment'); 156 154 var title = createTiddlyElement(container, 'strong'); 157 155 var link = createTiddlyLink(title, comments[i].modifier, true); 158 156 createTiddlyElement(title, 'span', null, null, ', '+comments[i].created.formatString(this.dateFormat)); 159 /* --remove editable option for security concern157 /* ## remove editable option for security concern 160 158 if(comments[i].modifier == config.options.txtUserName) { 161 159 createTiddlyElement(title, 'span', null, null, ' ('); … … 177 175 TiddlyWiki.prototype.CommentPlugin_saveTiddler = TiddlyWiki.prototype.saveTiddler; 178 176 TiddlyWiki.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)){ 181 179 newBody=newBody.htmlDecode(); // comment this line, for working with HTMLAreaPackage 182 180 newBody=newBody.substr(0,config.CommentPlugin.max_comment_count); … … 184 182 } 185 183 var t = this.CommentPlugin_saveTiddler(title,newTitle,newBody,modifier,modified,tags); 186 if( in_array(CPlingo.comments, tags)) {184 if(tags.contains(CPlingo.comments)) { 187 185 var original = config.CommentPlugin.default_fold; 188 186 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); 190 189 config.CommentPlugin.default_fold = original; 191 190 CPCloseTiddlers.push(newTitle); Trunk/contributors/BramChen/plugins/CommentPlugin.js.meta
r2278 r4964 1 1 title: CommentPlugin 2 2 modifier: BramChen 3 modified: 200 6111722003 modified: 200804272200 4 4 created: 200611172200 5 5 tags: 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 //{{{ 5 8 function in_array(item, arr){for(var i=0;i<arr.length;i++)if(item==arr[i])return true}; 6 9 function get_parent(tiddler){while(tiddler && in_array(config.CommentPlugin.CPlingo.comments, tiddler.tags)) tiddler=store.fetchTiddler(tiddler.tags[0]);return tiddler}; … … 38 41 } 39 42 }; 40 }}}43 //}}} Trunk/contributors/BramChen/plugins/CommentTabPlugin.js.meta
r2278 r4964 1 1 title: CommentTabPlugin 2 2 modifier: BramChen 3 modified: 200 6111722003 modified: 200704112200 4 4 created: 200611172200 5 5 tags: systemConfig excludeLists excludeSearch excludeMissing Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hans.js.meta
r1144 r4964 3 3 modified: 200611172200 4 4 created: 200611172200 5 tags: systemConfig lingozh-Hans5 tags: systemConfig excludeSearch locale zh-Hans Trunk/contributors/BramChen/plugins/locales/ArchivedTimeline.zh-Hant.js.meta
r1144 r4964 3 3 modified: 200611172200 4 4 created: 200611172200 5 tags: systemConfig lingozh-Hant5 tags: systemConfig excludeSearch locale zh-Hant Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hans.js.meta
r1144 r4964 3 3 modified: 200611282200 4 4 created: 200611282200 5 tags: systemConfig lingozh-Hans5 tags: tags: systemConfig excludeSearch locale zh-Hans Trunk/contributors/BramChen/plugins/locales/CollapasTiddlerPlugin.zh-Hant.js.meta
r1144 r4964 3 3 modified: 200611282200 4 4 created: 200611282200 5 tags: systemConfig lingozh-Hant5 tags: systemConfig excludeSearch locale zh-Hant Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh-Hans.js.meta
r1144 r4964 3 3 modified: 200611161700 4 4 created: 200604270000 5 tags: systemConfig lingozh-Hans5 tags: tags: systemConfig excludeSearch locale zh-Hans Trunk/contributors/BramChen/plugins/locales/ImportTiddlersPlugin.zh_Hant.js.meta
r1144 r4964 3 3 modified: 200611161700 4 4 created: 200604270000 5 tags: systemConfig lingozh-Hant5 tags: systemConfig excludeSearch locale zh-Hant Trunk/contributors/BramChen/plugins/locales/TidIDEPlugin.zh-Hans.js.meta
r1144 r4964 3 3 modified: 200611280000 4 4 created: 200611280000 5 tags: systemConfig lingozh-Hans5 tags: tags: systemConfig excludeSearch locale zh-Hans Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hans.js.meta
r1160 r4964 3 3 modified: 200612140000 4 4 created: 200612140000 5 tags: systemConfig lingozh-Hant5 tags: systemConfig excludeSearch locale zh-Hant Trunk/contributors/BramChen/plugins/locales/UploadPlugin.zh-Hant.js.meta
r1160 r4964 3 3 modified: 200612140000 4 4 created: 200612140000 5 tags: systemConfig lingozh-Hant5 tags: systemConfig excludeSearch locale zh-Hant