Emerald Editor Discussion
September 25, 2017, 04:08:06 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: CE Javascript syntax  (Read 8311 times)
0 Members and 1 Guest are viewing this topic.
Michael
Prospector
*
Posts: 4


« on: February 24, 2007, 12:50:09 am »

Hi! Sorry if I'm posting this in the wrong place, I know there's a special CE section but if the syntax files will be forward compatible this should be the place, no?

Anyway, was there ever a big update for the javascript syntax file? The one I have (and the only version I'm able to find on crimsoneditor.com in the syntax section and the forum) is a 2002 version that doesn't know parentNode, firstChild, lastChild etc, doesn't know getElementsByTagName() and thinks getElementsById() is a property rather than a method. Furthermore every single event is written in camelCase instead of lower which means none of them are highlighted if you write working code.

Does nobody ever write javascript anymore or is there something I'm missing?
Logged
Arantor
Site Administrator
Administrator
Master Jeweller
*****
Posts: 618



« Reply #1 on: February 24, 2007, 11:38:37 am »

Well, I use the one CE comes with as standard, which supports camelCase (I write my own JS in camelCase and it runs fine in IE/Firefox)

You're right, though, it doesn't support later functions of JS. I'll try and put together a more complete syntax before long (anyhow, a more complex one will be required for EE)

JS does seem to be dying out in this multimedia-rich world where high speed connections are common; Flash seems to be more preferable these days.
Logged

"Cleverly disguised as a responsible adult!"
Michael
Prospector
*
Posts: 4


« Reply #2 on: February 24, 2007, 02:38:03 pm »

Uhm... AJAX?

phpBB, Gmail, blogging, all fancy wysiwyg editors.. If anything javascript is becoming more serious these days. Marquees in the status bar seem a thing of the past though Wink

Anyway, camelcase itself isn't a problem, just that javascript doesn't use camelcase for events. So it's onchange, onmouseover etc, and not onChange as listed in the syntax file. Even IE5 gets that right.

Javascript isn't as handily documented as say php so I don't really see a quick and easy way to update this file. I don't have the time to do anything thorough so I'm just adding bits as I go along. Updates so far:

Under
  [KEYWORDS4:GLOBAL]  (# Properties)
I added
  parentNode firstChild lastChild nodeName nodeValue nodeType id
and removed getElementsById, which I listed under
  [KEYWORDS6:GLOBAL]  (# Methods)
together with
  getElementsByTagName

The event section loses it's faulty camelcasing to become:

[KEYWORDS7:GLOBAL]
# Event handlers
onabort onblur onchange onclick ondblclick ondragdrop
onerror onfocus onkeydown onkeypress onkeyup
onload onmousedown onmousemove onmouseout onmouseover
onmouseup onmove onreset onresize onselect onsubmit onunload

And that's just about it. I don't know javascript well enough to comment on the rest, but it seems like most DOM related keywords are missing.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.082 seconds with 18 queries.