mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-01 15:46:18 +00:00
40 lines
792 B
Plaintext
40 lines
792 B
Plaintext
|
created: 20160417162545133
|
||
|
modified: 20160417162810899
|
||
|
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/<blablabla>/mi_archivo.html"}
|
||
|
];
|
||
|
|
||
|
exports.run = function(url) {
|
||
|
url = url.replace("www.dropbox.com","dl.dropboxusercontent.com");
|
||
|
return "`" + url + "` <small>([[abrir|" + url + "]])</small>";
|
||
|
};
|
||
|
|
||
|
})();
|