How do I place a hidden HTML placement
Moderators: dorpond, trevor, Azhrei
Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
How do I place a hidden HTML placement
I have HTML code that is cached somewhere on my tokens.
I need to place a bookmark tag that may in the future identify the location of other HTML code that I will insert at that location. For now I would like this placeholder to be perfectly invisible. Can it be done?
Here's an example: suppose I have the following simple HTML code.
I may want to insert/change the code between the 2 <td></td> tags at a future date (see the blue line).
What should I put in the blue line to make this perfectly invisible.
. <table width='100%'>
. . <td width='50%' align='right'>
. . . <span style='font:11pt Tahoma; color:2C3539'>Part 1
. . . </span>
. . </td>
Future tag will go here
. . <td width='50%' align='left'>
. . . <span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
. . . </span>
. . </td>
. </table>
I need to place a bookmark tag that may in the future identify the location of other HTML code that I will insert at that location. For now I would like this placeholder to be perfectly invisible. Can it be done?
Here's an example: suppose I have the following simple HTML code.
I may want to insert/change the code between the 2 <td></td> tags at a future date (see the blue line).
What should I put in the blue line to make this perfectly invisible.
. <table width='100%'>
. . <td width='50%' align='right'>
. . . <span style='font:11pt Tahoma; color:2C3539'>Part 1
. . . </span>
. . </td>
Future tag will go here
. . <td width='50%' align='left'>
. . . <span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
. . . </span>
. . </td>
. </table>
Re: How do I place a hidden HTML placement
<!-- Future tag will go here -->
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How do I place a hidden HTML placement
Not quite the same though. Take a look at the picture of the chat window below -
The first line does not have your tag suggestion in it. The second line does. Graphically, they're not the same.
The first line does not have your tag suggestion in it. The second line does. Graphically, they're not the same.
Code: Select all
[H: HTML = "<table width='100%'>
<td width='50%' align='right'><span style='font:11pt Tahoma; color:2C3539'>Part 1</span></td>
<!-- Future tag will go here -->
<td width='50%' align='left'><span style='font:bold 11pt Tahoma; color:2C3539'>Part 2</span></td>
</table>"]
[H: broadcast(HTML)]
Re: How do I place a hidden HTML placement
You forgot<tr> tags
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How do I place a hidden HTML placement
That didn't make a difference either...
Code: Select all
. <table width='100%'>
. . <tr>
. . . <td width='50%' align='right'>
. . . . <span style='font:11pt Tahoma; color:2C3539'>Part 1
. . . . </span>
. . . </td>
. . . <!-- Future tag will go here -->
. . . . <td width='50%' align='left'>
. . . . . <span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
. . . . . </span>
. . . . </td>
. . . </tr>
. . </table>
Code: Select all
. <table width='100%'>
. . <tr>
. . . <td width='50%' align='right'>
. . . . <span style='font:11pt Tahoma; color:2C3539'>Part 1
. . . . </span>
. . . </td>
. . . <td width='50%' align='left'>
. . . . <span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
. . . . </span>
. . . </td>
. . </tr>
. </table>
Re: How do I place a hidden HTML placement
ok that really does not make sense. Well, then the only thing left is brute force (perhaps AM has some intellect on this, I'm lost):
Code: Select all
[h:html="
<table width='100%'>
<tr>
<td width='50%' align='right'>
<span style='font:11pt Tahoma; color:2C3539'>Part 1</span>
</td>
<!-- Future tag will go here -->
<td width='50%' align='left'>
<span style='font:bold 11pt Tahoma; color:2C3539'>Part 2</span>
</td>
</tr>
</table>
<table width='100%'>
<tr>
<td width='50%' align='right'>
<span style='font:11pt Tahoma; color:2C3539'>Part 1</span>
</td>
<td width='50%' align='left'>
<span style='font:bold 11pt Tahoma; color:2C3539'>Part 2</span>
</td>
</tr>
</table>
"]
[H: broadcast(replace(HTML,"<!-- Future tag will go here -->",""))]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How do I place a hidden HTML placement
Thanks for trying Wolph.
Re: How do I place a hidden HTML placement
What's the purpose of the tag. Is it just for your benefit or do you plan on using the text to do a string substitution?
I would put ALL the html in to variable. Also, if you plan on putting a new column there you'll have to edit the other column widths. I made the column styles in to a variable so if you ever want to change the style you only need to it once.
Depending on the characters in the parts you can do some filtering or change some characters to html entities so it is displayed correctly. You can even make the html table dynamic where the parts are in an array and you just loop to insert it in to table. There a million ways to do this. I like building output in to json arrays and using json.toList to output it.
I would put ALL the html in to variable. Also, if you plan on putting a new column there you'll have to edit the other column widths. I made the column styles in to a variable so if you ever want to change the style you only need to it once.
Depending on the characters in the parts you can do some filtering or change some characters to html entities so it is displayed correctly. You can even make the html table dynamic where the parts are in an array and you just loop to insert it in to table. There a million ways to do this. I like building output in to json arrays and using json.toList to output it.
Code: Select all
[H: colStyle = "font:bold 11pt Tahoma; color:#2C3539"]
[H: Part1 = "Part 1"]
[H: Part2 = "Part 2"]
<!-- Part 1 -->
[H: myTableOutput = strformat('
<table width="100%">
<tr>
<td width="50%" align="right">
<span style="%{colStyle}">%{Part 1}</span>
</td>
')]
<!-- Insert X HTML code here -->
<!-- Part 2 -->
[H: myTableOutput = json.append(myTableOutput,strformat('
<td width="50%" align="left">
<span style="%{colStyle}">%{Part 2}</span>
</td>
</tr>
</table>
'))]
<!-- ouput html -->
[R: json.toList(myTableOutput,"")]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: How do I place a hidden HTML placement
The example above is just a simple illustration for the purpose of my enquiry.
I'm trying to build is a quick character sheet update technique. Basically the sheet is composed of many components, each identified by a tag, for example:
If the '123' component has changed, I zoom in and replace only the part of the larger HTML code that is encapsulated by the <span id='123'>...</span id='123'> tag. I don't have to recreate an array of components (there are 1000s of them on one sheet) - just the one identified by the id# 123.
What I need to do is put in "invisible" placeholders that can later be inserted with the desired HTML. For example, not every class has spells, so I would like to leave an invisible tag for spell casting features somewhere in the larger HTML code, that could one day be inserted with other HTML code if the character has chosen some spells.
I'm trying to build is a quick character sheet update technique. Basically the sheet is composed of many components, each identified by a tag, for example:
Code: Select all
<span id='123'>...</span id='123'><span id='456'>...</span id='456'>...etc.
What I need to do is put in "invisible" placeholders that can later be inserted with the desired HTML. For example, not every class has spells, so I would like to leave an invisible tag for spell casting features somewhere in the larger HTML code, that could one day be inserted with other HTML code if the character has chosen some spells.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: How do I place a hidden HTML placement
I've had many problems with proper formatting when using table width percentages in the past.
Would you have the same problem if you used pixel fixed widths?
Would you have the same problem if you used pixel fixed widths?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: How do I place a hidden HTML placement
The % width in the example is irrelevant, and the pixel width is even more complicated to deal with. I just wanted to illustrate that the "invisible" placement is not exactly unnoticeable.
For my particular situation I do have a way to work around it: instead of replacing the invisible html, I can always insert the html right after the previously id'ed html component. It involves a bit more computational work, but not too much more.
Example:
Suppose my fullHTML code looks like this:
....<id=123> something </id=123><id=456><id=789>something else</id=789>....
And I want to replace the red code.
Instead of: fullHTML = replace(HTML, "<id=456>", newHTML) I have a function called INSERT(fullHTML, searchID, newHTML, afterID)
So here it would be: fullHTML = INSERT(fullHTML, 456, newHTML, 123)
For my particular situation I do have a way to work around it: instead of replacing the invisible html, I can always insert the html right after the previously id'ed html component. It involves a bit more computational work, but not too much more.
Example:
Suppose my fullHTML code looks like this:
....<id=123> something </id=123><id=456><id=789>something else</id=789>....
And I want to replace the red code.
Instead of: fullHTML = replace(HTML, "<id=456>", newHTML) I have a function called INSERT(fullHTML, searchID, newHTML, afterID)
So here it would be: fullHTML = INSERT(fullHTML, 456, newHTML, 123)
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: How do I place a hidden HTML placement
Not so sure it is.nirkedar wrote:The % width in the example is irrelevant
Code: Select all
<table width='150'>
<tr>
<td width='50' align='right'>
<span style='font:11pt Tahoma; color:2C3539'>Part 1
</span>
</td>
<!-- Future tag will go here -->
<td width='50' align='left'>
<span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
</span>
</td>
</tr>
</table>
You could also replaces the spaces with html ( ) to fix the issue:
Code: Select all
<table width='100%'>
<tr>
<td width='50%' align='right'>
<span style='font:11pt Tahoma; color:2C3539'>Part 1
</span>
</td>
<!-- Future tag will go here -->
<td width='50%' align='left'>
<span style='font:bold 11pt Tahoma; color:2C3539'>Part 2
</span>
</td>
</tr>
</table>
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: How do I place a hidden HTML placement
i think you misunderstood him. He mean that the % was 'just an example to show that <!--> is not truely hidden. I agree that using fixed width solves this issue, but does not addresses the core question (how add a tag that is truly hidden).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS