Etherpad: setHTML API response is successful but updated html is not visible on etherpad - etherpad

When I create a new pad and use newly created padID in /setHTML API, this updates HTML and updated
HTML is visible on pad. But, when I use the same process for a pad where I'm creating sessions etc the and use padID in /setHTML, this call is successful but updated HTML is not visible on the pad. However, this is getting saved in DB.
Please help!
Regards,

I've found the mistake which I was making in calling etherpad.The correct way is given below. This is working fine for me.
<iframe src='http://pad.domain/p/PAD_NAME?sessionID=sessionID&userName=userName&showChat=false&showLineNumbers=false' width=600 height=400></iframe>
PAD_NAME and padID are sam in my case. /setHTML is working fine when I use padID.

Related

How to redirect to a website in Godot Web

I'm planning on trying to see if it's possible to make a website in Godot(Yes, I know I shouldn't I just want to try just to try). I thinking about and looking over the features I need and I have one problem.
I just need a way for a person to press a button and get redirected to my itch games. I don't care if it creates a new tab or changes the current tab. Thank you for any help.
If you dont export to web you can call
OS.shell_open("url")
Sadly this does not work in an html export. A solution I found for myself is the JavaScript Interface. As the name suggested it allows you to execute Javascript.
So to open a URL you could connect the pressed signal of a button to something like this:
if OS.has_feature('JavaScript'):
JavaScript.eval("""
window.open('https://google.com', '_blank').focus();
""")
This will open a new tab in the active browser.
I also found an article on the godot site, basically asking the same question (https://godotengine.org/qa/46978/how-do-i-open-richtextlabel-bbcode-links-in-an-html5-export). Here they tried to use an RichTextLabel with BBCode.
The solution did not work for me, when I tested it, though.
As pointed in the comments you can try OS.shell_open, for example:
OS.shell_open("https://example.com")
That only works if it is not an HTML export.
Your other alternative is to eval JavaScript, for example this navigates the current tab:
JavaScript.eval("window.location.href='https://example.com'")
Which only works if it is an HTML export.
Since that only works for an HTML export and the other does not work on an HTML export... If you need both you can do this:
if OS.get_name() == "HTML5":
JavaScript.eval("window.location.href='https://example.com'")
else:
OS.shell_open("https://example.com")
See also Close a game in Godot.

Is there a way to make an image displayable in one website only?

I need to make a website with an private image inside of <img /> tag, which mean you cannot view it any where outside that website. I need the image to not be displayed even if the user try to copy the src of the image and open it in another tab of the same browser.
Is it possible? If so, how can i achieve that?
Short answer: no. Long answer: not possible :-)
If you can get at it in any way (and you must be able to do that to get it to render in a browser), you can save it locally.
All someone would have to do is access it with a munged copy of a browser that saves all incoming data to disk.
There are ways to obfuscate the image so that the user won't be able to just copy and paste the URL, you can use the Javascript Image object to create a new image and drawImage to draw it into a canvas, however you'll still need to obtain the image data somehow, perhaps making an ajax request for the actual image on the server. However a really persistent user can inspect your javascript code and do some reverse engineering to get the image source.
A more naive user will just take an screenshot of the image and achieve the same effect.
So any attempt to try to prevent the user from copying the image is futile.

Image not rendering in meteor

I'm using collectionFs to upload and display images.
Everything works perfectly except that when I try to display the image in the template nothing happens.
If I write {{this.url}} the url displays perfectly
/cfs/files/images/GkPAjn98N6izJYc6x/blogging.jpg
However if I write <img src="{{this.url}}"> nothing happens
Any idea why this is?
If you inspect the element what you get?
you get <im src="/cfs/files/images/GkPAjn98N6izJYc6x/blogging.jpg"/>
Also be sure you have the allow download to true
Images.allow({
download:function(){return true;}
})
Check out this DEMO
NOTE: do a meteor list and check that you have the latest version of cfs:stander:packages and cfs:gridfs or filesystem

HtmlWidget source?

I added a HtmlWidget and it displays fine on the webpage.
I would like to know where the source code is for HtmlWidget. I would like to step through the code when I create a new HtmlWidget, when I save a HtmlWidget, when a HtmlWidget is rendered, etc. Can someone point me where to look.
Thanks
It's just a ConentType which has a BodyPart, CommonPart, IdentityPart and a WidgetPart, you can see where it's created here: http://orchard.codeplex.com/SourceControl/latest#src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs

Jump to URL doesn't work

I have a report that contains a link to a Word document. I have created an Action on the textbox that is Jump to URL, with the URL populated.
I have a PerformancePoint dashboard displaying the report, which is in a report library using SharePoint Integrated reports.
The link is not working correctly. Following the recommendations of this guy I surrounded my link w/ the javascript to open in a new window.
This works everywhere except for the end result. The link works from BIDS, Dashboard Designer, and the Report Library. It does not work from within the dashboard deployed to the SharePoint site. Any ideas?
Edit:
This HTML link:
=First(Fields!Link.Value, "MyUrl")
gives me this in the rendered report:
<TD style="WIDTH:53.98mm;word-wrap:break-word;HEIGHT:6.35mm;" class="a7">Click Me!</TD>
This Javascript link:
="javascript:window.location.href='" & First(Fields!Link.Value, "MyUrl") & "';"
gives me this in the rendered report:
<a tabindex="40" href="javascript:window.location.href='http://example.com/sites/some/subsite/DocumentLibrary/Folder/MyDocument.doc';" style="color:Blue" TARGET="_top">Click Me!</a>
Which does nothing when you click it.
I'm not familiar with Performancepoint, but the way you write the javascript seems like you simplified it a bit? I'm asking because the only way that perfectly fine link would not work would be if the page has a return false for the links in it. Try moving the whole changing the URL into a function, like:
<script type='text/javascript'>
function goTo(url) {
window.event.stopPropagation(); // cancelBubble() in IE
location.href = url;
return false;
}
</script>
with the link being:
="javascript:goTo('" & First(Fields!Link.Value, "MyUrl") & "')"
and do some trial and error inside the goTo function, sorry not being able to help you more precisely. Try also testing in a second browser (if you are not already) to see if this is some browser-specific behavior.
It turns out that there were two issues going on.
My first attempt at rendering a link using https://example.com/... didn't work because Reporting Services 2005 refuses to link to https web sites. (no source for this info, just determined through experimentation)
My second attempt at putting javascript around the link failed because PerformancePoint 2007 dashboards don't execute JavaScript from a report. (no source for this info, just determined through experimentation)
The solution was to go back to a straight HTML solution, and use http. This gets redirected to https and the document loads. This solution may not work if your environment does not automatically redirect http --> https.
I didn't mention the https in my original question because I didn't realize that would make a difference.

Resources