1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 10:00:34 +00:00

Merge pull request #1793 from sukima/feature/dropbox-url

Add ability to auto generate Dropbox URL
This commit is contained in:
Jeremy Ruston 2015-06-15 10:02:26 +01:00
commit 317f92b8a2
2 changed files with 48 additions and 1 deletions

View File

@ -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}}/>

View 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>";
};
})();