detect if flash is installed without js - java

If flash is not installed, i want to replace the flash animation with a jquery animation.
BUT if flash and js are not installed, i want to display a div with a message to the user.
how is it possible to check if flash is not running at the clientside without using js?
kind regards,

Use a javascript event to replace your message with the Flash animation. If Javascript is not running, you will see the message instead.
SWFObject is a great little tool for completing exactly what you want.

Add to HTML body classes: "no_flash no_js". They will be your default when js & flash not available.
Then when you have js, with it's help remove no_js class.
With help of js try to determine flash and if it's present, show flash else -- js animation.

Do it the other way around:
Display a div with a message
If JavaScript is on, replace the div with either:
a) a Flash animation, if Flash is installed or
b) a jQuery based animation

Related

Java Browser handle button click

I need to open a browser with URL and then wait till person clicks a special button. And if it happens, return true. Can I implement it with java tools or should I use javascript?
You should use JavaScript. Java is a Server side language, so all processing of Java code will be completed before the user has the chance to interact with the page. JavaScript (traditionally) works on the client-side and is commonly used to capture user interactions with the browser.
yes, Java Script or any frame work that builds on Java script like Jquery works for you. If understands you correctly,
create Hyper link
Browse the page that you needed
Place HTML button on the page, write onClick logic on that button to return true.

Generating a hardcopy or screen shot using GWT

Is it possible to capture the screen or generate a hardcopy in GWT programatically?
using AWT its possible but the AWT can't be used in GWT[only GWT not any other like smartGWT, ext-GWT]?
On client side GWT do nothing more than Javascript. So your question is: Can I take screen shot in JavaScript? The answer is:
If you want only take screen shot inside browser and can bear different you can use html2canvas.
If you want also take screen shot out of browser, you have to use other technology such as ActiveX control (may be Java Applet with AWT).
Check this: Take a screenshot of a webpage with JavaScript?
I don't believe that you will find anything native in GWT to do this. I believe that the best that you could manage would be something like this:
http://html2canvas.hertzen.com/
GWT just compiles java into javascript as it as been said by other guys in their answer. So you can look for a solution on the client but you can also do it on the server side.
One way to make it is to use phantomJS (which is a kind of webkit on the server) to rasterize the web page into an image on the server side. Could be really usefull to create features like "Export" etc
Phantom JS scree n capture

Can I enable intranet users to take screenshot of the current page via the browser?

Is it possible to create a screenshot from the current page the user is on? (It's for an Intranet enviroment).
I know this is not possible with JavaScript alone, but is it possible with Flash or maybe an Java applet?
I have been searching around but I couldn't find anything.
Thanks.
It might be possible to do in a Java applet that is signed. The Robot class has a method that makes it possible to capture the screen; Robot.createScreenCapture
You can send the page url to server side script or to an app on the server and return the full page screenshot image
A software product like Easy Capture allows Windows users to take a screen shot of the full screen, which can be useful in debugging.

Preventing SWT Browser Elements from Receiving Mouse Clicks

I'm working with the eclipse SWT toolkit, and I'm trying to use it to create a browser window that only passes mouse clicks to the underlying document conditionally (I want to stop Flash and Javascript in the page from getting clicks). I'd like some way of doing one of:
Examining mouse events as they come in, and only passing them on to other listeners based on conditions I specify.
Removing all listeners from a window, and only putting back the ones I want.
Are either of these possible?
Browser, like other SWT components, have addMouseListener method. So you could implement your own listener a pass only which one you want.
see javadoc of browser
Edit
According to your request, there could be two possible ways to do it.
First, you could use listening of events from JavaScript in browser (there is no way to avoid JavaScript if you work with html pages). If you know that you will have Mozilla browser render core (you have to install XUL Runner), you could use JavaXPCOM, but that's big unknown for me.
snippet - listen for DOM mousedown events with javascript
Second, you can call Java functions from JavaScript (again, handle onclick event, and then decide on Java, if you don't want to use JavaScript for it).
snippet - call Java from JavaScript
But frankly both ways are more ugly-er that proposed way by pure JavaScript.

Pasting a Screen shot into a text area on a web page

Is it possible to take a screen shot (using the Print Screen) and paste it from the System Clipboard directly into a web pages text area field (which I would create)? Do I need a browser plug-in? Can Flash do this?
**The solution only has to work in Internet Explorer.
This is not possible without a plugin.
It's not possible in Flash or Silverlight either, although it is possible in AIR.
I think you will have to write a custom ActiveX Control in order to do this. The control should automatically take a screenshot and send captured image to server-side code..
There is one more option - create a java applet, which will do the job, and also will help you to avoid cross browser issue.

Categories

Resources