mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-27 02:20:28 +00:00
Merge pull request #1793 from sukima/feature/dropbox-url
Add ability to auto generate Dropbox URL
This commit is contained in:
commit
317f92b8a2
@ -1,5 +1,5 @@
|
||||
created: 20140122085818089
|
||||
modified: 20140919160722247
|
||||
modified: 20150608032039504
|
||||
tags: Learning
|
||||
title: Sharing a TiddlyWiki on Dropbox
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -15,3 +15,11 @@ You can work on a TiddlyWiki file in Dropbox and publish a URL that anyone can u
|
||||
#> `https://dl.dropboxusercontent.com/s/<gobbledegook>/mywiki.html`
|
||||
|
||||
The result is a "secret" URL that you can send to other people to enable them to see the wiki.
|
||||
|
||||
----
|
||||
|
||||
Enter a generated URL here and you can copy and paste the secret URL:
|
||||
|
||||
<$edit-text tiddler="$:/temp/dropboxurl" default="https://www.dropbox.com/s/<gobbledegook>/mywiki.html" tag="input" type="text" size="60"/>
|
||||
|
||||
<$macrocall $name="dropbox-url" url={{$:/temp/dropboxurl}}/>
|
||||
|
39
editions/tw5.com/tiddlers/system/dropbox-url-macro.tid
Normal file
39
editions/tw5.com/tiddlers/system/dropbox-url-macro.tid
Normal file
@ -0,0 +1,39 @@
|
||||
created: 20150607235625799
|
||||
modified: 20150608032345215
|
||||
module-type: macro
|
||||
tags: $:/tags/Macro
|
||||
title: $:/edition/tw5.com/dropbox-url.js
|
||||
type: application/javascript
|
||||
|
||||
/*\
|
||||
title: $:/edition/tw5.com/dropbox-url.js
|
||||
type: application/javascript
|
||||
tags: $:/tags/Macro
|
||||
module-type: macro
|
||||
|
||||
Implements the Dropbox URL converter macro.
|
||||
|
||||
```
|
||||
<$macrocall $name="dropbox-url" url={{$:/temp/dropbox}}/>
|
||||
```
|
||||
|
||||
\*/
|
||||
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.name = "dropbox-url";
|
||||
|
||||
exports.params = [
|
||||
{name: "url", default: "https://www.dropbox.com/s/<gobbledegook>/mywiki.html"}
|
||||
];
|
||||
|
||||
exports.run = function(url) {
|
||||
url = url.replace("www.dropbox.com", "dl.dropboxusercontent.com");
|
||||
return "`" + url + "` <small>([[open|" + url + "]])</small>";
|
||||
};
|
||||
|
||||
})();
|
Loading…
Reference in New Issue
Block a user