How to hide content of binding using office.js? - ms-word

The Word desktop app allows to hide/display the text by togggling 'Hidden' property in Font properties.
The same can be achieved by setting <w:vanish /> property using binding.setDataAsync(data, Office.coercionType.OOXML) which sets data to a binding. It works in Word desktop app but doesn't work in Word Online. The XML can be found here.
I tried setting data as html and use display: none; as style to the root element and that's not working.
Are there any other ways to hide text with Office.js that works in both Word desktop app and Word Online?

Related

Why does document.execCommand('undo') not work in TinyMCE?

I am working on a chrome extension that lets users pre-configure action sequences.
I noticed that document.execCommand('undo') doesn't work in TinyMCE.
However tinyMCE.execCommand('undo') works fine.
Is there a way to make document.execCommand('undo') work directly in TinyMCE?
Any text or images or other items added to the editor creates an event in the separate, TinyMCE DOM. This is why document.exeCommand('undo'); won't affect added content and returns 'false' in the console.
To see this in action, I contrasted TinyMCE with a standard textarea and content editable section, and tried out the commands in the console: the document.execCommand returns 'true' when run in the console for undoing content in the textarea and contenteditable. But it does return 'false' for TinyMCE.
(As for a way to make document.execCommand run in TinyMCE, I'm not sure it is possible.)

Hidden markdown text on GitHub

Is there anything in markdown syntax specifically on GitHub to support hidden text?
I just want to put some to-do notes in README.md for myself, not to be visible.
EXTRAS
As a tribute to the great answer by Tamas, and what's also asked a lot of times, below is an example of how to write foldable sections within MD files:
<details>
<summary><b>My section header in bold</b></summary>
Any folded content here. It requires an empty line just above it.
</details>
Just use standard HTML comments:
<!-- This is commented out. -->
(This DOESN'T work on GitHub, which strips out CSS. But it can work in other Markdown viewers/editors. The reason I am adding it is because this question came up first when Googling hidden field markdown).
You can hide the field using CSS, if the rendering process respects it and doesn't strip it out:
Is this worth the hassle, as opposed to using an HTML comment? Probably not in most cases, though it does allow toggling visibility on and off.
#### hidden field with metadata 👇
<div class="meta_for_parser tablespecs" style="visibility:hidden">{"dataname":"environment","colvar":"varname","colval":"value"}</div>
#### hidden field with metadata 👆
glow a Rust-based terminal viewer
Typora, on macos
Macdown, on macos
But not GitHub

Modx multiple contents with CKEditor

I am building a website with the Modx CMS.
Now i want to have multiple content area's on one page.
My solution: create an extra TV, set the TV with form customisation to the content, so the tv is under the content.
I created a template looking like this:
[[$top]]
<h1>[[*pagetitle]]</h1>
[[*content]]
[[!myCustomSnippet]]
[[*Other Content]]
[[$bottom]]
After creating the TV, i've set it's region to modx-resource-content.
The result:
As you can see, the text is messing with the CKEditor.
Somebody any ideas how to fix this?
(Using version 2.3.1-pl)
If you are looking to get TVs appear under the content textarea, it is better to use MODX system setting to that. Please goto Settings, and search for tvs_below_content and set it to Yes.
By doing this, the TVs will appear under the content textarea on single page instead of having their own separate tab.
Hopefully this helps.

HTML code not working correctly in Joomla1.5

Hi just started Joomla1.5
Included some HTML code a table and lists within my Joomla1.5 but table border not showing
and lists not aligned at all not sure why.
Imported the extension that allows one to embedd HTML code and used the
{loadposition CustomHTMLpostion} within a content article tested the HTML code with
Textpad works fine but not in Joomla1.5 - any ideas?
Check CSS files of your template, they must have been styling your HTML.
Use firebug(for firefox), to check which CSS styling is being applied on your table or list.
Then override that CSS.

How to get rid of "Click here to enter text" for literal content control with xml generated from serializer

This issue occurs when you have your content control mapped to xml that doesnt have closing tag. For eg. if the xml is and is mapped to literal control than on mapping the text displayed on word document(enable editing or printing) with be something like this
Click here to enter text even if you have removed the text when you create the content control. But if i change xml to than it works fine and i dont see any default text.
So the problem is that i have around 50-60 fields in the object that is serialized using xml serializer than by default it serializes to . So for entire document all the empty xml tags have default text displayed in word document.
Is this a known issue or am i missing something on my end? Is there a way is tweak generated xml to explicitly have closing tag?
This is very easy to recreate. I am using xml sdk v 2.0 and word 2010.
Regards
Mac
Edit Note:
I am still facing this issue. When the custom xml has than it displays the text "Click here to enter text." If i have xml than it works fine. The problem is i have override xml that will force to generate the end tags. But when i parse within xml document it again converts it to self closing tags.
Is there a way to look through the empty content controls and remove it from the document using sdk 2.0?