Skip to content

Commit f5f5492

Browse files
authored
fixes to graph insertion (#141)
1 parent b7d8bf4 commit f5f5492

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

dist/PublicLab.Editor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22317,10 +22317,14 @@ module.exports = function(textarea, _editor, _module) {
2231722317

2231822318
mergeHtmlAndAttachment: function (chunks, link) {
2231922319
var linkText = chunks.selection || link.title;
22320+
console.log(link, chunks)
22321+
if (false) console.log(link)
2232022322
if (link.href.match('.csv')) { // displaying csvs in graphs
22323+
if (wysiwyg.mode === 'markdown') var output = '[graph:' + link.href + ']';
22324+
else var output = '<div class="powertags">Power tag: graph:' + link.href + '</div>';
2232122325
return {
2232222326
before: chunks.before,
22323-
selection: '[graph:' + link.href + ']',
22327+
selection: output,
2232422328
after: chunks.after,
2232522329
}
2232622330
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "publiclab-editor",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"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",
55
"main": "dist/PublicLab.Editor.js",
66
"scripts": {

src/adapters/PublicLab.Woofmark.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ module.exports = function(textarea, _editor, _module) {
139139

140140
mergeHtmlAndAttachment: function (chunks, link) {
141141
var linkText = chunks.selection || link.title;
142+
console.log(link, chunks)
143+
if (false) console.log(link)
142144
if (link.href.match('.csv')) { // displaying csvs in graphs
145+
if (wysiwyg.mode === 'markdown') var output = '[graph:' + link.href + ']';
146+
else var output = '<div class="powertags">Power tag: graph:' + link.href + '</div>';
143147
return {
144148
before: chunks.before,
145-
selection: '[graph:' + link.href + ']',
149+
selection: output,
146150
after: chunks.after,
147151
}
148152
} else {

0 commit comments

Comments
 (0)