Skip to content

Commit

Permalink
fixes to graph insertion (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored May 2, 2018
1 parent b7d8bf4 commit f5f5492
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/PublicLab.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22317,10 +22317,14 @@ module.exports = function(textarea, _editor, _module) {

mergeHtmlAndAttachment: function (chunks, link) {
var linkText = chunks.selection || link.title;
console.log(link, chunks)
if (false) console.log(link)
if (link.href.match('.csv')) { // displaying csvs in graphs
if (wysiwyg.mode === 'markdown') var output = '[graph:' + link.href + ']';
else var output = '<div class="powertags">Power tag: graph:' + link.href + '</div>';
return {
before: chunks.before,
selection: '[graph:' + link.href + ']',
selection: output,
after: chunks.after,
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "publiclab-editor",
"version": "1.2.2",
"version": "1.2.3",
"description": "PublicLab.Editor is a general purpose, JavaScript/Bootstrap UI framework for rich text posting, which provides an author-friendly, minimal, mobile/desktop (fluid) interface for creating blog-like content, designed for PublicLab.org",
"main": "dist/PublicLab.Editor.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/adapters/PublicLab.Woofmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,14 @@ module.exports = function(textarea, _editor, _module) {

mergeHtmlAndAttachment: function (chunks, link) {
var linkText = chunks.selection || link.title;
console.log(link, chunks)
if (false) console.log(link)
if (link.href.match('.csv')) { // displaying csvs in graphs
if (wysiwyg.mode === 'markdown') var output = '[graph:' + link.href + ']';
else var output = '<div class="powertags">Power tag: graph:' + link.href + '</div>';
return {
before: chunks.before,
selection: '[graph:' + link.href + ']',
selection: output,
after: chunks.after,
}
} else {
Expand Down

0 comments on commit f5f5492

Please sign in to comment.