does dropzone-amd-module.js support IE 11? - requirejs

Per the dropzone site version 5.0 should support IE10+. I am using dropzone-amd-module.js ver 5.5 in a Durandal app and IE11 does not seem to support Symbol.iterator. Since I need to support IE11 at least for a little while I'm looking for options. Does any know what the latest version of dropzone-amd-module.js is that will run in IE11?

The fix was to remove any reference to Symbol.iterator wherever it occurs (a few dozen places) from dropzone-amd-module.js like this:
replace this
for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 =
Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 :
_iterator2[Symbol.iterator]();;) {
with this
for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 = true, _i2
= 0; ;) {

Related

EaselJS StageGL: text not working (but does using Stage canvas)

I re-programmed a HTML5 game (using createJS) to match StageGL, but it turned out all text fields disappear. Switching back to Stage solved this specific problem (see code example below).
Does anyone know a workaround to this?
Example code:
canvas.width = stageWidth;
canvas.height = stageHeight;
stage = new createjs.StageGL(canvas); // <= text does not work with GL???
stage = new createjs.Stage(canvas); // <= text works fine
var textTest = new createjs.Text("Hello World");
textTest.x = 10;
textTest.y = 20;
stage.addChild(textTest);
Thanks in advance for your comments!
Text will not work without being cached, as the Text/Vector canvas APIs are not supported by StageGL.
Caching is pretty easy:
var bounds = text.getBounds();
text.cache(bounds.x, bounds.y, bounds.width, bounds.height);
When the text changes, you will need to recache the text.
Cheers,

Windows 10 not responding to uiAction 47 (SPI_SETWORKAREA) for user32.dll's SystemParametersInfo(uAction, uParam, lpvParam, fuWinIni)

Does anyone have any information on why Windows 10 no longer allows you to set a custom WorkArea using SystemParametersInfo? I was using this to reserve screen space for dock/bar applications. Anyone had any luck getting it working?
For reference the code on this question works to set a custom work area In Windows 8.1, 8, 7, and XP, but no longer works on Windows 10.
How can I resize the desktop work area using the SPI_SETWORKAREA flag?
My only alternative options seem to be using SHAppBarMessage (not preferable as it does not allow modifying form opacity to my knowledge), or using SetWindowsHookEx with WH_CALLWNDPROC, but that seems to require .dll injection for external processes?
I had a similar issue, an old program that correctly set the work area in Windows 7 stopped working in Windows 10.
What worked for me was changing the 'fWinIni' argument (the last argument) from SPIF_CHANGE to SPIF_UPDATEINIFILE.
So, what previously worked but doesn't anymore:
private const uint SPIF_SENDWININICHANGE = 2;
private const uint SPIF_UPDATEINIFILE = 1;
private const uint SPIF_CHANGE = SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE;
SystemParametersInfo(SPI_SETWORKAREA, 0, ref rect, SPIF_CHANGE);
What works correctly now:
private const uint SPIF_SENDWININICHANGE = 2;
private const uint SPIF_UPDATEINIFILE = 1;
private const uint SPIF_CHANGE = SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE;
SystemParametersInfo(SPI_SETWORKAREA, 0, ref rect, SPIF_UPDATEINIFILE);
Hopefully this works for you as well.
Just as an FYI when I used just the SPIF_UPDATEINIFILE only in the SystemParameterInfo send I had issues where the Screen.PrimaryScreen.WorkArea wasn't recognising the system changes and was permanently set to the full bounds of the screen.
SystemParametersInfo(SPI_SETWORKAREA, 0, ref rect, 0);
Worked better for me in Windows 10 and correctly set the workarea variables.

Problems with Richefaces default editor on IE9 or edge

I had a problem with default editor (TinyMCE) of Richfaces version 3.3.1.GA when the user is using Internet Explorer 9. I've read many people here and on the Internet who prefer to use X-UA-Compatible metadata to downgrade IE version, but, I dislike it. I always prefer to use the edge version because I'm using CSS 3 as well.
Another solution was a upgrade of RichFaces however I've not considered the possibility for the sake that my application is a pretty legacy.
Then I started unzipping the RichFacesUI jar and changing the file META-INF/resources-config.xml from:
<resource>
<name>scripts/tiny_mce/tiny_mce.js</name>
<path>org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce.js</path>
<renderer class="org.ajax4jsf.resource.ScriptRenderer"/>
</resource>
to:
<resource>
<name>scripts/tiny_mce/tiny_mce.js</name>
<path>org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js</path>
<renderer class="org.ajax4jsf.resource.ScriptRenderer"/>
</resource>
This is to ease the script debugging. That would be pretty hard without it.
First of all these problems are occur because Richfaces uses a specific statement to old IEs therefore I putted the following code to know what version of IE is execution:
var ie = (function(){
var undef,
v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : undef;
}());
PS: This clever code is from James Padolsey and I found it here in this question.
Then I ran my application and where it broke I changed the closest IE if statement as the following examples:
Before it was:
if (isIE) {
Then it became:
if (ie < 9) {
And when it was negative statement like:
if (!isIE) {
Then it became:
if (!isIE || ie > 8) {
The only difference was in the getXML function which was like:
if (!i || !i.createDocument) {
Then I changed to:
if (!i || !i.createDocument || ie > 8) {
In this Gist are all changes that I did. I hope that it helps anyone with this problem.
If you want I putted the jars which I changed on the following links:
Richfaces-impl-3.3.1.GA
Richfaces-ui-3.3.1.GA
Please, sorry my English mistakes, you are encouraged to re-write and fix this post.

LWJGL Fullscreen not working

I'm trying to add fullscreen functionality to my program but I couldn't get it to work. I'm trying
Display.setFullscreen(true);
I tried changing its position to above where I create the display or where I set the displaymode, but still not working. Any help about this?
From my experience the DisplayMode needs to support it. You can try this:
DisplayMode displayMode = null;
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++)
{
if (modes[i].getWidth() == width
&& modes[i].getHeight() == height
&& modes[i].isFullscreenCapable())
{
displayMode = modes[i];
}
}
After doing this your Display.setFullscreen(true) should work
I know this question is quite (5 years) old, but there may still be people looking for a solution to this question.
The simplest way is to do:
Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());
Which will put your display in fullscreen for you. No need for setFullscreen() with this either.

How get fonts installed or supportd in mobile using getProperty - java me

Hope you all will be fine. Can any one tell me how can i get the fonts installed or supported in the mobile. And suppose urdu font supported by the mobile then i set a condition like this.
[code]
import java.lang.*;
String value;
String key = "microedition.font"; // not real need value it's just to show what i want
value = System.getProperty( key );
If (value == urdu){
txtArea2.getStyle.setFont(value);
} else {
System.out.println("Urdu not supported);
}
[/code]
is it possible to do something like this.
Thank you.
MIDP 2.x defines 3 faces of font with 3 sizes + 3 styles.
FACE_MONOSPACE
FACE_PROPORTIONAL
FACE_SYSTEM
SIZE_LARGE
SIZE_MEDIUM
SIZE_SMALL
STYLE_BOLD
STYLE_ITALIC
STYLE_UNDERLINED
You can choose font by using these values as like the below code:
Font f = Font.getFont(FACE_SYSTEM | SIZE_MEDIUM | STYLE_ITALIC);
From MIDP 3.0, you can assign font name with installed font or downloaded font. as like:
Font[] f = Font.getAvailableFonts(); // Get available fonts
Font a = Font.getFont("Andale Mono", STYLE_ITALIC, 10); // Get specific font
Unfortunately, there is no development tools for MIDP3 now.

Resources