Author |
Topic: Javascript vs. Flash Client (Read 2793 times) |
|
dree12
Forum Senior Member
Arimaa player #4082
Gender:
Posts: 27
|
|
Re: Javascript vs. Flash Client
« Reply #15 on: Jul 10th, 2011, 8:42pm » |
Quote Modify
|
Code:function makeUnselectable(node) { node.style.MozUserSelect = "none"; var child = node.childNodes; for (i=0;i<child.length;i++) { if (child[i].style) makeUnselectable(child[i]); } } if (document.body.style.MozUserSelect) { makeUnselectable(document.getElementById("boardspan")) } |
| A small improvement for other browsers' sake, and slight optimization. Untested, but should work. [Edit: grammer] [Edit2: maybe this will be better: (in external stylesheet) Code: .moznoselect {-moz-user-select: none} |
| (in script) Code: [code] function makeUnselectable(node) { node.className += node.className ? " moznoselect" : "moznoselect"; var child = node.childNodes; for (i=0;i<child.length;i++) { if (child[i].style) makeUnselectable(child[i]); } } if (document.body.style.MozUserSelect) { makeUnselectable(document.getElementById("boardspan")) } |
| ]
|
« Last Edit: Jul 10th, 2011, 8:50pm by dree12 » |
IP Logged |
|
|
|
Nazgand
Forum Guru
Arimaa player #6461
Gender:
Posts: 87
|
|
Re: Javascript vs. Flash Client
« Reply #16 on: Jul 11th, 2011, 1:05am » |
Quote Modify
|
Looks Good. Looks Great!
|
|
IP Logged |
|
|
|
omar
Forum Guru
Arimaa player #2
Gender:
Posts: 1003
|
|
Re: Javascript vs. Flash Client
« Reply #17 on: Jul 17th, 2011, 12:35pm » |
Quote Modify
|
Using FF 5.0 on Windows 7, I can't get the squares to be selected.
|
|
IP Logged |
|
|
|
Nazgand
Forum Guru
Arimaa player #6461
Gender:
Posts: 87
|
|
Re: Javascript vs. Flash Client
« Reply #18 on: Jul 18th, 2011, 8:38am » |
Quote Modify
|
I cleared my entire firefox(5.0) history, and it still looks like this: After pressing Ctrl+Shift+K and entering the code I posted, I get this: I am curious as to why it is working in firefox for you,(perhaps you coded it to work correctly in both firefox and chrome, but after it got stuck in cache you accidentally changed it to a chrome-only fix), but it is not working for everyone. I suppose we could just tell them all to use chrome though. Edit: I also tested IE9.0, and it doesn't work there either.
|
« Last Edit: Jul 18th, 2011, 8:50am by Nazgand » |
IP Logged |
|
|
|
dree12
Forum Senior Member
Arimaa player #4082
Gender:
Posts: 27
|
|
Re: Javascript vs. Flash Client
« Reply #19 on: Jul 18th, 2011, 5:37pm » |
Quote Modify
|
It should work fine in IE9, except for the fact that the gameroom window is pushed to quirks mode. Fixing this issue may be a even bigger issue, since it would require doing a lot of modifications. First, <center> is no longer a tag. Second, a <!DOCTYPE > is needed. There are no doubt countless other problems, which arguably could be a problem either with IE9 or the page itself.
|
|
IP Logged |
|
|
|
Swynndla
Forum Guru
Arimaa player #1821
Posts: 235
|
|
Re: Javascript vs. Flash Client
« Reply #20 on: Jul 18th, 2011, 6:29pm » |
Quote Modify
|
For what it's worth, google-chrome (12.0) on linux works fine (no blue squares) ... but you probably already know that.
|
|
IP Logged |
|
|
|
|