From f5f5492e5188963b0d6b672fc60093cef34c065c Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Wed, 2 May 2018 00:16:35 -0400 Subject: [PATCH] fixes to graph insertion (#141) --- dist/PublicLab.Editor.js | 6 +++++- package.json | 2 +- src/adapters/PublicLab.Woofmark.js | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/PublicLab.Editor.js b/dist/PublicLab.Editor.js index 2c567930..a7dd3dd5 100644 --- a/dist/PublicLab.Editor.js +++ b/dist/PublicLab.Editor.js @@ -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 = '
Power tag: graph:' + link.href + '
'; return { before: chunks.before, - selection: '[graph:' + link.href + ']', + selection: output, after: chunks.after, } } else { diff --git a/package.json b/package.json index 1b830738..16395f4f 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/adapters/PublicLab.Woofmark.js b/src/adapters/PublicLab.Woofmark.js index 98140635..aa90caae 100644 --- a/src/adapters/PublicLab.Woofmark.js +++ b/src/adapters/PublicLab.Woofmark.js @@ -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 = '
Power tag: graph:' + link.href + '
'; return { before: chunks.before, - selection: '[graph:' + link.href + ']', + selection: output, after: chunks.after, } } else {