cartodb/lib/assets/javascripts/builder/components/modals/publish/create-share-options.js
2020-06-15 10:58:47 +08:00

22 lines
804 B
JavaScript
Executable File

var linkIconTemplate = require('./icon-link.tpl');
var embedIconTemplate = require('./icon-embed.tpl');
module.exports = function (visDefinitionModel) {
return [{
createIcon: function () {
return linkIconTemplate();
},
type: 'get-link',
content: visDefinitionModel.embedURL(),
private: visDefinitionModel.get('privacy') === 'PRIVATE'
}, {
createIcon: function () {
return embedIconTemplate();
},
type: 'embed',
content: '<iframe width="100%" height="520" frameborder="0" src="' + encodeURI(visDefinitionModel.embedURL()) + '" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>',
url: encodeURI(visDefinitionModel.embedURL()),
private: visDefinitionModel.get('privacy') === 'PRIVATE'
}];
};