Sha256: baccd311c6b319dac2af13883f14d48a123558a9e92800481c934a630468ee3b
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
rbbt.mview = {} rbbt.mview.plot = function(content, title, caption){ var plot if (undefined === title){ plot = m('figure.ui.segment', m('.header', 'No figure to display')) }else{ if (title == 'loading'){ plot = m('figure.ui.segment.loading', 'loading figure') }else{ var elems = [] var img_title = title if (! img_title) img_title = 'image' else img_title = img_title.replace(': ', ' ') var img_filename = img_title + '.svg' var download_func = function(){ var blob = new Blob([content], {type: "image/svg+xml;charset=utf-8"}); return saveAs(blob, img_filename); } var download = m('.download.ui.labeled.icon.button',{onclick: download_func}, [m('i.icon.download'), "Download"]) if (title) elems.push(m('.ui.header', title)) elems.push(m('.content.svg', m.trust(content))) if (caption) elems.push(m('figcaption', m.trust(caption))) if (content) elems.push(download) plot = m('figure.ui.segment', elems) } } return plot } rbbt.mview.button = function(options,args){ return m('.ui.button', options, args) } rbbt.mview.ibutton = function(options,args){ return m('.ui.icon.button', options, args) } rbbt.mview.dropdown = function(name, options){ return m('.ui.dropdown.item', [m('i.icon.dropdown'), name, m('.menu', options)]) }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rbbt-rest-1.6.9 | share/views/public/js/rbbt.views.js |