diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 8fbaf59cc..6c8d989fa 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -56,7 +56,7 @@ Saving/TiddlySpot/Backups: Backups Saving/TiddlySpot/Description: These settings are only used when saving to http://tiddlyspot.com or a compatible remote server Saving/TiddlySpot/Filename: Upload Filename Saving/TiddlySpot/Heading: ~TiddlySpot -Saving/TiddlySpot/Hint: //The server URL defaults to `http://.tiddlyspot.com/store.cgi` and can be changed to use a custom server address// +Saving/TiddlySpot/Hint: //The server URL defaults to `http://.tiddlyspot.com/store.cgi` and can be changed to use a custom server address, e.g. `http://me.com/store.php`.// Saving/TiddlySpot/Password: Password Saving/TiddlySpot/ServerURL: Server URL Saving/TiddlySpot/UploadDir: Upload Directory diff --git a/core/modules/macros/resolvepath.js b/core/modules/macros/resolvepath.js new file mode 100644 index 000000000..d84d87563 --- /dev/null +++ b/core/modules/macros/resolvepath.js @@ -0,0 +1,29 @@ +/*\ +title: $:/core/modules/macros/resolvepath.js +type: application/javascript +module-type: macro + +Resolves a relative path for an absolute rootpath. + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = "resolvepath"; + +exports.params = [ + {name: "source"}, + {name: "root"} +]; + +/* +Run the macro +*/ +exports.run = function(source, root) { + return $tw.utils.resolvePath(source, root); +}; + +})(); diff --git a/core/ui/ControlPanel/Saving.tid b/core/ui/ControlPanel/Saving.tid index 10583513d..5c54b37df 100644 --- a/core/ui/ControlPanel/Saving.tid +++ b/core/ui/ControlPanel/Saving.tid @@ -9,7 +9,12 @@ http://$(userName)$.tiddlyspot.com/backup/ \define backupLink() <$reveal type="nomatch" state="$:/UploadName" text=""> <$set name="userName" value={{$:/UploadName}}> ->><$macrocall $name="backupURL" $type="text/plain" $output="text/plain"/> +<$reveal type="match" state="$:/UploadURL" text=""> +<> + +<$reveal type="nomatch" state="$:/UploadURL" text=""> +<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>> + \end @@ -28,5 +33,4 @@ http://$(userName)$.tiddlyspot.com/backup/ |<> |<$edit-text tiddler="$:/UploadDir" default="." tag="input"/> | |<> |<$edit-text tiddler="$:/UploadBackupDir" default="." tag="input"/> | -<> - +<> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/macros/ResolvePath.tid b/editions/tw5.com/tiddlers/macros/ResolvePath.tid new file mode 100644 index 000000000..be0a2951f --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/ResolvePath.tid @@ -0,0 +1,23 @@ +created: 20150203152000000 +modified: 20150203152000000 +title: ResolvePath +type: text/vnd.tiddlywiki +caption: resolvepath + +The ''resolvepath'' macro constructs a url for a relative source path with respect to an absolute root path, trailing filenames being cut-off. + +! Parameters + +|!Position |!Name |!Description |!Default | +|1st |source |the relative path to be appended| | +|2nd |root |the absolute path to be appended to | | + +! Examples + +A trivial example to show how the macro works: + +``` +<> +``` + +<> \ No newline at end of file