2013-10-17 15:57:07 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/macros/makedatauri.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: macro
|
|
|
|
|
2016-04-14 22:02:40 +00:00
|
|
|
Macro to convert a string of text to a data URI
|
2013-10-17 15:57:07 +00:00
|
|
|
|
|
|
|
<<makedatauri text:"Text to be converted" type:"text/vnd.tiddlywiki">>
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
Information about this macro
|
|
|
|
*/
|
|
|
|
|
|
|
|
exports.name = "makedatauri";
|
|
|
|
|
|
|
|
exports.params = [
|
|
|
|
{name: "text"},
|
|
|
|
{name: "type"}
|
|
|
|
];
|
|
|
|
|
|
|
|
/*
|
|
|
|
Run the macro
|
|
|
|
*/
|
|
|
|
exports.run = function(text,type) {
|
2015-03-18 11:40:09 +00:00
|
|
|
return $tw.utils.makeDataUri(text,type);
|
2013-10-17 15:57:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|