how to set content of a speicific node inside tinymce? - editor

I want to set content of an element to the first node of the tiny mce. I can retrieve the id of this node, but don't know how to set content inside it.
Help Appreciated.
Thanks in advance.

You can do that using something like the following. Make sure to enter valid html.
tinyMCE.activeEditor.getBody().firstChild.innerHTML='<span class="customStyle">Testtext</span>';

Related

Dynamic hyperlink with mergefield possible?

I've tried several guides, but i haven't really found that any of them fit my purpose.
The problem seems simple enough, i want to create a dynamic link based on a variable.
I've tried inserting a Hyperlink with temp text and link, replacing the text within the "" brackets, with a MergeField corresponding to the variable.
Whenever i test it, the variable does not register. The syntax is as follows :
{ HYPERLINK "www.staticurl/{MergeField varurl}" }
Does anyone have any suggestions on why this variable does not register?
Thanks in advance!

Is there a way to include hyperlinks in nodes in neo4j?

I am working on creating nodes and relationships. For a particular type of node, there is a hyperlink that I would like attach to it(perhaps as a property) so that users would be able to click and see more details on that node.
Does anyone know if that is possible? Happy to provide more details if needed.
Thanks in advance.
A standard string property would work just fine. It works as a regular hyperlink in the Neo4j browser.
CREATE (n:Sample {link: "https://google.com"}) RETURN n;

Not able to click on POST button with xpath code

driver.findElement(By.xpath("//*[#id=\"ember558\"]")).click();
I am doing testing for linkedin post. I entered this code for POST button but that does not work. Can you please suggest about this?
It seems that #id attribute value is dynamic so, it will not be able to interact with the Element. You can try with dynamic X-path techniques. Generally, a set of data keeps on changing and rest data remains same.
e.g. <button "id":"emns1233">
here starting part of id will remain same every time but last part that is 1233 will change (may be each time). So, one can try to write X-path as
driver.findElement(By.xpath("//button[starts-with(#id,'emn')])).
Hope it helps. Thanks

How to set root construct for SnakeYaml?

I'd like to a construct which is going to kick in by default and therefore I'll be able to extract some metadata and remove it from the parsed YAML.
For instance I could have a construct to do that but in SnakeYAML to register a construct one has to specify a String for it meaning that it has to have a name. However, I don't want that but instead I want my tag to be a root one, a default one which always will kick in so to say.
Is there a possibility to do something like that?
Cheers,
I actually found the answer myself, there is a property
at org.yaml.snakeyaml.constructor.BaseConstructor#rootTag which one can set a tag like:
super.rootTag = new Tag("!root");
The rest is simple because one has to only register that construct to org.yaml.snakeyaml.constructor.BaseConstructor#yamlConstructors and you are done. Your construct will be triggered in all read attempts.
Hope that helps to someone,
Cheers,

nokogiri and the href label

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.
I have this code:
#name = page.css("#content").css("a")[1]
Which gives this result
generation xerox
I want to get at the "generation xerox" bit
I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work
Thanks in advance all
You can access the label with #name.text and the link with #name['href']
See doc

Resources