Ticket #1327: diff_of_native_vs_patched.txt

File diff_of_native_vs_patched.txt, 21.7 KB (added by arch_o_median, at 2011-01-16T01:59:01Z)

diff of the two tiddlywikis

Line 
1508a509,994
2> <div title="ConfigTweaks" modifier="Zooko" created="200812152209" modified="200812152226" tags="systemConfig" changecount="3">
3> <pre>//{{{
4> config.options.txtTheme = &quot;WritableTheme&quot;;
5> //}}}</pre>
6> </div>
7> <div title="HTTPSavingPlugin" modifier="Zooko" created="200812152200" modified="200812152200" tags="systemConfig" changecount="4">
8> <pre>/***
9> |''Name''|HTTPSavingPlugin|
10> |''Description''|&lt;...&gt;|
11> |''Author''|Zooko|
12> |''Contributors''|FND|
13> |''Version''|0.2.1|
14> |''Status''|@@experimental@@|
15> |''Source''|http://allmydata.org/trac/tiddly_on_tahoe|
16> |''CodeRepository''|http://allmydata.org/source/tiddly_on_tahoe/trunk/|
17> |''License''|GPLv2+ or TGPPLv1.0+|
18> |''Keywords''|&lt;...&gt;|
19> !Description
20> &lt;...&gt;
21> !Notes
22> This plugin is being developed for [[Tiddly on Tahoe|http://allmydata.org/trac/tiddly_on_tahoe]].
23> ***/
24> /* The following comment is to let jslint know which variables are supposed to be global. */
25> /*global clearMessage, config, getPath, readOnly, saveChanges, saveTest, showBackstage, store, story, version, convertUriToUTF8, convertUnicodeToFileFormat, getLocalPath, loadRemoteFile, locateStoreArea, saveBackup, saveEmpty, saveFile, saveMain, saveRss, unescape, displayMessage, httpReq */
26> //{{{
27> if (!version.extensions.HTTPSavingPlugin) { //# ensure that the plugin is only installed once
28>       version.extensions.HTTPSavingPlugin = { installed: true };
29>
30>       (function () { //# wrapper
31>               readOnly = false;
32>               config.options.chkHttpReadOnly = false;
33>               showBackstage = true;
34>
35>               saveTest = function () {
36>                       var s = document.getElementById(&quot;saveTest&quot;);
37>                       /*if (s.hasChildNodes()) {
38>                         alert(config.messages.savedSnapshotError);
39>                         }*/
40>                       s.appendChild(document.createTextNode(&quot;savetest&quot;));
41>               };
42>
43>               // Save this TiddlyWiki with the pending changes
44>               saveChanges = function (onlyIfDirty, tiddlers) {
45>                       var originalPath, localCallback, result;
46>                       if (onlyIfDirty &amp;&amp; !store.isDirty()) {
47>                               return;
48>                       }
49>                       clearMessage();
50>                       // Get the URL of the document
51>                       originalPath = getPath(document.location.toString());
52>                       // Load the original file
53>                       localCallback = function (status, context, original, url, xhr) {
54>                               //log(&quot;loaded remote file from &quot;, originalPath);
55>                               /*log(&quot;got callback status &quot;, status, &quot;\n&quot;, context: &quot;, context, &quot;\n&quot;,
56>                                 URL: &quot;, url, &quot;\n&quot;, XHR: &quot;, xhr);*/
57>                               if (original === null) {
58>                                       alert(config.messages.cantSaveError);
59>                                       if (store.tiddlerExists(config.messages.saveInstructions)) {
60>                                               story.displayTiddler(null, config.messages.saveInstructions);
61>                                       }
62>                                       return;
63>                               }
64>                               // Locate the storeArea div's
65>                               var posDiv = locateStoreArea(original);
66>                               if (!posDiv) {
67>                                       alert(config.messages.invalidFileError.format([originalPath]));
68>                                       return;
69>                               }
70>                               saveRss(originalPath);
71>                               saveEmpty(originalPath, original, posDiv);
72>                               saveMain(originalPath, original, posDiv);
73>                       };
74>                       result = loadRemoteFile(originalPath, localCallback);
75>                       //log(&quot;result from loadRemoteFile: &quot;, result);
76>                       return true;
77>               };
78>
79>               // override and disable saveBackup()
80>               saveBackup = function (localPath, original) {};
81>
82>               // override and disable getLocalPath()
83>               getLocalPath = function (origPath) {};
84>
85>               // override getPath()
86>               getPath = function (origPath) {
87>                       var originalPath, argPos, hashPos, resultPath;
88>                       originalPath = convertUriToUTF8(origPath, config.options.txtFileSystemCharSet);
89>                       // Remove any location or query part of the URL
90>                       argPos = originalPath.indexOf(&quot;?&quot;);
91>                       if (argPos !== -1) {
92>                               originalPath = originalPath.substr(0, argPos);
93>                       }
94>                       hashPos = originalPath.indexOf(&quot;#&quot;);
95>                       if (hashPos !== -1) {
96>                               originalPath = originalPath.substr(0, hashPos);
97>                       }
98>                       // Convert file://localhost/ to file:///
99>                       if (originalPath.indexOf(&quot;file://localhost/&quot;) === 0) {
100>                               originalPath = &quot;file://&quot; + originalPath.substr(16);
101>                       }
102>                       // Convert to a native file format
103>                       if (originalPath.indexOf(&quot;http://&quot;) === 0) { // HTTP file
104>                               resultPath = originalPath;
105>                       } else if (originalPath.charAt(9) === &quot;:&quot;) { // PC local file
106>                               resultPath = unescape(originalPath.substr(8)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
107>                       } else if (originalPath.indexOf(&quot;file://///&quot;) === 0) { // Firefox PC network file
108>                               resultPath = &quot;\\\\&quot; + unescape(originalPath.substr(10)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
109>                       } else if (originalPath.indexOf(&quot;file:///&quot;) === 0) { // *nix local file
110>                               resultPath = unescape(originalPath.substr(7));
111>                       } else if (originalPath.indexOf(&quot;file:/&quot;) === 0) { // *nix local file
112>                               resultPath = unescape(originalPath.substr(5));
113>                       } else { // PC local file
114>                               resultPath = &quot;\\\\&quot; + unescape(originalPath.substr(7)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
115>                       }
116>                       return resultPath;
117>               };
118>
119>               // override saveFile()
120>               saveFile = function (fileUrl, content, callb) {
121>                       displayMessage(&quot;saving... please wait&quot;); // XXX: belongs into command handler -- TODO: i18n
122>                       //alert(&quot;whee! about to save to &quot; + fileUrl);
123>                       var localCallback = function (status, params, responseText, url, xhr) {
124>                               if (!status) {
125>                                       displayMessage(&quot;saving failed: &quot; + responseText);
126>                               }
127>                       };
128>                       return httpReq(&quot;PUT&quot;, fileUrl, localCallback, null, null, content, &quot;text/html;charset=utf-8&quot;);
129>               };
130>
131>               // override convertUnicodeToFileFormat()
132>               convertUnicodeToFileFormat = function (s)
133>               {
134>                       return s;
135>               };
136>
137>       })(); //# end of wrapper
138> } //# end of &quot;install only once&quot;
139> //}}}
140> </pre>
141> </div>
142> <div title="PageTemplate" modifier="Zooko" created="200812152204" changecount="4">
143> <pre>&lt;!--{{{--&gt;
144> &lt;div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'&gt;
145> &lt;div class='headerShadow'&gt;
146> &lt;div id='accessControlExplanationDivId' macro='accessControlExplanation'&gt;&lt;/div&gt;
147> &lt;span class='siteTitle' refresh='content' tiddler='SiteTitle'&gt;&lt;/span&gt;&amp;nbsp;
148> &lt;span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'&gt;&lt;/span&gt;
149> &lt;/div&gt;
150> &lt;div class='headerForeground'&gt;
151> &lt;div id='accessControlExplanationDivId' macro='accessControlExplanation'&gt;&lt;/div&gt;
152> &lt;span class='siteTitle' refresh='content' tiddler='SiteTitle'&gt;&lt;/span&gt;&amp;nbsp;
153> &lt;span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'&gt;&lt;/span&gt;
154> &lt;/div&gt;
155> &lt;/div&gt;
156> &lt;div id='mainMenu' refresh='content' tiddler='MainMenu'&gt;&lt;/div&gt;
157> &lt;div id='sidebar'&gt;
158> &lt;div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'&gt;&lt;/div&gt;
159> &lt;div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'&gt;&lt;/div&gt;
160> &lt;/div&gt;
161> &lt;div id='displayArea'&gt;
162> &lt;div id='messageArea'&gt;&lt;/div&gt;
163> &lt;div id='tiddlerDisplay'&gt;&lt;/div&gt;
164> &lt;/div&gt;
165> &lt;!--}}}--&gt;</pre>
166> </div>
167> <div title="TahoePlugin" modifier="Zooko" created="200812152200" modified="200812152206" tags="systemConfig" changecount="5">
168> <pre>/***
169> |''Name''|HTTPSavingPlugin|
170> |''Description''|&lt;...&gt;|
171> |''Author''|Zooko|
172> |''Contributors''|FND|
173> |''Version''|0.2.1|
174> |''Status''|@@experimental@@|
175> |''Source''|http://allmydata.org/trac/tiddly_on_tahoe|
176> |''CodeRepository''|http://allmydata.org/source/tiddly_on_tahoe/trunk/|
177> |''License''|GPLv2+ or TGPPLv1.0+|
178> |''Keywords''|&lt;...&gt;|
179> !Description
180> &lt;...&gt;
181> !Notes
182> This plugin is being developed for [[Tiddly on Tahoe|http://allmydata.org/trac/tiddly_on_tahoe]].
183> ***/
184> /* The following comment is to let jslint know which variables are supposed to be global. */
185> /*global clearMessage, config, getPath, readOnly, saveChanges, saveTest, showBackstage, store, story, version, convertUriToUTF8, convertUnicodeToFileFormat, getLocalPath, loadRemoteFile, locateStoreArea, saveBackup, saveEmpty, saveFile, saveMain, saveRss, unescape, displayMessage, httpReq */
186> //{{{
187> if (!version.extensions.HTTPSavingPlugin) { //# ensure that the plugin is only installed once
188>       version.extensions.HTTPSavingPlugin = { installed: true };
189>
190>       (function () { //# wrapper
191>               readOnly = false;
192>               config.options.chkHttpReadOnly = false;
193>               showBackstage = true;
194>
195>               saveTest = function () {
196>                       var s = document.getElementById(&quot;saveTest&quot;);
197>                       /*if (s.hasChildNodes()) {
198>                         alert(config.messages.savedSnapshotError);
199>                         }*/
200>                       s.appendChild(document.createTextNode(&quot;savetest&quot;));
201>               };
202>
203>               // Save this TiddlyWiki with the pending changes
204>               saveChanges = function (onlyIfDirty, tiddlers) {
205>                       var originalPath, localCallback, result;
206>                       if (onlyIfDirty &amp;&amp; !store.isDirty()) {
207>                               return;
208>                       }
209>                       clearMessage();
210>                       // Get the URL of the document
211>                       originalPath = getPath(document.location.toString());
212>                       // Load the original file
213>                       localCallback = function (status, context, original, url, xhr) {
214>                               //log(&quot;loaded remote file from &quot;, originalPath);
215>                               /*log(&quot;got callback status &quot;, status, &quot;\n&quot;, context: &quot;, context, &quot;\n&quot;,
216>                                 URL: &quot;, url, &quot;\n&quot;, XHR: &quot;, xhr);*/
217>                               if (original === null) {
218>                                       alert(config.messages.cantSaveError);
219>                                       if (store.tiddlerExists(config.messages.saveInstructions)) {
220>                                               story.displayTiddler(null, config.messages.saveInstructions);
221>                                       }
222>                                       return;
223>                               }
224>                               // Locate the storeArea div's
225>                               var posDiv = locateStoreArea(original);
226>                               if (!posDiv) {
227>                                       alert(config.messages.invalidFileError.format([originalPath]));
228>                                       return;
229>                               }
230>                               saveRss(originalPath);
231>                               saveEmpty(originalPath, original, posDiv);
232>                               saveMain(originalPath, original, posDiv);
233>                       };
234>                       result = loadRemoteFile(originalPath, localCallback);
235>                       //log(&quot;result from loadRemoteFile: &quot;, result);
236>                       return true;
237>               };
238>
239>               // override and disable saveBackup()
240>               saveBackup = function (localPath, original) {};
241>
242>               // override and disable getLocalPath()
243>               getLocalPath = function (origPath) {};
244>
245>               // override getPath()
246>               getPath = function (origPath) {
247>                       var originalPath, argPos, hashPos, resultPath;
248>                       originalPath = convertUriToUTF8(origPath, config.options.txtFileSystemCharSet);
249>                       // Remove any location or query part of the URL
250>                       argPos = originalPath.indexOf(&quot;?&quot;);
251>                       if (argPos !== -1) {
252>                               originalPath = originalPath.substr(0, argPos);
253>                       }
254>                       hashPos = originalPath.indexOf(&quot;#&quot;);
255>                       if (hashPos !== -1) {
256>                               originalPath = originalPath.substr(0, hashPos);
257>                       }
258>                       // Convert file://localhost/ to file:///
259>                       if (originalPath.indexOf(&quot;file://localhost/&quot;) === 0) {
260>                               originalPath = &quot;file://&quot; + originalPath.substr(16);
261>                       }
262>                       // Convert to a native file format
263>                       if (originalPath.indexOf(&quot;http://&quot;) === 0) { // HTTP file
264>                               resultPath = originalPath;
265>                       } else if (originalPath.charAt(9) === &quot;:&quot;) { // PC local file
266>                               resultPath = unescape(originalPath.substr(8)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
267>                       } else if (originalPath.indexOf(&quot;file://///&quot;) === 0) { // Firefox PC network file
268>                               resultPath = &quot;\\\\&quot; + unescape(originalPath.substr(10)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
269>                       } else if (originalPath.indexOf(&quot;file:///&quot;) === 0) { // *nix local file
270>                               resultPath = unescape(originalPath.substr(7));
271>                       } else if (originalPath.indexOf(&quot;file:/&quot;) === 0) { // *nix local file
272>                               resultPath = unescape(originalPath.substr(5));
273>                       } else { // PC local file
274>                               resultPath = &quot;\\\\&quot; + unescape(originalPath.substr(7)).replace(new RegExp(&quot;/&quot;, &quot;g&quot;), &quot;\\&quot;);
275>                       }
276>                       return resultPath;
277>               };
278>
279>               // override saveFile()
280>               saveFile = function (fileUrl, content, callb) {
281>                       displayMessage(&quot;saving... please wait&quot;); // XXX: belongs into command handler -- TODO: i18n
282>                       //alert(&quot;whee! about to save to &quot; + fileUrl);
283>                       var localCallback = function (status, params, responseText, url, xhr) {
284>                               if (!status) {
285>                                       displayMessage(&quot;saving failed: &quot; + responseText);
286>                               }
287>                       };
288>                       return httpReq(&quot;PUT&quot;, fileUrl, localCallback, null, null, content, &quot;text/html;charset=utf-8&quot;);
289>               };
290>
291>               // override convertUnicodeToFileFormat()
292>               convertUnicodeToFileFormat = function (s)
293>               {
294>                       return s;
295>               };
296>
297>       })(); //# end of wrapper
298> } //# end of &quot;install only once&quot;
299> //}}}
300> /***
301> |''Name''|TahoePlugin|
302> |''Description''|&lt;...&gt;|
303> |''Author''|Zooko|
304> |''Contributors''|FND, EricShulman|
305> |''Version''|0.2.0|
306> |''Requires''|HTTPSavingPlugin|
307> |''Status''|@@experimental@@|
308> |''Source''|http://allmydata.org/trac/tiddly_on_tahoe|
309> |''CodeRepository''|http://allmydata.org/source/tiddly_on_tahoe/trunk/|
310> |''License''|GPLv2+ or TGPPLv1.0+|
311> |''Keywords''|&lt;...&gt;|
312> !Description
313> &lt;...&gt;
314> !Notes
315> This plugin is being developed for [[Tiddly on Tahoe|http://allmydata.org/trac/tiddly_on_tahoe]].
316> ***/
317> //{{{
318> /* The following comment is to let jslint know which variables are supposed to be global. */
319> /*global version, readOnly, showBackstage, config, loadRemoteFile, wikify */
320> if (!version.extensions.TahoePlugin) { //# ensure that the plugin is only installed once
321>       version.extensions.TahoePlugin = { installed: true };
322>
323>       (function () { //# wrapper
324>               var BASE32CHAR, BASE32CHAR_3bits, BASE32CHAR_1bits, SEP, NUMBER, HTTPLEAD, BASE32STR_128bits, BASE32STR_256bits, ALPHANUMERIC_STRING, TAHOE_FUTURE_IMMUTABLE_CAP_RE_STR, TAHOE_FUTURE_READONLY_CAP_RE_STR, TAHOE_FUTURE_WRITABLE_CAP_RE_STR, TAHOE_IMMUTABLE_CAP_RE_STR, TAHOE_READONLY_FILE_CAP_RE_STR, TAHOE_READONLY_DIR_CAP_RE_STR, TAHOE_WRITABLE_FILE_CAP_RE_STR, TAHOE_WRITABLE_DIR_CAP_RE_STR, TAHOE_NONWRITABLE_THING_CAP_RE_STR, TAHOE_WRITABLE_THING_CAP_RE_STR, TAHOE_ANY_CAP_RE_STR, splitTahoeURL, scrapeOutReadonlyCap, diminishToReadonlyCap, getReadonlyURLToThisPage;
325>
326>               BASE32CHAR = '[abcdefghijklmnopqrstuvwxyz234567]';
327>               BASE32CHAR_3bits = '[aqiyemu4]';
328>               BASE32CHAR_1bits = '[aq]';
329>               SEP = '(?::|%3A)';
330>               NUMBER = '[0-9]+';
331>               HTTPLEAD = 'https?://(?:[^:/]+)(?::' + NUMBER + ')?/(uri|file|cap)/?';
332>
333>               BASE32STR_128bits = '(' + BASE32CHAR + '{25}' + BASE32CHAR_3bits + ')';
334>               BASE32STR_256bits = '(' + BASE32CHAR + '{51}' + BASE32CHAR_1bits + ')';
335>
336>               ALPHANUMERIC_STRING = '[A-Za-z0-9]+';
337>
338>               // This is speculative: maybe in the future there will be a version of Tahoe where caps
339>               // start with these symbols, and if so then this JavaScript code will magically work with
340>               // that version of Tahoe.
341>               TAHOE_FUTURE_IMMUTABLE_CAP_RE_STR = &quot;i_&quot; + ALPHANUMERIC_STRING;
342>               TAHOE_FUTURE_READONLY_CAP_RE_STR = &quot;r_&quot; + ALPHANUMERIC_STRING;
343>               TAHOE_FUTURE_WRITABLE_CAP_RE_STR = &quot;W_&quot; + ALPHANUMERIC_STRING;
344>
345>               TAHOE_IMMUTABLE_CAP_RE_STR = &quot;(?:URI&quot; + SEP + &quot;CHK&quot; + SEP + BASE32STR_128bits + SEP + BASE32STR_256bits + SEP + NUMBER + SEP + NUMBER + SEP + NUMBER + '|' + TAHOE_FUTURE_IMMUTABLE_CAP_RE_STR + ')';
346>               TAHOE_READONLY_FILE_CAP_RE_STR = &quot;URI&quot; + SEP + &quot;SSK-RO&quot; + SEP + BASE32STR_128bits + SEP + BASE32STR_256bits;
347>               TAHOE_READONLY_DIR_CAP_RE_STR = &quot;URI&quot; + SEP + &quot;DIR2-RO&quot; + SEP + BASE32STR_128bits + SEP + BASE32STR_256bits;
348>               TAHOE_WRITABLE_FILE_CAP_RE_STR = &quot;URI&quot; + SEP + &quot;SSK&quot; + SEP + BASE32STR_128bits + SEP + BASE32STR_256bits;
349>               TAHOE_WRITABLE_DIR_CAP_RE_STR = &quot;URI&quot; + SEP + &quot;DIR2&quot; + SEP + BASE32STR_128bits + SEP + BASE32STR_256bits;
350>
351>               TAHOE_NONWRITABLE_THING_CAP_RE_STR = '(' + TAHOE_READONLY_FILE_CAP_RE_STR + '|' + TAHOE_READONLY_DIR_CAP_RE_STR + '|' + TAHOE_IMMUTABLE_CAP_RE_STR + '|' + TAHOE_FUTURE_IMMUTABLE_CAP_RE_STR + '|' + TAHOE_FUTURE_READONLY_CAP_RE_STR + ')';
352>               TAHOE_WRITABLE_THING_CAP_RE_STR = '(' + TAHOE_WRITABLE_DIR_CAP_RE_STR + '|' + TAHOE_WRITABLE_FILE_CAP_RE_STR + '|' + TAHOE_FUTURE_WRITABLE_CAP_RE_STR + ')';
353>
354>               TAHOE_ANY_CAP_RE_STR = '(' + TAHOE_NONWRITABLE_THING_CAP_RE_STR + '|' + TAHOE_WRITABLE_THING_CAP_RE_STR + ')';
355>
356>               readOnly = document.location.toString().match(new RegExp(HTTPLEAD + TAHOE_NONWRITABLE_THING_CAP_RE_STR));
357>               showBackstage = !readOnly;
358>               config.options.chkHttpReadOnly = false;
359>               
360>               /* Returns server (which is &quot;http://$HOST:$PORT/uri&quot;), cap, and suffix, which can be a
361>                  path from the cap through the tahoe filesystem and/or trailing extra arguments. */
362>               splitTahoeURL = function (someURL) {
363>                       var u, urlSuffix, candidate_cap, urlPrefix;
364>
365>                       u = someURL.split('/');
366>                       urlSuffix = [];
367>                       candidate_cap = u.pop();
368>                       urlPrefix = u.join('/');
369>                       while ((u.length &gt; 0) &amp;&amp; (!urlPrefix.match(new RegExp(&quot;^&quot; + HTTPLEAD + &quot;$&quot;)))) {
370>                               urlSuffix.unshift(candidate_cap);
371>                               candidate_cap = u.pop();
372>                               urlPrefix = u.join('/');
373>                       }
374>                       // Okay we've found the HTTPLEAD.  Is the following thing shaped like a Tahoe capability?
375>                       if (candidate_cap.match(new RegExp(TAHOE_ANY_CAP_RE_STR))) {
376>                               // Yes!
377>                               return {'urlPrefix': urlPrefix, 'cap': candidate_cap, 'urlSuffix': urlSuffix};
378>                       } else {
379>                               // No!
380>                               return;
381>                       }
382>               };
383>
384>               scrapeOutReadonlyCap = function (metadata) {
385>                       // example of tahoe-lafs json-encoded metadata:
386>                       // [
387>                       // &quot;dirnode&quot;,
388>                       // {
389>                       //  &quot;rw_uri&quot;: &quot;URI:DIR2:ouojn4oj2fa7fphdf54hz5bfaq:rf56nzb6klj3ctvssqghy2ugalp6wundystbysxujodttrhxbqwa&quot;,
390>                       //  &quot;ro_uri&quot;: &quot;URI:DIR2-RO:sznrgoyz7lbjorhe4ipzcnmluy:rf56nzb6klj3ctvssqghy2ugalp6wundystbysxujodttrhxbqwa&quot;,
391>                       //  &quot;children&quot;: {
392>                       //   &quot;tw_empty.html&quot;: [
393>                       //    &quot;filenode&quot;,
394>                       //    {
395>                       //     &quot;mutable&quot;: false,
396>                       //     &quot;metadata&quot;: {
397>                       //      &quot;ctime&quot;: 1229263396.69,
398>                       //      &quot;mtime&quot;: 1229263396.69
399>                       //     },
400>                       //     &quot;ro_uri&quot;: &quot;URI:CHK:cofm2lm3ywu4r4efeqwjzuzyeq:dfw7oi65smf7dhtcx6wvr4ouazswprhwkvc3uopqtmvn3e7cactq:3:10:295520&quot;,
401>                       //     &quot;size&quot;: 295520
402>                       //    }
403>                       //   ]
404>                       //  },
405>                       //  &quot;mutable&quot;: true
406>                       // }
407>                       //]
408>
409>                       // another example:
410>                       // [
411>                       //  &quot;filenode&quot;,
412>                       //  {
413>                       //   &quot;rw_uri&quot;: &quot;URI:SSK:ouojn4oj2fa7fphdf54hz5bfaq:rf56nzb6klj3ctvssqghy2ugalp6wundystbysxujodttrhxbqwa&quot;,
414>                       //   &quot;mutable&quot;: true,
415>                       //   &quot;ro_uri&quot;: &quot;URI:SSK-RO:sznrgoyz7lbjorhe4ipzcnmluy:rf56nzb6klj3ctvssqghy2ugalp6wundystbysxujodttrhxbqwa&quot;,
416>                       //   &quot;size&quot;: &quot;?&quot;
417>                       //  }
418>                       // ]
419>                       var matchobj = metadata.match(new RegExp(&quot;^\\s*\\[[^\\[]*\&quot;ro_uri\&quot;\\s*:\\s*\&quot;([^\&quot;]*)\&quot;&quot;));
420>                       if (matchobj) {
421>                               return matchobj[1];
422>                       }
423>               };
424>
425>               diminishToReadonlyCap = function (urlPrefix, writableCap, callback) {
426>                       var queryURL = [urlPrefix, writableCap, &quot;?t=json&quot;].join(&quot;/&quot;);
427>
428>                       loadRemoteFile(queryURL, function (success, param, txt, src, xhr) {
429>                               if (success) {
430>                                       callback(scrapeOutReadonlyCap(txt));
431>                               }
432>                       });
433>               };
434>     
435>               getReadonlyURLToThisPage = function (callback) {
436>                       if (document.location.tahoeDiminishedCapabilityURL) {
437>                               return callback(document.location.tahoeDiminishedCapabilityURL);
438>                       } else {
439>                               var pieces = splitTahoeURL(document.location.toString());
440>                               diminishToReadonlyCap(pieces.urlPrefix, pieces.cap, function (diminishedCap) {
441>                                       var diminishedURL = pieces.urlPrefix + &quot;/&quot; + diminishedCap + &quot;/&quot; + pieces.urlSuffix;
442>                                       document.location.tahoeDiminishedCapabilityURL = diminishedURL;
443>                                       callback(diminishedURL);
444>                               });
445>                       }
446>               };
447>
448>               config.macros.accessControlExplanation = {
449>       
450>                       handler: function (place, macroName, params, wikifier, paramString, tiddler) {
451>                               if (document.location.toString().match(new RegExp(HTTPLEAD + TAHOE_IMMUTABLE_CAP_RE_STR))) {
452>                                       wikify(&quot;This is an immutable view of this page.  Using this link will always give this exact same page, even if a newer version has been uploaded.&quot;, place);
453>                               } else if (document.location.toString().match(new RegExp(HTTPLEAD + TAHOE_NONWRITABLE_THING_CAP_RE_STR))) {
454>                                       wikify(&quot;This is a read-only view of this page.  Using this link will give the most recent version of this page, but doesn't allow the user to change the page.&quot;, place);
455>                               } else if (document.location.toString().match(new RegExp(HTTPLEAD + TAHOE_WRITABLE_THING_CAP_RE_STR))) {
456>                                       getReadonlyURLToThisPage(function (readonlyCap) {
457>                                               wikify(&quot;You are accessing this page with a writable link.  If you share this link with someone else, they will gain the ability to write to this page.  Click here for a [[read-only link to this page|&quot; + readonlyCap + &quot;]].&quot;, place);
458>                                       });
459>                               } else {
460>                                       wikify(&quot;You are accessing this page not through the Tahoe-LAFS secure, distributed filesystem.&quot;, place);
461>                               }
462>                       }
463>               };
464>       })(); //# end of wrapper
465> } //# end of &quot;install only once&quot;
466> //}}}
467> </pre>
468> </div>
469> <div title="WritableTheme" modifier="Zooko" created="200812152209" modified="200812152255" tags="systemTheme" changecount="12">
470> <pre>|StyleSheet|##AuthorStyles|
471> |StyleSheetReadOnly|##ReaderStyles|
472>
473> !AuthorStyles
474> /*{{{*/
475> [[StyleSheet]]
476> body {
477>       background: #eee;
478> }
479> /*}}}*/
480>
481> !ReaderStyles
482> /*{{{*/
483> [[StyleSheet]]
484> body {
485> }
486> /*}}}*/</pre>
487> </div>