My HTML-insert editor button doesn't work

48 views
Skip to first unread message

Aidan Grey

unread,
Jun 26, 2019, 5:43:03 PM6/26/19
to TiddlyWiki
Heya,

I'm trying to create an editor toolbar button that will add some predefined html/css text, and it's not working quite right. I can't figure out what I'm doing wrong. 

The code:

<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text="<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="ylw"></span>
<span class="wht"></span>
<span class="ylw"></span>"
/>

In the image attached, you'll see that I also tried escaping characters, but I still have the same issue - all of the contents of the tiddler appear IN the button. Further, it doesn't do anything. If I click that mess of a button, nothing happens.

What am I doing wrong?

Thanks,
Aidan





cwBtn.PNG

Aidan Grey

unread,
Jun 26, 2019, 5:46:19 PM6/26/19
to TiddlyWiki
And yes, I have tiddlers for the classes that work fine if I type them in manually.

And example of one tiddler, tagged $:/tags/Stylesheet:

.blk {
	height: 20px;  
	width: 20px; 
	border-style: solid;  
	background-color: black;
	border-radius: 50%;  
	border-width: thin;
	border-color: black;  
	display: inline-block;
}

TonyM

unread,
Jun 26, 2019, 6:31:25 PM6/26/19
to TiddlyWiki
In your text operation the " are miss balanced. Try replacing the outer " with a """ html here can "use" single quotes """

Or ' vs " etc..

Regards
Tony

Mat

unread,
Jun 26, 2019, 8:04:00 PM6/26/19
to TiddlyWiki
Yeah, what Tony sez;

<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text="""<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="ylw"></span>
<span class="wht"></span>
<span class="ylw"></span>"""
/>

<:-) 

Aidan Grey

unread,
Jun 27, 2019, 12:30:19 AM6/27/19
to tiddl...@googlegroups.com
You guys are teh awesumz!! That did it! Thanks!

So why does there need to be three? Is it one of those escape character sort of things? With Double quotes escaping to a single quote?

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/9gwnxhPBjoc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1b2d1b5e-c86d-47ef-9e37-5a9a316111e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TonyM

unread,
Jun 27, 2019, 2:46:26 AM6/27/19
to TiddlyWiki
Aiden
In some ways it is just the necessary standards to make it work, and is common on many systems.

See https://tiddlywiki.com/#HTML%20in%20WikiText attributes 

Literal Attribute Values


None (if no whitespace), ', " then """ work, no "" available.

"works 'like this' or" 
'works "like this" or'

etc...
Regards
Tony 


On Thursday, June 27, 2019 at 2:30:19 PM UTC+10, Aidan Grey wrote:
You guys are teh awesumz!! That did it! Thanks!

So why does there need to be three? Is it one of those escape character sort of things? With Double quotes escaping to a single quote?

On Wed, Jun 26, 2019 at 6:04 PM Mat <matia...@gmail.com> wrote:
Yeah, what Tony sez;

<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text="""<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="blk"></span>
<span class="ylw"></span>
<span class="wht"></span>
<span class="ylw"></span>"""
/>

<:-) 

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/9gwnxhPBjoc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages